From 721671ade77f4046b45893fbb7864ca84b9504cd Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 1 Dec 2016 19:26:40 +0000 Subject: aio: add flag to skip fds to aio_dispatch() Polling mode will not call ppoll(2)/epoll_wait(2). Therefore we know there are no fds ready and should avoid looping over fd handlers in aio_dispatch(). Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Message-id: 20161201192652.9509-2-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- aio-win32.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'aio-win32.c') diff --git a/aio-win32.c b/aio-win32.c index c8c249e260..3ef8ea4caa 100644 --- a/aio-win32.c +++ b/aio-win32.c @@ -271,12 +271,14 @@ static bool aio_dispatch_handlers(AioContext *ctx, HANDLE event) return progress; } -bool aio_dispatch(AioContext *ctx) +bool aio_dispatch(AioContext *ctx, bool dispatch_fds) { bool progress; progress = aio_bh_poll(ctx); - progress |= aio_dispatch_handlers(ctx, INVALID_HANDLE_VALUE); + if (dispatch_fds) { + progress |= aio_dispatch_handlers(ctx, INVALID_HANDLE_VALUE); + } progress |= timerlistgroup_run_timers(&ctx->tlg); return progress; } -- cgit 1.4.1