summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Hajnoczi2014-08-18 17:07:13 +0200
committerStefan Hajnoczi2014-08-29 17:01:48 +0200
commit3255d1c21f364774390061fbc3b8e25c027cc862 (patch)
treea03b99470af3b48cd5c249b7326211f86ce9eed9
parentblock: acquire AioContext in do_drive_del() (diff)
downloadqemu-3255d1c21f364774390061fbc3b8e25c027cc862.tar.gz
qemu-3255d1c21f364774390061fbc3b8e25c027cc862.tar.xz
qemu-3255d1c21f364774390061fbc3b8e25c027cc862.zip
virtio-blk: allow drive_del with dataplane
Now that drive_del acquires the AioContext we can safely allow deleting the drive. As with non-dataplane mode, all I/Os submitted by the guest after drive_del will return EIO. This patch makes hot unplug work with virtio-blk dataplane. Previously drive_del reported an error because the device was busy. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
-rw-r--r--hw/block/dataplane/virtio-blk.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index c07adc6e4f..b55188cb82 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -194,6 +194,7 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk,
error_setg(&s->blocker, "block device is in use by data plane");
bdrv_op_block_all(blk->conf.bs, s->blocker);
bdrv_op_unblock(blk->conf.bs, BLOCK_OP_TYPE_RESIZE, s->blocker);
+ bdrv_op_unblock(blk->conf.bs, BLOCK_OP_TYPE_DRIVE_DEL, s->blocker);
*dataplane = s;
}