mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 20:19:44 +00:00
3c18a92dc4
Any thread that is not a iothread returns NULL for qemu_get_current_aio_context(). As a result, it would also return true for in_aio_context_home_thread(qemu_get_aio_context()), causing AIO_WAIT_WHILE to invoke aio_poll() directly. This is incorrect if the BQL is not held, because aio_poll() does not expect to run concurrently from multiple threads, and it can actually happen when savevm writes to the vmstate file from the migration thread. Therefore, restrict in_aio_context_home_thread to return true for the main AioContext only if the BQL is held. The function is moved to aio-wait.h because it is mostly used there and to avoid a circular reference between main-loop.h and block/aio.h. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20200407140746.8041-5-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> |
||
---|---|---|
.. | ||
accounting.h | ||
aio_task.h | ||
aio-wait.h | ||
aio.h | ||
block_backup.h | ||
block_int.h | ||
block-copy.h | ||
block-hmp-cmds.h | ||
block.h | ||
blockjob_int.h | ||
blockjob.h | ||
dirty-bitmap.h | ||
nbd.h | ||
nvme.h | ||
qapi.h | ||
qdict.h | ||
raw-aio.h | ||
snapshot.h | ||
thread-pool.h | ||
throttle-groups.h | ||
write-threshold.h |