AioContext: take bottom halves into account when computing aio_poll timeout
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Jul 2014 09:53:01 +0000 (11:53 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 29 Aug 2014 09:46:58 +0000 (10:46 +0100)
commit845ca10dd089b4e48f0a79bad005fb30eb77584e
tree18d8041935c716ea293399136f769dafdbd8614d
parent3cbbe9fd1feaf3264f745fccb0bf5f62c583078f
AioContext: take bottom halves into account when computing aio_poll timeout

Right now, QEMU invokes aio_bh_poll before the "poll" phase
of aio_poll.  It is simpler to do it afterwards and skip the
"poll" phase altogether when the OS-dependent parts of AioContext
are invoked from GSource.  This way, AioContext behaves more
similarly when used as a GSource vs. when used as stand-alone.

As a start, take bottom halves into account when computing the
poll timeout.  If a bottom half is ready, do a non-blocking
poll.  As a side effect, this makes idle bottom halves work
with aio_poll; an improvement, but not really an important
one since they are deprecated.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
aio-posix.c
aio-win32.c
async.c
include/block/aio.h