Skip to contentSkip to conversation

Call qemu_bh_delete at bdrv_aio_bh_cb

PATCH In review Dor Laor 3 participants 3 messages Jun 1, 2009 – Jun 23, 2009

lore
Share & tools
lore

Dor Laor

author
#0 lore raw

PATCH 1/1 Call qemu_bh_delete at bdrv_aio_bh_cb

Quoted 1 line

From 09ad82d8b8ebd1670aadf21eae8021dfad373c61 Mon Sep 17 00:00:00 2001

From: Dor Laor <[email protected]>
Date: Mon, 1 Jun 2009 12:07:23 +0300
Subject: [PATCH] Call qemu_bh_delete at bdrv_aio_bh_cb.
Also replave qemu_bh_cancel with qemu_bh_delete in bdrv_aio_cancel_em. Otherwise the bh will live forever in the bh list.

---
 block.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
block.c +2 -2
index c80d4b9..4a0b642 100644
@@ -1402,7 +1402,7 @@ static void bdrv_aio_bh_cb(void *opaque)
         qemu_iovec_from_buffer(acb->qiov, acb->bounce, acb->qiov->size);
     qemu_vfree(acb->bounce);
     acb->common.cb(acb->common.opaque, acb->ret);
-
+    qemu_bh_delete(acb->bh);
     qemu_aio_release(acb);
 }
 
@@ -1455,7 +1455,7 @@ static BlockDriverAIOCB *bdrv_aio_writev_em(BlockDriverState *bs,
 static void bdrv_aio_cancel_em(BlockDriverAIOCB *blockacb)
 {
     BlockDriverAIOCBSync *acb = (BlockDriverAIOCBSync *)blockacb;
-    qemu_bh_cancel(acb->bh);
+    qemu_bh_delete(acb->bh);
     qemu_aio_release(acb);
 }
 
Signature · 1 line
1.5.6.6
#1 lore raw
Quoted 8 lines · Dor Laor
Quoted 3 lines

From 09ad82d8b8ebd1670aadf21eae8021dfad373c61 Mon Sep 17 00:00:00 2001

From: Dor Laor <[email protected]>
Date: Mon, 1 Jun 2009 12:07:23 +0300
Subject: [PATCH] Call qemu_bh_delete at bdrv_aio_bh_cb.
Also replave qemu_bh_cancel with qemu_bh_delete in bdrv_aio_cancel_em. Otherwise the bh will live forever in the bh list.

Looks good to me. Those lifetime rules for QEMUBH objects look quite awfull to me, though - but this whole don't directly free objects but rather wait for $event (or forever) scheme seems pretty common in qemu.

#2 lore raw
In reply to Dor Laor
Quoted 4 lines · Dor Laor

Subject: [PATCH] Call qemu_bh_delete at bdrv_aio_bh_cb.
Also replave qemu_bh_cancel with qemu_bh_delete in bdrv_aio_cancel_em. Otherwise the bh will live forever in the bh list.

This breaks vmdk. Qemu hangs while starting up. Trying to see why.

Signature · 1 line
error compiling committee.c: too many arguments to function