diff options
| author | Vladimir Sementsov-Ogievskiy | 2019-10-11 11:07:09 +0200 |
|---|---|---|
| committer | Max Reitz | 2019-10-28 11:22:30 +0100 |
| commit | b30168647fea0fc173a0e244d2943fc5575ca511 (patch) | |
| tree | d4aecbc6291ddcd6575e99f625326e8ac07590c0 /block | |
| parent | block/mirror: simplify do_sync_target_write (diff) | |
| download | qemu-b30168647fea0fc173a0e244d2943fc5575ca511.tar.gz qemu-b30168647fea0fc173a0e244d2943fc5575ca511.tar.xz qemu-b30168647fea0fc173a0e244d2943fc5575ca511.zip | |
block/block-backend: add blk_co_pwritev_part
Add blk write function with qiov_offset parameter. It's needed for the
following commit.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20191011090711.19940-4-vsementsov@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block')
| -rw-r--r-- | block/block-backend.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/block/block-backend.c b/block/block-backend.c index eb22ff306e..912c50678d 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -1178,9 +1178,10 @@ int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset, return ret; } -int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, - unsigned int bytes, QEMUIOVector *qiov, - BdrvRequestFlags flags) +int coroutine_fn blk_co_pwritev_part(BlockBackend *blk, int64_t offset, + unsigned int bytes, + QEMUIOVector *qiov, size_t qiov_offset, + BdrvRequestFlags flags) { int ret; BlockDriverState *bs; @@ -1207,11 +1208,19 @@ int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, flags |= BDRV_REQ_FUA; } - ret = bdrv_co_pwritev(blk->root, offset, bytes, qiov, flags); + ret = bdrv_co_pwritev_part(blk->root, offset, bytes, qiov, qiov_offset, + flags); bdrv_dec_in_flight(bs); return ret; } +int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset, + unsigned int bytes, QEMUIOVector *qiov, + BdrvRequestFlags flags) +{ + return blk_co_pwritev_part(blk, offset, bytes, qiov, 0, flags); +} + typedef struct BlkRwCo { BlockBackend *blk; int64_t offset; |
