]> git.proxmox.com Git - mirror_qemu.git/commit - blockdev.c
blockdev: acquire AioContext in eject, change, and block_passwd
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 19 Nov 2014 14:19:44 +0000 (14:19 +0000)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 Dec 2014 09:25:30 +0000 (10:25 +0100)
commite3442099a2794925dfbe83711cd204caf80eae60
tree32e3772050fd618e7665ae4f4b981c61ec5de027
parent0b92885420c9cf42da27c63939d388e276a7ddde
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>
blockdev.c
hw/block/dataplane/virtio-blk.c