blockdev: acquire AioContext in change-backing-file
commit729962f6db43bf262a446f5e13d900ffb3c54a88
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 19 Nov 2014 14:19:45 +0000 (19 14:19 +0000)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 Dec 2014 09:25:30 +0000 (10 10:25 +0100)
treee93bd7014305629874c116d50cea985ce097c041
parente3442099a2794925dfbe83711cd204caf80eae60
blockdev: acquire AioContext in change-backing-file

Add dataplane support to the change-backing-file QMP commands.  By
acquiring the AioContext we avoid race conditions with the dataplane
thread which may also be accessing the BlockDriverState.

Note that this command operates on both bs and a node in its chain
(image_bs).  The bdrv_chain_contains(bs, image_bs) check guarantees that
bs and image_bs are in the same AioContext.

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