summaryrefslogtreecommitdiff
path: root/aio.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-06-09 03:44:00 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2012-10-30 09:30:52 +0100
commit9958c351eee5b34051fd8061fe24f490ceca1334 (patch)
tree1ef30d57f2010b3f8f33b021ce371ca517e87b27 /aio.c
parentb078dc3cfec2d6d037caef91204ebf0a78e7ac06 (diff)
downloadqemu-9958c351eee5b34051fd8061fe24f490ceca1334.tar.gz
aio: provide platform-independent API
This adds to aio.c a platform-independent API based on EventNotifiers, that can be used by both POSIX and Win32. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'aio.c')
-rw-r--r--aio.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/aio.c b/aio.c
index e062aab2af..44214e1ffc 100644
--- a/aio.c
+++ b/aio.c
@@ -95,6 +95,15 @@ void qemu_aio_set_fd_handler(int fd,
qemu_set_fd_handler2(fd, NULL, io_read, io_write, opaque);
}
+void qemu_aio_set_event_notifier(EventNotifier *notifier,
+ EventNotifierHandler *io_read,
+ AioFlushEventNotifierHandler *io_flush)
+{
+ qemu_aio_set_fd_handler(event_notifier_get_fd(notifier),
+ (IOHandler *)io_read, NULL,
+ (AioFlushHandler *)io_flush, notifier);
+}
+
void qemu_aio_flush(void)
{
while (qemu_aio_wait());