diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2017-02-13 14:52:30 +0100 |
|---|---|---|
| committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-02-21 11:39:36 +0000 |
| commit | 9d456654482a8bd1ff72f0bdbe1f393149a5680a (patch) | |
| tree | fbebb64735b7996ae8abade0d02c725e225d603d /util/aio-posix.c | |
| parent | 2f47da5f7f88d3966a2cb33cc9de53f134fea367 (diff) | |
| download | focaccia-qemu-9d456654482a8bd1ff72f0bdbe1f393149a5680a.tar.gz focaccia-qemu-9d456654482a8bd1ff72f0bdbe1f393149a5680a.zip | |
block: explicitly acquire aiocontext in callbacks that need it
This covers both file descriptor callbacks and polling callbacks, since they execute related code. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170213135235.12274-14-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'util/aio-posix.c')
| -rw-r--r-- | util/aio-posix.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/util/aio-posix.c b/util/aio-posix.c index 4dc597ce9b..84cee4315d 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -402,9 +402,7 @@ static bool aio_dispatch_handlers(AioContext *ctx) (revents & (G_IO_IN | G_IO_HUP | G_IO_ERR)) && aio_node_check(ctx, node->is_external) && node->io_read) { - aio_context_acquire(ctx); node->io_read(node->opaque); - aio_context_release(ctx); /* aio_notify() does not count as progress */ if (node->opaque != &ctx->notifier) { @@ -415,9 +413,7 @@ static bool aio_dispatch_handlers(AioContext *ctx) (revents & (G_IO_OUT | G_IO_ERR)) && aio_node_check(ctx, node->is_external) && node->io_write) { - aio_context_acquire(ctx); node->io_write(node->opaque); - aio_context_release(ctx); progress = true; } @@ -618,10 +614,7 @@ bool aio_poll(AioContext *ctx, bool blocking) start = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); } - aio_context_acquire(ctx); progress = try_poll_mode(ctx, blocking); - aio_context_release(ctx); - if (!progress) { assert(npfd == 0); |