]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block: mark AioContext as recursive
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 17 Dec 2014 15:09:58 +0000 (16:09 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 13 Jan 2015 11:47:55 +0000 (11:47 +0000)
AioContext can be accessed recursively, in fact that's what we do with
aio_poll.  Marking the GSource as recursive avoids that GLib blocks it
and unblocks it around every call to aio_dispatch, which is a pretty
expensive operation.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
async.c

diff --git a/async.c b/async.c
index 3939b795e59bda9dfc488348382a91bd71162f90..572f239e2cf5fbd4cbad63916d4b1b091207cd7c 100644 (file)
--- a/async.c
+++ b/async.c
@@ -300,6 +300,7 @@ AioContext *aio_context_new(Error **errp)
         error_setg_errno(errp, -ret, "Failed to initialize event notifier");
         return NULL;
     }
+    g_source_set_can_recurse(&ctx->source, true);
     aio_set_event_notifier(ctx, &ctx->notifier,
                            (EventNotifierHandler *)
                            event_notifier_test_and_clear);