History | View | Annotate | Download (23.3 kB)
aio: make aio_poll(ctx, true) block with no fds
This patch drops a special case where aio_poll(ctx, true) returns falseinstead of blocking if no file descriptors are waiting on I/O. Now itis possible to block in aio_poll() to wait for aio_notify().
This change eliminates busy waiting. bdrv_drain_all() used to rely on...
aio / timers: fix build of test/test-aio.c on non-linux platforms
tests/test-aio.c used pipe2 which is Linux only. Use qemu_pipeand qemu_set_nonblock for portabillity. Addition of O_CLOEXECis a harmless bonus.
Signed-off-by: Alex Bligh <alex@alex.org.uk>...
aio / timers: use g_usleep() not sleep()
sleep() apparently doesn't exist under mingw. Use g_usleep forportability.
Signed-off-by: Alex Bligh <alex@alex.org.uk>Reviewed-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
aio / timers: remove dummy_io_handler_flush from tests/test-aio.c
Remove dummy_io_handler_flush from tests/test-aio.c as it doesnothing now.
Signed-off-by: Alex Bligh <alex@alex.org.uk>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
aio / timers: Add test harness for AioContext timers
Add a test harness for AioContext timers. The g_source equivalent isunsatisfactory as it suffers from false wakeups.
aio / timers: Add QEMUTimerListGroup to AioContext
Add a QEMUTimerListGroup each AioContext (meaning a QEMUTimerListassociated with each clock is added) and delete it when theAioContext is freed.
tests: drop event_active_cb()
Drop the io_flush argument to aio_set_event_notifier().
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
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...
tests: adjust test-aio to new aio_poll() semantics
aio_poll(ctx, true) will soon block if any fd handlers have been set.Previously it would only block when .io_flush() returned true.
This means that callers must check their wait condition beforeaio_poll() to avoid deadlock....
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...
block: move include files to include/block/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tests: use aio_poll() instead of aio_flush() in test-aio.c
There has been confusion between various aio wait and flush functions.It's time to get rid of qemu_aio_flush() but in the aio test cases wereally do want this low-level functionality.
Therefore declare a local wait_for_aio() helper for the test cases....
tests: add AioContext unit tests
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>