aboutsummaryrefslogtreecommitdiff
path: root/block/raw-aio.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-04-07 18:33:35 +0200
committerKevin Wolf <kwolf@redhat.com>2016-05-12 15:22:07 +0200
commitdd7f7ed10459d4ed9787ba464cebf8c459491d8c (patch)
treeb05acb31f5ec8123591bba2c970df403e691b81a /block/raw-aio.h
parent6b98bd649520d07df4d1b7a0a54ac73bf178519c (diff)
linux-aio: make it more type safe
Replace void* with an opaque LinuxAioState type. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/raw-aio.h')
-rw-r--r--block/raw-aio.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/block/raw-aio.h b/block/raw-aio.h
index 0f5e35a7ec..714714e016 100644
--- a/block/raw-aio.h
+++ b/block/raw-aio.h
@@ -35,15 +35,16 @@
/* linux-aio.c - Linux native implementation */
#ifdef CONFIG_LINUX_AIO
-void *laio_init(void);
-void laio_cleanup(void *s);
-BlockAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
+typedef struct LinuxAioState LinuxAioState;
+LinuxAioState *laio_init(void);
+void laio_cleanup(LinuxAioState *s);
+BlockAIOCB *laio_submit(BlockDriverState *bs, LinuxAioState *s, int fd,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockCompletionFunc *cb, void *opaque, int type);
-void laio_detach_aio_context(void *s, AioContext *old_context);
-void laio_attach_aio_context(void *s, AioContext *new_context);
-void laio_io_plug(BlockDriverState *bs, void *aio_ctx);
-void laio_io_unplug(BlockDriverState *bs, void *aio_ctx);
+void laio_detach_aio_context(LinuxAioState *s, AioContext *old_context);
+void laio_attach_aio_context(LinuxAioState *s, AioContext *new_context);
+void laio_io_plug(BlockDriverState *bs, LinuxAioState *s);
+void laio_io_unplug(BlockDriverState *bs, LinuxAioState *s);
#endif
#ifdef _WIN32