Statistics
| Branch: | Revision:

root / qemu-aio.h @ 06aac7bd

History | View | Annotate | Download (7.8 kB)

# Date Author Comment
8c82e9a4 11/14/2012 07:19 pm Stefan Hajnoczi

aio: switch aiocb_size type int -> size_t

Using appropriate types for variables is a good thing :). All users
simply do sizeof(MyType) and the value is passed to a memory allocator,
it should be size_t.

Signed-off-by: Stefan Hajnoczi <>...

d37c975f 11/14/2012 07:19 pm Stefan Hajnoczi

aio: use g_slice_alloc() for AIOCB pooling

AIO control blocks are frequently acquired and released because each aio
request involves at least one AIOCB. Therefore, we pool them to avoid
heap allocation overhead.

The problem with the freelist approach in AIOPool is thread-safety. If...

d7331bed 11/14/2012 07:19 pm Stefan Hajnoczi

aio: rename AIOPool to AIOCBInfo

Now that AIOPool no longer keeps a freelist, it isn't really a "pool"
anymore. Rename it to AIOCBInfo and make it const since it no longer
needs to be modified.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

22bfa75e 10/30/2012 10:30 am Paolo Bonzini

aio: clean up now-unused functions

Some cleanups can now be made, now that the main loop does not anymore need
hooks into the bottom half code.

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

f627aab1 10/30/2012 10:30 am Paolo Bonzini

aio: introduce AioContext, move bottom halves there

Start introducing AioContext, which will let us remove globals from
aio.c/async.c, and introduce multiple I/O threads.

The bottom half functions now take an additional AioContext argument.
A bottom half is created with a specific AioContext that remains the...

a915f4bc 10/30/2012 10:30 am Paolo Bonzini

aio: add I/O handlers to the AioContext interface

With this patch, I/O handlers (including event notifier handlers) can be
attached to a single AioContext.

Signed-off-by: Paolo Bonzini <>

7c0628b2 10/30/2012 10:30 am Paolo Bonzini

aio: add non-blocking variant of aio_wait

This will be used when polling the GSource attached to an AioContext.

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

cd9ba1eb 10/30/2012 10:30 am Paolo Bonzini

aio: prepare for introducing GSource-based dispatch

This adds a GPollFD to each AioHandler. It will then be possible to
attach these GPollFDs to a GSource, and from there to the main loop.
aio_wait examines the GPollFDs and avoids calling select() if any...

e3713e00 10/30/2012 10:30 am Paolo Bonzini

aio: make AioContexts GSources

This lets AioContexts be used (optionally) with a glib main loop.

Signed-off-by: Paolo Bonzini <>

2f4dc3c1 10/30/2012 10:30 am Paolo Bonzini

aio: add aio_notify

With this change async.c does not rely anymore on any service from
main-loop.c, i.e. it is completely self-contained.

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

b078dc3c 10/30/2012 10:30 am Paolo Bonzini

aio: change qemu_aio_set_fd_handler to return void

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

9958c351 10/30/2012 10:30 am Paolo Bonzini

aio: provide platform-independent API

This adds to aio.c a platform-independent API based on EventNotifiers, that
can be used by both POSIX and Win32.

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

bcdc1857 04/19/2012 05:50 pm Paolo Bonzini

aio: return "AIO in progress" state from qemu_aio_wait

The definition of when qemu_aio_flush should loop is much simpler
than it looks. It just has to call qemu_aio_wait until it makes
no progress and all flush callbacks return false. qemu_aio_wait
is the logical place to tell the caller about this....

bafbd6a1 04/19/2012 05:37 pm Paolo Bonzini

aio: remove process_queue callback and qemu_aio_process_queue

Both unused after the previous patch.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

85e8dab1 04/05/2012 03:54 pm Paolo Bonzini

aio: move BlockDriverAIOCB to qemu-aio.h

And remove several block_int.h inclusions that should not be there.

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

8febfa26 10/27/2009 07:28 pm Kevin Wolf

Add qemu_aio_process_queue()

We'll leave some AIO completions unhandled when we can't call the callback.
qemu_aio_process_queue() is used later to run any callbacks that are left and
can be run then.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

986c28d6 06/15/2009 02:52 pm Andrea Arcangeli

fix qemu_aio_flush

qemu_aio_wait by invoking the bh or one of the aio completion
callbacks, could end up submitting new pending aio, breaking the
invariant that qemu_aio_flush returns only when no pending aio is
outstanding (possibly a problem for migration as such)....

a76bab49 09/22/2008 10:17 pm aliguori

Refactor AIO to allow multiple AIO implementations

This patch refactors the AIO layer to allow multiple AIO implementations. It's
only possible because of the recent signalfd() patch.

Right now, the AIO infrastructure is pretty specific to the block raw backend....