qemu-thread: add QemuSemaphore
The new thread pool will use semaphores instead of conditionvariables, because QemuCond does not have qemu_cond_timedwait.(I also like it more this way).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
main-loop: use aio_notify for qemu_notify_event
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
aio: clean up now-unused functions
Some cleanups can now be made, now that the main loop does not anymore needhooks into the bottom half code.
linux-aio: use event notifiers
Since linux-aio already uses an eventfd, converting it to use theEventNotifier-based API simplifies the code even though it is notmeant to be portable.
Reviewed-by: Anthony Liguori <anthony@codemonkey.ws>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
aio: prepare for introducing GSource-based dispatch
This adds a GPollFD to each AioHandler. It will then be possible toattach these GPollFDs to a GSource, and from there to the main loop.aio_wait examines the GPollFDs and avoids calling select() if any...
aio: add Win32 implementation
The Win32 implementation will only accept EventNotifiers, thus a fewdrivers are disabled under Windows. EventNotifiers are a good matchfor the GSource implementation, too, because the Win32 port of gliballows to place their HANDLEs in a GPollFD....
aio: make AioContexts GSources
This lets AioContexts be used (optionally) with a glib main loop.
aio: add aio_notify
With this change async.c does not rely anymore on any service frommain-loop.c, i.e. it is completely self-contained.
aio: call aio_notify after setting I/O handlers
In the current code, this is done by qemu_set_fd_handler2, which iscalled by qemu_aio_set_fd_handler. We need to keep the same behavioreven after removing the call to qemu_set_fd_handler2.
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
main-loop: use GSource to poll AIO file descriptors
This lets us remove the hooks for the main loop in async.c.
View all revisions | View revisions
Also available in: Atom