| Branch: | Revision:

root / async.c @ feature-archipelago

History | View | Annotate | Download (6.9 kB)

# Date Author Comment
d5541d86 08/22/2013 08:10 pm Alex Bligh

aio / timers: Add a notify callback to QEMUTimerList

Add a notify pointer to QEMUTimerList so it knows what to notify
on a timer change.

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

533a8cf3 08/22/2013 08:10 pm Alex Bligh

aio / timers: aio_ctx_prepare sets timeout from AioContext timers

Calculate the timeout in aio_ctx_prepare taking into account
the timers attached to the AioContext.

Alter aio_ctx_check similarly.

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

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

dcc772e2 07/19/2013 07:29 am Liu Ping Fan

QEMUBH: make AioContext's bh re-entrant

BH will be used outside big lock, so introduce lock to protect
between the writers, ie, bh's adders and deleter. The lock only
affects the writers and bh's callback does not take this extra lock.
Note that for the same AioContext, aio_bh_poll() can not run in...

9b34277d 03/15/2013 05:07 pm Stefan Hajnoczi

aio: add a ThreadPool instance to AioContext

This patch adds a ThreadPool to AioContext. It's possible that some
AioContext instances will never use the ThreadPool, so defer creation
until aio_get_thread_pool().

The reason why AioContext should have the ThreadPool is because the...

6b5f8762 02/22/2013 12:17 am Stefan Hajnoczi

aio: convert aio_poll() to g_poll(3)

AioHandler already has a GPollFD so we can directly use its

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

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

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

block: move include files to include/block/

Signed-off-by: Paolo Bonzini <>

c57b6656 12/11/2012 12:04 pm Kevin Wolf

aio: Get rid of qemu_aio_flush()

There are no remaining users, and new users should probably be
using bdrv_drain_all() in the first place.

Signed-off-by: Kevin Wolf <>

f5022a13 11/12/2012 06:02 pm Paolo Bonzini

aio: fix aio_ctx_prepare with idle bottom halves

Commit ed2aec4867f0d5f5de496bb765347b5d0cfe113d changed the return
value of aio_ctx_prepare from false to true when only idle bottom
halves are available. This broke PC old-style DMA, which uses them.
Fix this by making aio_ctx_prepare return true only when non-idle...

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

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

9b47b17e 05/01/2012 12:13 pm Stefan Weil

async: Use bool for boolean struct members and remove a hole

Using bool reduces the size of the structure and improves readability.
A hole in the structure was removed.

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

7c7db755 04/26/2012 09:14 pm Stefano Stabellini

main_loop_wait: block indefinitely

- remove qemu_calculate_timeout;

- explicitly size timeout to uint32_t;

- introduce slirp_update_timeout;

- pass NULL as timeout argument to select in case timeout is the maximum

Signed-off-by: Stefano Stabellini <>...

44a9b356 10/21/2011 07:14 pm Paolo Bonzini

main-loop: create main-loop.h

Signed-off-by: Paolo Bonzini <>

648fb0ea 09/06/2011 12:23 pm Kevin Wolf

async: Allow nested qemu_bh_poll calls

qemu may segfault when a BH handler first deletes a BH and then (possibly
indirectly) calls a nested qemu_bh_poll(). This is because the inner instance
frees the BH and deletes it from the list that the outer one processes....

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

384acbf4 08/02/2011 04:53 pm Kevin Wolf

async: Remove AsyncContext

The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancy
during an emulated bdrv_read/write (which includes a qemu_aio_wait() call and
can run AIO callbacks of different requests if it weren't for AsyncContexts)....

7887f620 06/15/2011 04:43 pm Kevin Wolf

Allow nested qemu_bh_poll() after BH deletion

Without this, qemu segfaults when a BH handler first deletes its BH and
then calls another function which involves a nested qemu_bh_poll() call.

This can be reproduced by generating an I/O error (e.g. with blkdebug) on...

4f999d05 10/27/2009 07:28 pm Kevin Wolf

Split out bottom halves

Instead of putting more and more stuff into vl.c, let's have the generic
functions that deal with asynchronous callbacks in their own file.

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

9a1e9481 10/27/2009 07:28 pm Kevin Wolf

Introduce contexts for asynchronous callbacks

Add the possibility to use AIO and BHs without allowing foreign callbacks to be
run. Basically, you put your own AIOs and BHs in a separate context. For
details see the comments in the source.

Signed-off-by: Kevin Wolf <>...