From 7381e95cc2c33b589c94a857dff21bf2016a08b7 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 20 Oct 2016 14:40:22 +0200 Subject: block: Remove bdrv_aio_pdiscard() It is unused now. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- include/block/block.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/block/block.h b/include/block/block.h index 107c603605..99a15a6bf6 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -314,9 +314,6 @@ BlockAIOCB *bdrv_aio_writev(BdrvChild *child, int64_t sector_num, BlockCompletionFunc *cb, void *opaque); BlockAIOCB *bdrv_aio_flush(BlockDriverState *bs, BlockCompletionFunc *cb, void *opaque); -BlockAIOCB *bdrv_aio_pdiscard(BlockDriverState *bs, - int64_t offset, int count, - BlockCompletionFunc *cb, void *opaque); void bdrv_aio_cancel(BlockAIOCB *acb); void bdrv_aio_cancel_async(BlockAIOCB *acb); -- cgit v1.2.3 From 48af776a5b85ad2dc6124d3d0fb210ca6b98d32c Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 20 Oct 2016 12:56:14 +0200 Subject: block: Use blk_co_ioctl() for all BB level ioctls All read/write functions already have a single coroutine-based function on the BlockBackend level through which all requests go (no matter what API style the external caller used) and which passes the requests down to the block node level. This patch exports a bdrv_co_ioctl() function and uses it to extend this mode of operation to ioctls. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- include/block/block.h | 1 + include/sysemu/block-backend.h | 1 + 2 files changed, 2 insertions(+) (limited to 'include') diff --git a/include/block/block.h b/include/block/block.h index 99a15a6bf6..e06db62ad3 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -318,6 +318,7 @@ void bdrv_aio_cancel(BlockAIOCB *acb); void bdrv_aio_cancel_async(BlockAIOCB *acb); /* sg packet commands */ +int bdrv_co_ioctl(BlockDriverState *bs, int req, void *buf); int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf); BlockAIOCB *bdrv_aio_ioctl(BlockDriverState *bs, unsigned long int req, void *buf, diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h index b07159b639..6444e41d39 100644 --- a/include/sysemu/block-backend.h +++ b/include/sysemu/block-backend.h @@ -146,6 +146,7 @@ BlockAIOCB *blk_aio_pdiscard(BlockBackend *blk, int64_t offset, int count, BlockCompletionFunc *cb, void *opaque); void blk_aio_cancel(BlockAIOCB *acb); void blk_aio_cancel_async(BlockAIOCB *acb); +int blk_co_ioctl(BlockBackend *blk, unsigned long int req, void *buf); int blk_ioctl(BlockBackend *blk, unsigned long int req, void *buf); BlockAIOCB *blk_aio_ioctl(BlockBackend *blk, unsigned long int req, void *buf, BlockCompletionFunc *cb, void *opaque); -- cgit v1.2.3 From 61b2450414ee052c8f2561e999852fad0534899e Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 20 Oct 2016 14:40:22 +0200 Subject: block: Remove bdrv_ioctl() It is unused now. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- include/block/block.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/block/block.h b/include/block/block.h index e06db62ad3..e0a54aa816 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -319,7 +319,6 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb); /* sg packet commands */ int bdrv_co_ioctl(BlockDriverState *bs, int req, void *buf); -int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf); BlockAIOCB *bdrv_aio_ioctl(BlockDriverState *bs, unsigned long int req, void *buf, BlockCompletionFunc *cb, void *opaque); -- cgit v1.2.3 From 16a389dc9ecc05e9d8d6ebd3eff6dc98158523e0 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 20 Oct 2016 15:07:27 +0200 Subject: block: Introduce .bdrv_co_ioctl() driver callback This allows drivers to implement ioctls in a coroutine-based way. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- include/block/block_int.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/block/block_int.h b/include/block/block_int.h index 3e79228eb0..e96e9ada57 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -244,6 +244,8 @@ struct BlockDriver { BlockAIOCB *(*bdrv_aio_ioctl)(BlockDriverState *bs, unsigned long int req, void *buf, BlockCompletionFunc *cb, void *opaque); + int coroutine_fn (*bdrv_co_ioctl)(BlockDriverState *bs, + unsigned long int req, void *buf); /* List of options for creating images, terminated by name == NULL */ QemuOptsList *create_opts; -- cgit v1.2.3 From cbc14ac9c3e199df759e2847b2301e2b990a8537 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 20 Oct 2016 14:40:22 +0200 Subject: block: Remove bdrv_aio_ioctl() It is unused now. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- include/block/block.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/block/block.h b/include/block/block.h index e0a54aa816..398a050176 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -319,9 +319,6 @@ void bdrv_aio_cancel_async(BlockAIOCB *acb); /* sg packet commands */ int bdrv_co_ioctl(BlockDriverState *bs, int req, void *buf); -BlockAIOCB *bdrv_aio_ioctl(BlockDriverState *bs, - unsigned long int req, void *buf, - BlockCompletionFunc *cb, void *opaque); /* Invalidate any cached metadata used by image formats */ void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp); -- cgit v1.2.3