[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/69] block/block-backend: add blk_co_pwritev_part
From: |
Max Reitz |
Subject: |
[PULL 10/69] block/block-backend: add blk_co_pwritev_part |
Date: |
Mon, 28 Oct 2019 13:14:02 +0100 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Add blk write function with qiov_offset parameter. It's needed for the
following commit.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
include/sysemu/block-backend.h | 4 ++++
block/block-backend.c | 17 +++++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 368d53af77..73f2cef7fe 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -121,6 +121,10 @@ void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps
*ops, void *opaque);
int coroutine_fn blk_co_preadv(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 coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset,
unsigned int bytes, QEMUIOVector *qiov,
BdrvRequestFlags flags);
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;
--
2.21.0
- [PULL 00/69] Block patches for softfreeze, Max Reitz, 2019/10/28
- [PULL 01/69] iotests: Prefer null-co over null-aio, Max Reitz, 2019/10/28
- [PULL 02/69] iotests: Allow skipping test cases, Max Reitz, 2019/10/28
- [PULL 03/69] iotests: Use case_skip() in skip_if_unsupported(), Max Reitz, 2019/10/28
- [PULL 06/69] iotests: Test driver whitelisting in 136, Max Reitz, 2019/10/28
- [PULL 04/69] iotests: Let skip_if_unsupported accept a function, Max Reitz, 2019/10/28
- [PULL 08/69] hbitmap: handle set/reset with zero length, Max Reitz, 2019/10/28
- [PULL 05/69] iotests: Test driver whitelisting in 093, Max Reitz, 2019/10/28
- [PULL 07/69] iotests: Cache supported_formats(), Max Reitz, 2019/10/28
- [PULL 09/69] block/mirror: simplify do_sync_target_write, Max Reitz, 2019/10/28
- [PULL 10/69] block/block-backend: add blk_co_pwritev_part,
Max Reitz <=
- [PULL 11/69] block/mirror: support unaligned write in active mirror, Max Reitz, 2019/10/28
- [PULL 12/69] Revert "mirror: Only mirror granularity-aligned chunks", Max Reitz, 2019/10/28
- [PULL 13/69] iotests: Introduce $SOCK_DIR, Max Reitz, 2019/10/28
- [PULL 14/69] iotests.py: Store socket files in $SOCK_DIR, Max Reitz, 2019/10/28
- [PULL 15/69] iotests.py: Add @base_dir to FilePaths etc., Max Reitz, 2019/10/28
- [PULL 16/69] iotests: Filter $SOCK_DIR, Max Reitz, 2019/10/28
- [PULL 17/69] iotests: Let common.nbd create socket in $SOCK_DIR, Max Reitz, 2019/10/28
- [PULL 19/69] iotests/140: Create socket in $SOCK_DIR, Max Reitz, 2019/10/28
- [PULL 18/69] iotests/083: Create socket in $SOCK_DIR, Max Reitz, 2019/10/28
- [PULL 21/69] iotests/147: Create socket in $SOCK_DIR, Max Reitz, 2019/10/28