diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2014-11-19 14:19:44 +0000 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-12-10 10:25:30 +0100 |
commit | e3442099a2794925dfbe83711cd204caf80eae60 (patch) | |
tree | 32e3772050fd618e7665ae4f4b981c61ec5de027 /hw/block/dataplane | |
parent | 0b92885420c9cf42da27c63939d388e276a7ddde (diff) | |
download | qemu-e3442099a2794925dfbe83711cd204caf80eae60.tar.gz qemu-e3442099a2794925dfbe83711cd204caf80eae60.tar.bz2 qemu-e3442099a2794925dfbe83711cd204caf80eae60.zip |
blockdev: acquire AioContext in eject, change, and block_passwd
By acquiring the AioContext we avoid race conditions with the dataplane
thread which may also be accessing the BlockDriverState.
Fix up eject, change, and block_passwd in a single patch because
qmp_eject() and qmp_change_blockdev() both call eject_device(). Also
fix block_passwd while we're tackling a command that takes a block
encryption password.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/block/dataplane')
-rw-r--r-- | 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 5ab64c5c42..2548113978 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -198,6 +198,7 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_DRIVE_DEL, s->blocker); blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_BACKUP_SOURCE, s->blocker); blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_COMMIT, s->blocker); + blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_EJECT, s->blocker); blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE, s->blocker); blk_op_unblock(conf->conf.blk, BLOCK_OP_TYPE_MIRROR, s->blocker); |