summaryrefslogtreecommitdiffstats
path: root/block/linux-aio.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/linux-aio.c')
-rw-r--r--block/linux-aio.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/block/linux-aio.c b/block/linux-aio.c
index 53434e2..7ff3897 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -177,6 +177,20 @@ out_free_aiocb:
return NULL;
}
+void laio_detach_aio_context(void *s_, AioContext *old_context)
+{
+ struct qemu_laio_state *s = s_;
+
+ aio_set_event_notifier(old_context, &s->e, NULL);
+}
+
+void laio_attach_aio_context(void *s_, AioContext *new_context)
+{
+ struct qemu_laio_state *s = s_;
+
+ aio_set_event_notifier(new_context, &s->e, qemu_laio_completion_cb);
+}
+
void *laio_init(void)
{
struct qemu_laio_state *s;
@@ -190,8 +204,6 @@ void *laio_init(void)
goto out_close_efd;
}
- qemu_aio_set_event_notifier(&s->e, qemu_laio_completion_cb);
-
return s;
out_close_efd:
OpenPOWER on IntegriCloud