qemu-e2k/include/block
Stefan Hajnoczi 7376eda7c2 block: make BDRV_POLL_WHILE() re-entrancy safe
Nested BDRV_POLL_WHILE() calls can occur.  Currently
assert(!wait_->wakeup) fails in AIO_WAIT_WHILE() when this happens.

This patch converts the bool wait_->need_kick flag to an unsigned
wait_->num_waiters counter.

Nesting works correctly because outer AIO_WAIT_WHILE() callers evaluate
the condition again after the inner caller completes (invoking the inner
caller counts as aio_poll() progress).

Reported-by: "fuweiwei (C)" <fuweiwei2@huawei.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20180307124619.6218-1-stefanha@redhat.com
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-03-12 11:07:37 +00:00
..
accounting.h block: make accounting thread-safe 2017-06-16 07:55:00 +08:00
aio-wait.h block: make BDRV_POLL_WHILE() re-entrancy safe 2018-03-12 11:07:37 +00:00
aio.h aio: rename aio_context_in_iothread() to in_aio_context_home_thread() 2018-03-02 18:39:07 +01:00
block_backup.h backup: Switch block_backup.h to byte-based 2017-07-10 13:18:06 +02:00
block_int.h block: rename .bdrv_create() to .bdrv_co_create_opts() 2018-03-02 18:39:07 +01:00
block.h Block layer patches 2018-03-06 11:20:44 +00:00
blockjob_int.h blockjob: reimplement block_job_sleep_ns to allow cancellation 2017-11-29 15:26:21 +01:00
blockjob.h blockjob: reimplement block_job_sleep_ns to allow cancellation 2017-11-29 15:26:21 +01:00
dirty-bitmap.h Include less of the generated modular QAPI headers 2018-03-02 13:45:50 -06:00
nbd.h Include less of the generated modular QAPI headers 2018-03-02 13:45:50 -06:00
nvme.h block: Move NVMe constants to a separate header 2018-02-08 09:22:03 +08:00
qapi.h Drop superfluous includes of qapi-types.h and test-qapi-types.h 2018-02-09 05:05:11 +01:00
raw-aio.h linux-aio: share one LinuxAioState within an AioContext 2016-07-18 15:09:31 +01:00
snapshot.h Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
thread-pool.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
throttle-groups.h block: add throttle block filter driver 2017-09-06 10:12:02 +02:00
write-threshold.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00