From bcdc18578d5b41180db2e17baa7563c5f05b39ee Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 12 Apr 2012 14:00:55 +0200 Subject: aio: return "AIO in progress" state from qemu_aio_wait The definition of when qemu_aio_flush should loop is much simpler than it looks. It just has to call qemu_aio_wait until it makes no progress and all flush callbacks return false. qemu_aio_wait is the logical place to tell the caller about this. Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- qemu-aio.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qemu-aio.h') diff --git a/qemu-aio.h b/qemu-aio.h index 0fc84093c0..bfdd35f02c 100644 --- a/qemu-aio.h +++ b/qemu-aio.h @@ -48,8 +48,10 @@ void qemu_aio_flush(void); /* 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. */ -void qemu_aio_wait(void); + * result of executing I/O completion or bh callbacks. + * + * Return whether there is still any pending AIO operation. */ +bool qemu_aio_wait(void); /* Register a file descriptor and associated callbacks. Behaves very similarly * to qemu_set_fd_handler2. Unlike qemu_set_fd_handler2, these callbacks will -- cgit v1.2.1