From: Fam Zheng Date: Tue, 17 Jun 2014 06:32:08 +0000 (+0800) Subject: virtio-blk: Schedule BH in the right context X-Git-Tag: v2.1.0-rc0~17^2~13 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4407c1c56adb0d3ef2bcbf577592d72278d6e11f;p=users%2Fdwmw2%2Fqemu.git virtio-blk: Schedule BH in the right context The BH must be called in the AioContext of bs. Currently it is only the main loop, but with coming changes, it could also be a dataplane IOThread. Signed-off-by: Fam Zheng Tested-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index 77fb4477c6..a222e3f9a4 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -469,7 +469,8 @@ static void virtio_blk_dma_restart_cb(void *opaque, int running, } if (!s->bh) { - s->bh = qemu_bh_new(virtio_blk_dma_restart_bh, s); + s->bh = aio_bh_new(bdrv_get_aio_context(s->blk.conf.bs), + virtio_blk_dma_restart_bh, s); qemu_bh_schedule(s->bh); } }