From aa223e04be24a163211415533e61bd2f135ec1e9 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Wed, 3 Sep 2014 09:18:01 +0200 Subject: [PATCH 08/15] virtio-blk: allow drive_del with dataplane Message-id: <1409735881-28863-5-git-send-email-stefanha@redhat.com> Patchwork-id: 60825 O-Subject: [RHEL7.1 qemu-kvm-rhev PATCH 4/4] virtio-blk: allow drive_del with dataplane Bugzilla: 1136752 RH-Acked-by: Paolo Bonzini RH-Acked-by: Laszlo Ersek RH-Acked-by: Fam Zheng 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 (cherry picked from commit 3255d1c21f364774390061fbc3b8e25c027cc862) Signed-off-by: Stefan Hajnoczi --- hw/block/dataplane/virtio-blk.c | 1 + 1 file changed, 1 insertion(+) Signed-off-by: Miroslav Rezanina --- hw/block/dataplane/virtio-blk.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index b042caf..f1c53ec 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -193,6 +193,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; } -- 1.7.1