blockdev: acquire AioContext in QMP 'transaction' actions
commit5d6e96efb81f94f39a50110e8178584fb1817f66
authorStefan Hajnoczi <stefanha@redhat.com>
Fri, 21 Nov 2014 10:48:59 +0000 (21 10:48 +0000)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 Dec 2014 09:31:13 +0000 (10 10:31 +0100)
treefc4be81c502861345c5cf0de9065e64ff833fcd9
parent73f1f7564d58963fc692334bcf0c529e1e3536fb
blockdev: acquire AioContext in QMP 'transaction' actions

The transaction QMP command performs operations atomically on a group of
drives.  This command needs to acquire AioContext in order to work
safely when virtio-blk dataplane IOThreads are accessing drives.

The transactional nature of the command means that actions are split
into prepare, commit, abort, and clean functions.  Acquire the
AioContext in prepare and don't release it until one of the other
functions is called.  This prevents the IOThread from running the
AioContext before the transaction has completed.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1416566940-4430-4-git-send-email-stefanha@redhat.com
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c
hw/block/dataplane/virtio-blk.c