On 2014-11-19 at 15:19, Stefan Hajnoczi wrote:
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 <stefa...@redhat.com>
---
  blockdev.c                      | 36 +++++++++++++++++++++++++++++-------
  hw/block/dataplane/virtio-blk.c |  1 +
  2 files changed, 30 insertions(+), 7 deletions(-)

You could've used blk_get_aio_context() for acquiring the AioContext in qmp_eject() instead of in eject_device() (and qmp_change_blockdev(), which is the other caller of eject_device(), holds the context anyway).

Anyway:

Reviewed-by: Max Reitz <mre...@redhat.com>

Reply via email to