summaryrefslogtreecommitdiffstats
path: root/hw/block/virtio-blk.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-06-17 14:32:08 +0800
committerKevin Wolf <kwolf@redhat.com>2014-06-27 18:20:37 +0200
commit4407c1c56adb0d3ef2bcbf577592d72278d6e11f (patch)
tree606fb2099ef1e530b5d540edbac242bb8eb14712 /hw/block/virtio-blk.c
parentfee65db77181e6697745b313906bc4fdb30d2ff9 (diff)
downloadhqemu-4407c1c56adb0d3ef2bcbf577592d72278d6e11f.zip
hqemu-4407c1c56adb0d3ef2bcbf577592d72278d6e11f.tar.gz
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 <famz@redhat.com> Tested-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/block/virtio-blk.c')
-rw-r--r--hw/block/virtio-blk.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 77fb447..a222e3f 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);
}
}
OpenPOWER on IntegriCloud