]> xenbits.xensource.com Git - qemu-xen-4.3-testing.git/commitdiff
block: Clean up after deleting BHs
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 7 Oct 2009 14:57:18 +0000 (15:57 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 7 Oct 2009 14:57:18 +0000 (15:57 +0100)
Commit 6a7ad299 ("Call qemu_bh_delete at bdrv_aio_bh_cb") deletes emulated
aio bottom halves to prevent endless accumulation.  However, it leaves a
stale ->bh pointer, which is then waited on when the aio is reused.

Zeroing the pointer fixes the issue, allowing vmdk format images to be used.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
[ Backported from 6bbff9a0b495918309074ac60375be5f9dc868b3
  by Stefano Stabellini. ]

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
block.c

diff --git a/block.c b/block.c
index bad2d3da9bc6c97db0ee597a095048235be9a767..88e70d3e15f9b0865242ab0162359cdf1e33a351 100644 (file)
--- a/block.c
+++ b/block.c
@@ -1523,6 +1523,7 @@ static void bdrv_aio_bh_cb(void *opaque)
     BlockDriverAIOCBSync *acb = opaque;
     acb->common.cb(acb->common.opaque, acb->ret);
     qemu_bh_delete(acb->bh);
+    acb->bh = NULL;
     qemu_aio_release(acb);
 }
 
@@ -1562,6 +1563,7 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB *blockacb)
 {
     BlockDriverAIOCBSync *acb = (BlockDriverAIOCBSync *)blockacb;
     qemu_bh_delete(acb->bh);
+    acb->bh = NULL;
     qemu_aio_release(acb);
 }