master
h 38 lines 873 Bytes
Raw
1 /*
2 * Data structures representing asynchronous I/O operations
3 *
4 * Copyright IBM, Corp. 2008
5 *
6 * Authors:
7 * Anthony Liguori <aliguori@us.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 *
12 */
13
14 #ifndef QEMU_AIOCB_H
15 #define QEMU_AIOCB_H
16
17 typedef struct BlockAIOCB BlockAIOCB;
18 typedef void BlockCompletionFunc(void *opaque, int ret);
19
20 typedef struct AIOCBInfo {
21 void (*cancel_async)(BlockAIOCB *acb);
22 size_t aiocb_size;
23 } AIOCBInfo;
24
25 struct BlockAIOCB {
26 const AIOCBInfo *aiocb_info;
27 BlockDriverState *bs;
28 BlockCompletionFunc *cb;
29 void *opaque;
30 int refcnt;
31 };
32
33 void *qemu_aio_get(const AIOCBInfo *aiocb_info, BlockDriverState *bs,
34 BlockCompletionFunc *cb, void *opaque);
35 void qemu_aio_unref(void *p);
36 void qemu_aio_ref(void *p);
37
38 #endif