qemu-e2k/util
Stefan Hajnoczi 7719f3c968 block: extract AIO_WAIT_WHILE() from BlockDriverState
BlockDriverState has the BDRV_POLL_WHILE() macro to wait on event loop
activity while a condition evaluates to true.  This is used to implement
synchronous operations where it acts as a condvar between the IOThread
running the operation and the main loop waiting for the operation.  It
can also be called from the thread that owns the AioContext and in that
case it's just a nested event loop.

BlockBackend needs this behavior but doesn't always have a
BlockDriverState it can use.  This patch extracts BDRV_POLL_WHILE() into
the AioWait abstraction, which can be used with AioContext and isn't
tied to BlockDriverState anymore.

This feature could be built directly into AioContext but then all users
would kick the event loop even if they signal different conditions.
Imagine an AioContext with many BlockDriverStates, each time a request
completes any waiter would wake up and re-check their condition.  It's
nicer to keep a separate AioWait object for each condition instead.

Please see "block/aio-wait.h" for details on the API.

The name AIO_WAIT_WHILE() avoids the confusion between AIO_POLL_WHILE()
and AioContext polling.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-03-02 18:39:07 +01:00
..
Makefile.objs block: extract AIO_WAIT_WHILE() from BlockDriverState 2018-03-02 18:39:07 +01:00
acl.c
aio-posix.c async: use ARRAY_SIZE macro 2018-02-10 10:43:18 +03:00
aio-wait.c block: extract AIO_WAIT_WHILE() from BlockDriverState 2018-03-02 18:39:07 +01:00
aio-win32.c
aiocb.c
async.c coroutine: abort if we try to schedule or enter a pending coroutine 2017-11-21 11:58:07 -05:00
base64.c
bitmap.c bitmap: provide to_le/from_le helpers 2017-09-22 14:11:25 +02:00
bitops.c bitmap: remove BITOP_WORD() 2017-09-22 14:11:23 +02:00
buffer.c
bufferiszero.c util: Introduce include/qemu/cpuid.h 2017-07-24 12:42:55 +01:00
cacheinfo.c configure: Drop AIX host support 2017-09-07 19:02:30 +01:00
compatfd.c
coroutine-sigaltstack.c
coroutine-ucontext.c ucontext: annotate coroutine stack for ASAN 2018-02-07 14:09:24 +01:00
coroutine-win32.c
crc32c.c
cutils.c Convert remaining single line fprintf() to warn_report() 2017-09-19 16:20:49 +02:00
envlist.c
error.c
event_notifier-posix.c Revert "qemu: add a cleanup callback function to EventNotifier" 2018-01-24 19:20:19 +02:00
event_notifier-win32.c Revert "qemu: add a cleanup callback function to EventNotifier" 2018-01-24 19:20:19 +02:00
fifo8.c
getauxval.c
hbitmap.c hbitmap: fix missing restore count when finish deserialization 2018-02-07 11:35:49 -05:00
hexdump.c
host-utils.c
id.c
iohandler.c
iov.c
keyval.c Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
lockcnt.c
log.c
main-loop.c Convert multi-line fprintf() to warn_report() 2017-09-19 14:09:34 +02:00
memfd.c memfd: add hugetlbsize argument 2018-02-07 14:09:25 +01:00
mmap-alloc.c sparc: Make sure we mmap at SHMLBA alignment 2017-12-15 15:26:24 +00:00
module.c
notify.c
osdep.c osdep: Retry SETLK upon EINTR 2018-01-23 12:33:07 +01:00
oslib-posix.c mem: add share parameter to memory-backend-ram 2018-02-19 13:03:24 +02:00
oslib-win32.c mem: add share parameter to memory-backend-ram 2018-02-19 13:03:24 +02:00
pagesize.c util: move qemu_real_host_page_size/mask to osdep.h 2017-10-10 09:45:00 -07:00
path.c
qdist.c
qemu-config.c Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
qemu-coroutine-io.c
qemu-coroutine-lock.c misc: fix spelling 2018-02-15 09:39:49 +00:00
qemu-coroutine-sleep.c coroutine: simplify co_aio_sleep_ns() prototype 2017-12-19 09:25:27 +00:00
qemu-coroutine.c coroutine: abort if we try to schedule or enter a pending coroutine 2017-11-21 11:58:07 -05:00
qemu-error.c error: Revert unwanted change of warning messages 2017-07-24 14:16:29 +02:00
qemu-openpty.c
qemu-option.c qdict qlist: Make most helper macros functions 2018-02-09 13:52:15 +01:00
qemu-progress.c
qemu-sockets.c sockets: fix parsing of ipv4/ipv6 opts in parse_socket_addr 2018-02-05 18:09:45 +01:00
qemu-thread-posix.c util/qemu-thread-*: add qemu_lock, locked and unlock trace events 2018-01-16 14:54:52 +01:00
qemu-thread-win32.c util/qemu-thread-*: add qemu_lock, locked and unlock trace events 2018-01-16 14:54:52 +01:00
qemu-timer-common.c
qemu-timer.c
qht.c
range.c
rcu.c rcu: reduce more than 7MB heap memory by malloc_trim() 2017-12-21 09:30:32 +01:00
readline.c readline: don't free completions in readline_free() 2018-02-05 13:54:39 +01:00
stats64.c util/stats64: Fix min/max comparisons 2017-11-15 09:34:51 +01:00
systemd.c
thread-pool.c
throttle.c throttle: Assert that bkt->max is valid in throttle_compute_wait() 2017-09-26 14:46:23 +02:00
timed-average.c
trace-events util: Introduce vfio helpers 2018-02-08 09:22:03 +08:00
unicode.c
uri.c
uuid.c util: add is_equal to UUID API 2017-12-20 22:01:24 +08:00
vfio-helpers.c block/nvme: fix Coverity reports 2018-03-01 15:21:46 +08:00