summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-09-11 13:41:09 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2014-09-22 11:38:58 +0100
commit02c50efe08736116048d5fc355043080f4d5859c (patch)
treec92a8394f0ae9d0378398f830f3396e0028520cc /include
parentf197fe2b2c77259b6570620f288d905bfa38e2da (diff)
downloadhqemu-02c50efe08736116048d5fc355043080f4d5859c.zip
hqemu-02c50efe08736116048d5fc355043080f4d5859c.tar.gz
block: Add bdrv_aio_cancel_async
This is the async version of bdrv_aio_cancel, which doesn't block the caller. It guarantees that the cb is called either before returning or some time later. bdrv_aio_cancel can base on bdrv_aio_cancel_async, later we can convert all .io_cancel implementations to .io_cancel_async, and the aio_poll is the common logic. In the end, .io_cancel can be dropped. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/aio.h2
-rw-r--r--include/block/block.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/include/block/aio.h b/include/block/aio.h
index 2626fc7..ad361e3 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -27,6 +27,8 @@ typedef void BlockDriverCompletionFunc(void *opaque, int ret);
typedef struct AIOCBInfo {
void (*cancel)(BlockDriverAIOCB *acb);
+ void (*cancel_async)(BlockDriverAIOCB *acb);
+ AioContext *(*get_aio_context)(BlockDriverAIOCB *acb);
size_t aiocb_size;
} AIOCBInfo;
diff --git a/include/block/block.h b/include/block/block.h
index 07d6d8e..3318f0d 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -337,6 +337,7 @@ BlockDriverAIOCB *bdrv_aio_discard(BlockDriverState *bs,
int64_t sector_num, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
void bdrv_aio_cancel(BlockDriverAIOCB *acb);
+void bdrv_aio_cancel_async(BlockDriverAIOCB *acb);
typedef struct BlockRequest {
/* Fields to be filled by multiwrite caller */
OpenPOWER on IntegriCloud