diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-08-07 02:38:06 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-08-07 02:38:06 +0000 |
commit | ce1a14dc0d94cf85393356f56f197c5e8b6a7f60 (patch) | |
tree | b7c395f3494275bdb05f8c7ce54740325d4ac9ae /block_int.h | |
parent | 51d6bae7a8d7a359d79004c586be352cd924d75f (diff) |
Dynamically allocate AIO Completion Blocks.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2098 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block_int.h')
-rw-r--r-- | block_int.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/block_int.h b/block_int.h index 26cc4ffbac..8fd241f2a9 100644 --- a/block_int.h +++ b/block_int.h @@ -42,13 +42,14 @@ struct BlockDriver { int (*bdrv_set_key)(BlockDriverState *bs, const char *key); int (*bdrv_make_empty)(BlockDriverState *bs); /* aio */ - int (*bdrv_aio_new)(BlockDriverAIOCB *acb); - int (*bdrv_aio_read)(BlockDriverAIOCB *acb, int64_t sector_num, - uint8_t *buf, int nb_sectors); - int (*bdrv_aio_write)(BlockDriverAIOCB *acb, int64_t sector_num, - const uint8_t *buf, int nb_sectors); + BlockDriverAIOCB *(*bdrv_aio_read)(BlockDriverState *bs, + int64_t sector_num, uint8_t *buf, int nb_sectors, + BlockDriverCompletionFunc *cb, void *opaque); + BlockDriverAIOCB *(*bdrv_aio_write)(BlockDriverState *bs, + int64_t sector_num, const uint8_t *buf, int nb_sectors, + BlockDriverCompletionFunc *cb, void *opaque); void (*bdrv_aio_cancel)(BlockDriverAIOCB *acb); - void (*bdrv_aio_delete)(BlockDriverAIOCB *acb); + int aiocb_size; const char *protocol_name; int (*bdrv_pread)(BlockDriverState *bs, int64_t offset, @@ -69,6 +70,7 @@ struct BlockDriver { QEMUSnapshotInfo **psn_info); int (*bdrv_get_info)(BlockDriverState *bs, BlockDriverInfo *bdi); + BlockDriverAIOCB *free_aiocb; struct BlockDriver *next; }; @@ -96,9 +98,9 @@ struct BlockDriverState { int is_temporary; BlockDriverState *backing_hd; - /* sync read/write emulation */ + /* async read/write emulation */ - BlockDriverAIOCB *sync_aiocb; + void *sync_aiocb; /* NOTE: the following infos are only hints for real hardware drivers. They are not used by the block driver */ @@ -111,11 +113,14 @@ struct BlockDriverState { struct BlockDriverAIOCB { BlockDriverState *bs; BlockDriverCompletionFunc *cb; - void *cb_opaque; - - void *opaque; /* driver opaque */ + void *opaque; + BlockDriverAIOCB *next; }; void get_tmp_filename(char *filename, int size); +void *qemu_aio_get(BlockDriverState *bs, BlockDriverCompletionFunc *cb, + void *opaque); +void qemu_aio_release(void *p); + #endif /* BLOCK_INT_H */ |