block: switch posix-aio-compat to threadpool
This is not meant for portability, but to remove code duplication.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
raw: merge posix-aio-compat.c into block/raw-posix.c
Making the qemu_paiocb specific to raw devices will let us access membersof the BDRVRawState arbitrarily.
raw-posix: rename raw-posix-aio.h, hide unavailable prototypes
threadpool: do not take lock in event_notifier_ready
The ordering is:
worker thread consumer thread ------------------------------------------------------------------- write ret event_notifier_test_and_clear...
aio: add generic thread-pool facility
Add a generic thread-pool. The code is roughly based on posix-aio-compat.c,with some changes, especially the following:
- use QemuSemaphore instead of QemuCond;
- separate the state of the thread from the return code of the worker...
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).
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>
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