fully split aio_pool from BlockDriver

Now that we have a separate aio pool structure we can remove those
aio pool details from BlockDriver.

Every driver supporting AIO now needs to declare a static AIOPool
with the aiocb size and the cancellation method.  This cleans up the
current code considerably and will make it cleaner and more obvious
to support two different aio implementations behind a single
BlockDriver.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Christoph Hellwig 2009-05-25 12:37:32 +02:00 committed by Anthony Liguori
parent ad53089b0d
commit c16b5a2ca0
9 changed files with 121 additions and 149 deletions

View file

@ -67,8 +67,6 @@ struct BlockDriver {
BlockDriverAIOCB *(*bdrv_aio_writev)(BlockDriverState *bs,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
void (*bdrv_aio_cancel)(BlockDriverAIOCB *acb);
int aiocb_size;
const char *protocol_name;
int (*bdrv_truncate)(BlockDriverState *bs, int64_t offset);
@ -102,8 +100,6 @@ struct BlockDriver {
unsigned long int req, void *buf,
BlockDriverCompletionFunc *cb, void *opaque);
AIOPool aio_pool;
/* List of options for creating images, terminated by name == NULL */
QEMUOptionParameter *create_options;
@ -173,13 +169,8 @@ struct BlockDriverAIOCB {
void get_tmp_filename(char *filename, int size);
void aio_pool_init(AIOPool *pool, int aiocb_size,
void (*cancel)(BlockDriverAIOCB *acb));
void *qemu_aio_get(BlockDriverState *bs, BlockDriverCompletionFunc *cb,
void *opaque);
void *qemu_aio_get_pool(AIOPool *pool, BlockDriverState *bs,
BlockDriverCompletionFunc *cb, void *opaque);
void *qemu_aio_get(AIOPool *pool, BlockDriverState *bs,
BlockDriverCompletionFunc *cb, void *opaque);
void qemu_aio_release(void *p);
void *qemu_blockalign(BlockDriverState *bs, size_t size);