aboutsummaryrefslogtreecommitdiff
path: root/qemu-aio.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-03-12 17:01:48 +0100
committerKevin Wolf <kwolf@redhat.com>2012-04-05 14:54:39 +0200
commit85e8dab1efc7228bb674e72f6fb3be78c1e883bf (patch)
treeedae0953f84c27d1c2f2f0fdfd5b1f7a6efe6ea0 /qemu-aio.h
parent29cdb2513c3f22f51d6f3585b41009576485cb35 (diff)
aio: move BlockDriverAIOCB to qemu-aio.h
And remove several block_int.h inclusions that should not be there. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-aio.h')
-rw-r--r--qemu-aio.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/qemu-aio.h b/qemu-aio.h
index 3bdd749f80..230c2f79a0 100644
--- a/qemu-aio.h
+++ b/qemu-aio.h
@@ -17,6 +17,27 @@
#include "qemu-common.h"
#include "qemu-char.h"
+typedef struct BlockDriverAIOCB BlockDriverAIOCB;
+typedef void BlockDriverCompletionFunc(void *opaque, int ret);
+
+typedef struct AIOPool {
+ void (*cancel)(BlockDriverAIOCB *acb);
+ int aiocb_size;
+ BlockDriverAIOCB *free_aiocb;
+} AIOPool;
+
+struct BlockDriverAIOCB {
+ AIOPool *pool;
+ BlockDriverState *bs;
+ BlockDriverCompletionFunc *cb;
+ void *opaque;
+ BlockDriverAIOCB *next;
+};
+
+void *qemu_aio_get(AIOPool *pool, BlockDriverState *bs,
+ BlockDriverCompletionFunc *cb, void *opaque);
+void qemu_aio_release(void *p);
+
/* Returns 1 if there are still outstanding AIO requests; 0 otherwise */
typedef int (AioFlushHandler)(void *opaque);