block: acquire AioContext in qmp_query_blockstats()
authorStefan Hajnoczi <stefanha@redhat.com>
Tue, 17 Jun 2014 06:32:05 +0000 (14:32 +0800)
committerKevin Wolf <kwolf@redhat.com>
Fri, 27 Jun 2014 16:20:29 +0000 (18:20 +0200)
commit13344f3a17e0a785c0eb8e36f69518f21aa8a91a
treec976718dcb484d41f0db5786fd452eed821043b9
parentac46821f2c6eb0617ac911daff111cbc30a4c40c
block: acquire AioContext in qmp_query_blockstats()

Make query-blockstats safe for dataplane by acquiring the
BlockDriverState's AioContext.  This ensures that the dataplane IOThread
and the main loop's monitor code do not race.

Note the assumption that acquiring the drive's BDS AioContext also
protects ->file and ->backing_hd.  This assumption is made by other
aio_context_acquire() callers too.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qapi.c