[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/14] Allow nested qemu_bh_poll() after BH deletion
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 14/14] Allow nested qemu_bh_poll() after BH deletion |
Date: |
Wed, 15 Jun 2011 16:03:13 +0200 |
Without this, qemu segfaults when a BH handler first deletes its BH and
then calls another function which involves a nested qemu_bh_poll() call.
This can be reproduced by generating an I/O error (e.g. with blkdebug) on
an IDE device and using rerror/werror=stop to stop the VM. When continuing
the VM, qemu segfaults.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
---
async.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/async.c b/async.c
index 57ac3a8..fd313df 100644
--- a/async.c
+++ b/async.c
@@ -137,11 +137,12 @@ QEMUBH *qemu_bh_new(QEMUBHFunc *cb, void *opaque)
int qemu_bh_poll(void)
{
- QEMUBH *bh, **bhp;
+ QEMUBH *bh, **bhp, *next;
int ret;
ret = 0;
- for (bh = async_context->first_bh; bh; bh = bh->next) {
+ for (bh = async_context->first_bh; bh; bh = next) {
+ next = bh->next;
if (!bh->deleted && bh->scheduled) {
bh->scheduled = 0;
if (!bh->idle)
--
1.7.5.2
- [Qemu-devel] [PATCH 02/14] qcow2: Avoid direct AIO callback, (continued)
- [Qemu-devel] [PATCH 02/14] qcow2: Avoid direct AIO callback, Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 06/14] qcow2: Fix in-flight list after qcow2_cache_put failure, Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 05/14] Replaced tabs with spaces in block.h and block_int.h, Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 07/14] ide: Split error status from status register, Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 08/14] ide: Fix ide_drive_pio_state_needed(), Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 09/14] ide: Add forgotten VMSTATE_END_OF_LIST in subsection, Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 10/14] make dma_bdrv_io available to drivers, Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 11/14] ide: allow other dma comands than read and write, Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 13/14] ide: Clear error_status after restarting flush, Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 03/14] qcow: Avoid direct AIO callback, Kevin Wolf, 2011/06/15
- [Qemu-devel] [PATCH 14/14] Allow nested qemu_bh_poll() after BH deletion,
Kevin Wolf <=
- [Qemu-devel] [PATCH 12/14] ide: add TRIM support, Kevin Wolf, 2011/06/15
- Re: [Qemu-devel] [PULL 00/14] Block patches, Anthony Liguori, 2011/06/15