aboutsummaryrefslogtreecommitdiff
path: root/qemu-aio.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-09-24 14:37:53 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-10-30 09:30:53 +0100
commit7c0628b20e7c56b7e04abb8b5f8d7da3f7cb87e8 (patch)
tree9d5ee71c6356c75ee356b81a764951c2ad919434 /qemu-aio.h
parent4231c88d27d9e46e6ad6e6b7bbb6e442bcf9cd05 (diff)
aio: add non-blocking variant of aio_wait
This will be used when polling the GSource attached to an AioContext. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'qemu-aio.h')
-rw-r--r--qemu-aio.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/qemu-aio.h b/qemu-aio.h
index f8a93d8fb9..f19201e7ca 100644
--- a/qemu-aio.h
+++ b/qemu-aio.h
@@ -133,13 +133,22 @@ void qemu_bh_delete(QEMUBH *bh);
* outstanding AIO operations have been completed or cancelled. */
void aio_flush(AioContext *ctx);
-/* Wait for a single AIO completion to occur. This function will wait
- * until a single AIO event has completed and it will ensure something
- * has moved before returning. This can issue new pending aio as
- * result of executing I/O completion or bh callbacks.
+/* Progress in completing AIO work to occur. This can issue new pending
+ * aio as a result of executing I/O completion or bh callbacks.
*
- * Return whether there is still any pending AIO operation. */
-bool aio_wait(AioContext *ctx);
+ * If there is no pending AIO operation or completion (bottom half),
+ * return false. If there are pending bottom halves, return true.
+ *
+ * If there are no pending bottom halves, but there are pending AIO
+ * operations, it may not be possible to make any progress without
+ * blocking. If @blocking is true, this function will wait until one
+ * or more AIO events have completed, to ensure something has moved
+ * before returning.
+ *
+ * If @blocking is false, this function will also return false if the
+ * function cannot make any progress without blocking.
+ */
+bool aio_poll(AioContext *ctx, bool blocking);
#ifdef CONFIG_POSIX
/* Returns 1 if there are still outstanding AIO requests; 0 otherwise */