]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
block: acquire AioContext in bdrv_drain_all()
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 8 May 2014 14:34:36 +0000 (16:34 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 4 Jun 2014 07:56:11 +0000 (09:56 +0200)
commit9b536adcbefb72090f43c9715ce042e37e47af73
treec6b444f41da20810ea093f62f1daafb84931a7dc
parented78cda3de92056737364ab3cb748b16f5f17dea
block: acquire AioContext in bdrv_drain_all()

Modify bdrv_drain_all() to take into account that BlockDriverState
instances may be running in different AioContexts.

This patch changes the implementation of bdrv_drain_all() while
preserving the semantics.  Previously kicking throttled requests and
checking for pending requests were done across all BlockDriverState
instances in sequence.  Now we process each BlockDriverState in turn,
making sure to acquire and release its AioContext.

This prevents race conditions between the thread executing
bdrv_drain_all() and the thread running the AioContext.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block.c