aboutsummaryrefslogtreecommitdiff
path: root/block/linux-aio.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/linux-aio.c')
-rw-r--r--block/linux-aio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/linux-aio.c b/block/linux-aio.c
index 03ab741d37..277c016cad 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -251,7 +251,9 @@ static void qemu_laio_completion_cb(EventNotifier *e)
LinuxAioState *s = container_of(e, LinuxAioState, e);
if (event_notifier_test_and_clear(&s->e)) {
+ aio_context_acquire(s->aio_context);
qemu_laio_process_completions_and_submit(s);
+ aio_context_release(s->aio_context);
}
}
@@ -265,7 +267,9 @@ static bool qemu_laio_poll_cb(void *opaque)
return false;
}
+ aio_context_acquire(s->aio_context);
qemu_laio_process_completions_and_submit(s);
+ aio_context_release(s->aio_context);
return true;
}