qemu/include
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
..
block block: extract AIO_WAIT_WHILE() from BlockDriverState 2018-03-02 18:39:07 +01:00
chardev Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
crypto Include qapi/error.h exactly where needed 2018-02-09 13:50:17 +01:00
disas target/xtensa: implement disassembler 2018-01-09 09:55:39 -08:00
exec include/exec/helper-head.h: support f16 in helper calls 2018-03-01 11:13:59 +00:00
fpu arm/translate-a64: add FP16 FR[ECP/SQRT]S to simd_three_reg_same_fp16 2018-03-01 11:13:59 +00:00
hw hw/arm/iotkit: Model Arm IOT Kit 2018-03-02 11:03:45 +00:00
io io: Fix QIOChannelFile when creating and opening read-write 2018-02-15 16:54:57 +00:00
libdecnumber
migration virtio,vhost,pci,pc: features, fixes and cleanups 2018-02-13 16:33:31 +00:00
monitor Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
net net/can: simple messages transport implementation for QEMU 2018-02-13 11:44:13 +01:00
qapi Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
qemu fpu/softfloat-types: new header to prevent excessive re-builds 2018-02-21 10:20:19 +00:00
qom Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
scsi Include qapi/qmp/qdict.h exactly where needed 2018-02-09 13:52:15 +01:00
standard-headers virtio-gpu-3d: add support for second capability set (v4) 2018-02-26 13:41:34 +01:00
sysemu cryptodev-vhost-user: set the key length 2018-03-01 18:26:17 +02:00
ui console/opengl: split up dpy_gl_cursor ops 2018-02-22 10:35:00 +01:00
elf.h linux-user: MIPS set cpu to r6 CPU if binary is R6 2018-02-25 17:29:45 +01:00
glib-compat.h glib-compat: move G_SOURCE_CONTINUE/REMOVE there 2017-10-10 16:33:55 +02:00
qemu-common.h Move include qemu/option.h from qemu-common.h to actual users 2018-02-09 13:52:16 +01:00
qemu-io.h
trace-tcg.h