History | View | Annotate | Download (6.4 kB)
aio / timers: Convert aio_poll to use AioContext timers' deadline
Convert aio_poll to use deadline based on AioContext's timers.
aio_poll has been changed to return accurately whether progresshas occurred. Prior to this commit, aio_poll always returned...
aio: drop io_flush argument
The .io_flush() handler no longer exists and has no users. Drop theio_flush argument to aio_set_fd_handler() and related functions.
The AioFlushEventNotifierHandler and AioFlushHandler typedefs are nolonger used and are dropped too....
aio: stop using .io_flush()
Now that aio_poll() users check their termination condition themselves,it is no longer necessary to call .io_flush() handlers.
The behavior of aio_poll() changes as follows:
1. .io_flush() is no longer invoked and file descriptors are always...
aio: extract aio_dispatch() from aio_poll()
We will need to loop over AioHandlers calling >io_read()/>io_write()when aio_poll() is converted from select(2) to g_poll(2).
Luckily the code for this already exists, extract it into the newaio_dispatch() function....
aio: convert aio_poll() to g_poll(3)
AioHandler already has a GPollFD so we can directly use itsevents/revents.
Add the int pollfds_idx field to AioContext so we can map g_poll(3)results back to AioHandlers.
Reuse aio_dispatch() to invoke handlers after g_poll(3)....
aio: support G_IO_HUP and G_IO_ERR
aio-posix.c could not take advantage of G_IO_HUP and G_IO_ERR becauseselect(2) does not have equivalent events. Now that g_poll(3) is usedwe can support G_IO_HUP and G_IO_ERR.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>...
aio: Fix return value of aio_poll()
aio_poll() must return true if any work is still pending, even if itdidn't make progress, so that bdrv_drain_all() doesn't stop waiting tooearly. The possibility of stopping early occasionally lead to a failedassertion in bdrv_drain_all(), when some in-flight request was missed...
misc: move include files to include/qemu/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block: move include files to include/block/
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: 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>...