]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
block: acquire AioContext in bdrv_*_all()
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 8 May 2014 14:34:35 +0000 (16:34 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 4 Jun 2014 07:56:11 +0000 (09:56 +0200)
commited78cda3de92056737364ab3cb748b16f5f17dea
treec9b373510c8aa9741f3d7db8dc08a74b88b0e8ba
parent2572b37a4751cc967582d7d04f21d9bf97187ae5
block: acquire AioContext in bdrv_*_all()

bdrv_close_all(), bdrv_commit_all(), bdrv_flush_all(),
bdrv_invalidate_cache_all(), and bdrv_clear_incoming_migration_all() are
called by main loop code and touch all BlockDriverState instances.

Some BlockDriverState instances may be running in another AioContext.
Make sure to acquire the AioContext before closing the BlockDriverState.

This will protect against race conditions once virtio-blk data-plane is
using the BlockDriverState from another AioContext event loop.

Note that this patch does not convert bdrv_drain_all() yet since that
conversion is non-trivial.

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