aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-06-23 16:20:36 +0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-07-10 13:44:30 -0500
commit36afc451599175eb8f03f1962de74e7f7a8af4db (patch)
treeffbbdd33f4baf0460a6ef021892c1d89f3df19d4 /block.c
parent0884657b2e39f2cf85dfa99361817fde07e83786 (diff)
downloadqemu-36afc451599175eb8f03f1962de74e7f7a8af4db.zip
qemu-36afc451599175eb8f03f1962de74e7f7a8af4db.tar.gz
qemu-36afc451599175eb8f03f1962de74e7f7a8af4db.tar.bz2
block: Clean up after deleting BHs
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>
Diffstat (limited to 'block.c')
-rw-r--r--block.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/block.c b/block.c
index aca5a6d..cefbe77 100644
--- a/block.c
+++ b/block.c
@@ -1374,6 +1374,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);
}
@@ -1391,6 +1392,7 @@ static void bdrv_aio_bh_cb(void *opaque)
qemu_vfree(acb->bounce);
acb->common.cb(acb->common.opaque, acb->ret);
qemu_bh_delete(acb->bh);
+ acb->bh = NULL;
qemu_aio_release(acb);
}