summaryrefslogtreecommitdiff
path: root/block/io.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-10-20 12:56:14 +0200
committerKevin Wolf <kwolf@redhat.com>2016-10-27 19:05:22 +0200
commit48af776a5b85ad2dc6124d3d0fb210ca6b98d32c (patch)
tree279aeb52ea00e4446640518e259a6e356d283816 /block/io.c
parent7381e95cc2c33b589c94a857dff21bf2016a08b7 (diff)
downloadqemu-48af776a5b85ad2dc6124d3d0fb210ca6b98d32c.tar.gz
qemu-48af776a5b85ad2dc6124d3d0fb210ca6b98d32c.tar.bz2
qemu-48af776a5b85ad2dc6124d3d0fb210ca6b98d32c.zip
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 <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block/io.c')
-rw-r--r--block/io.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/block/io.c b/block/io.c
index ff93ba1426..7c119d5113 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2492,7 +2492,7 @@ int bdrv_pdiscard(BlockDriverState *bs, int64_t offset, int count)
return rwco.ret;
}
-static int bdrv_co_do_ioctl(BlockDriverState *bs, int req, void *buf)
+int bdrv_co_ioctl(BlockDriverState *bs, int req, void *buf)
{
BlockDriver *drv = bs->drv;
BdrvTrackedRequest tracked_req;
@@ -2528,7 +2528,7 @@ typedef struct {
static void coroutine_fn bdrv_co_ioctl_entry(void *opaque)
{
BdrvIoctlCoData *data = opaque;
- data->ret = bdrv_co_do_ioctl(data->bs, data->req, data->buf);
+ data->ret = bdrv_co_ioctl(data->bs, data->req, data->buf);
}
/* needed for generic scsi interface */
@@ -2558,8 +2558,8 @@ int bdrv_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
static void coroutine_fn bdrv_co_aio_ioctl_entry(void *opaque)
{
BlockAIOCBCoroutine *acb = opaque;
- acb->req.error = bdrv_co_do_ioctl(acb->common.bs,
- acb->req.req, acb->req.buf);
+ acb->req.error = bdrv_co_ioctl(acb->common.bs,
+ acb->req.req, acb->req.buf);
bdrv_co_complete(acb);
}