Statistics
| Branch: | Revision:

root / tests / test-aio.c @ feature-archipelago

History | View | Annotate | Download (23.3 kB)

# Date Author Comment
d3fa9230 12/06/2013 05:53 pm Stefan Hajnoczi

aio: make aio_poll(ctx, true) block with no fds

This patch drops a special case where aio_poll(ctx, true) returns false
instead of blocking if no file descriptors are waiting on I/O. Now it
is possible to block in aio_poll() to wait for aio_notify().

This change eliminates busy waiting. bdrv_drain_all() used to rely on...

a94a3fac 09/06/2013 04:25 pm Alex Bligh

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_pipe
and qemu_set_nonblock for portabillity. Addition of O_CLOEXEC
is a harmless bonus.

Signed-off-by: Alex Bligh <>...

fcdda211 09/01/2013 07:02 pm Alex Bligh

aio / timers: use g_usleep() not sleep()

sleep() apparently doesn't exist under mingw. Use g_usleep for
portability.

Signed-off-by: Alex Bligh <>
Reviewed-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

91c68f14 08/22/2013 11:03 pm Alex Bligh

aio / timers: remove dummy_io_handler_flush from tests/test-aio.c

Remove dummy_io_handler_flush from tests/test-aio.c as it does
nothing now.

Signed-off-by: Alex Bligh <>
Signed-off-by: Stefan Hajnoczi <>

b53edf97 08/22/2013 08:14 pm Alex Bligh

aio / timers: Add test harness for AioContext timers

Add a test harness for AioContext timers. The g_source equivalent is
unsatisfactory as it suffers from false wakeups.

Signed-off-by: Alex Bligh <>
Signed-off-by: Stefan Hajnoczi <>

dae21b98 08/22/2013 08:10 pm Alex Bligh

aio / timers: Add QEMUTimerListGroup to AioContext

Add a QEMUTimerListGroup each AioContext (meaning a QEMUTimerList
associated with each clock is added) and delete it when the
AioContext is freed.

Signed-off-by: Alex Bligh <>
Signed-off-by: Stefan Hajnoczi <>

1b9ecdb1 08/19/2013 04:52 pm Stefan Hajnoczi

tests: drop event_active_cb()

Drop the io_flush argument to aio_set_event_notifier().

Reviewed-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

f2e5dca4 08/19/2013 04:52 pm Stefan Hajnoczi

aio: drop io_flush argument

The .io_flush() handler no longer exists and has no users. Drop the
io_flush argument to aio_set_fd_handler() and related functions.

The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no
longer used and are dropped too....

164a101f 08/19/2013 04:45 pm Stefan Hajnoczi

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...

24d1a6d9 08/19/2013 04:45 pm Stefan Hajnoczi

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 before
aio_poll() to avoid deadlock....

2ea9b58f 01/17/2013 11:51 am Kevin Wolf

aio: Fix return value of aio_poll()

aio_poll() must return true if any work is still pending, even if it
didn't make progress, so that bdrv_drain_all() doesn't stop waiting too
early. The possibility of stopping early occasionally lead to a failed
assertion in bdrv_drain_all(), when some in-flight request was missed...

737e150e 12/19/2012 09:31 am Paolo Bonzini

block: move include files to include/block/

Signed-off-by: Paolo Bonzini <>

9fe3781f 12/11/2012 12:04 pm Stefan Hajnoczi

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 we
really do want this low-level functionality.

Therefore declare a local wait_for_aio() helper for the test cases....

b2ea25d7 11/26/2012 05:37 pm Paolo Bonzini

tests: add AioContext unit tests

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>