aio: move BlockDriverAIOCB to qemu-aio.h
PATCH 1/1 aio: move BlockDriverAIOCB to qemu-aio.h
And remove several block_int.h inclusions that should not be there.
Signed-off-by Paolo Bonzini <[email protected]>
--- block.h | 2 -- block_int.h | 18 ------------------ dma-helpers.c | 1 - hw/ide/core.c | 1 - hw/lsi53c895a.c | 1 - linux-aio.c | 1 - qemu-aio.h | 21 +++++++++++++++++++++ 7 files changed, 21 insertions(+), 24 deletions(-)
block.h +0 -2
@@ -180,8 +180,6 @@ typedef struct BdrvCheckResult {int bdrv_check (BlockDriverState *bs,BdrvCheckResult *res);/* async block I/O */ -typedef struct BlockDriverAIOCB BlockDriverAIOCB ; -typedef void BlockDriverCompletionFunc (void *opaque,int ret);typedef void BlockDriverDirtyHandler (BlockDriverState *bs,int64_t sector,int sector_num); BlockDriverAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num,
block_int.h +0 -18
@@ -53,12 +53,6 @@typedef struct BdrvTrackedRequest BdrvTrackedRequest ; -typedef struct AIOPool { -void (*cancel)(BlockDriverAIOCB *acb); -int aiocb_size; -BlockDriverAIOCB *free_aiocb; -}AIOPool ; - typedef struct BlockIOLimit { int64_t bps[3]; int64_t iops[3];
@@ -302,20 +296,8 @@ struct BlockDriverState {BlockJob *job; }; -struct BlockDriverAIOCB { -AIOPool *pool; -BlockDriverState *bs; -BlockDriverCompletionFunc *cb; -void *opaque; -BlockDriverAIOCB *next; -}; -void get_tmp_filename (char *filename,int size); -void *qemu_aio_get (AIOPool *pool,BlockDriverState *bs, -BlockDriverCompletionFunc *cb,void *opaque); -void qemu_aio_release (void *p); -void bdrv_set_io_limits (BlockDriverState *bs,BlockIOLimit *io_limits);
dma-helpers.c +0 -1
@@ -8,7 +8,6 @@*/ #include "dma.h" -#include "block_int.h" #include "trace.h" void qemu_sglist_init (QEMUSGList *qsg,int alloc_hint)
hw/ide/core.c +0 -1
@@ -31,7 +31,6 @@#include "sysemu.h" #include "dma.h" #include "blockdev.h" -#include "block_int.h" #include <hw/ide/internal.h>
hw/lsi53c895a.c +0 -1
@@ -15,7 +15,6 @@#include "hw.h" #include "pci.h" #include "scsi.h" -#include "block_int.h" #include "dma.h" //#define DEBUG_LSI
linux-aio.c +0 -1
@@ -9,7 +9,6 @@*/ #include "qemu-common.h" #include "qemu-aio.h" -#include "block_int.h" #include "block/raw-posix-aio.h" #include <sys/eventfd.h>
qemu-aio.h +21 -0
@@ -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);
Signature · 1 line
1.7.7.6
Quoted 12 lines · Paolo Bonzini
And remove several
block_int.hinclusions that should not be there.Signed-off-by Paolo Bonzini <[email protected]>--- block.h | 2 -- block_int.h | 18 ------------------ dma-helpers.c | 1 - hw/ide/core.c | 1 - hw/lsi53c895a.c | 1 - linux-aio.c | 1 - qemu-aio.h | 21 +++++++++++++++++++++ 7 files changed, 21 insertions(+), 24 deletions(-)
I don't see a big difference either way. Removing the block_int.h includes is nice though.
Reviewed-by Stefan Hajnoczi <[email protected]>
Kevin Wolf
AppliedAm 12.03.2012 17:01, schrieb Paolo Bonzini:
Quoted 3 lines
And remove several
block_int.hinclusions that should not be there.Signed-off-by Paolo Bonzini <[email protected]>
Thanks, applied to the block branch.
Kevin