Skip to content

Commit

Permalink
virtio-blk: allow drive_del with dataplane
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
stefanhaRH committed Aug 29, 2014
1 parent 8ad4202 commit 3255d1c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions hw/block/dataplane/virtio-blk.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3255d1c

Please sign in to comment.