[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 17/27] block/qcow2: use buffer-based io
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 17/27] block/qcow2: use buffer-based io |
Date: |
Tue, 30 Apr 2019 17:42:34 +0200 |
From: Vladimir Sementsov-Ogievskiy <address@hidden>
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Stefano Garzarella <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index c5c17734d7..a520d116ef 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -4094,7 +4094,6 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs,
uint64_t offset,
uint64_t bytes, QEMUIOVector *qiov)
{
BDRVQcow2State *s = bs->opaque;
- QEMUIOVector hd_qiov;
int ret;
ssize_t out_len;
uint8_t *buf, *out_buf;
@@ -4161,10 +4160,8 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs,
uint64_t offset,
goto fail;
}
- qemu_iovec_init_buf(&hd_qiov, out_buf, out_len);
-
BLKDBG_EVENT(s->data_file, BLKDBG_WRITE_COMPRESSED);
- ret = bdrv_co_pwritev(s->data_file, cluster_offset, out_len, &hd_qiov, 0);
+ ret = bdrv_co_pwrite(s->data_file, cluster_offset, out_len, out_buf, 0);
if (ret < 0) {
goto fail;
}
@@ -4187,7 +4184,6 @@ qcow2_co_preadv_compressed(BlockDriverState *bs,
int ret = 0, csize, nb_csectors;
uint64_t coffset;
uint8_t *buf, *out_buf;
- QEMUIOVector local_qiov;
int offset_in_cluster = offset_into_cluster(s, offset);
coffset = file_cluster_offset & s->cluster_offset_mask;
@@ -4198,12 +4194,11 @@ qcow2_co_preadv_compressed(BlockDriverState *bs,
if (!buf) {
return -ENOMEM;
}
- qemu_iovec_init_buf(&local_qiov, buf, csize);
out_buf = qemu_blockalign(bs, s->cluster_size);
BLKDBG_EVENT(bs->file, BLKDBG_READ_COMPRESSED);
- ret = bdrv_co_preadv(bs->file, coffset, csize, &local_qiov, 0);
+ ret = bdrv_co_pread(bs->file, coffset, csize, buf, 0);
if (ret < 0) {
goto fail;
}
--
2.20.1
- [Qemu-block] [PULL 11/27] qcow2: Fix full preallocation with external data file, (continued)
- [Qemu-block] [PULL 11/27] qcow2: Fix full preallocation with external data file, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 10/27] qcow2: Add errp to preallocate_co(), Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 08/27] qemu-img: Saner printing of large file sizes, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 12/27] iotests: Perform the correct test in 082, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 14/27] qcow2: Fix qcow2_make_empty() with external data file, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 15/27] qcow2: Fix error handling in the compression code, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 16/27] block: introduce byte-based io helpers, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 13/27] qemu-img: Make create hint at protocol options, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 20/27] block/parallels: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 23/27] block/stream: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 17/27] block/qcow2: use buffer-based io,
Kevin Wolf <=
- [Qemu-block] [PULL 18/27] block/qcow: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 21/27] block/backup: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 19/27] block/qed: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 25/27] commit: Make base read-only if there is an early failure, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 24/27] qemu-img: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 22/27] block/commit: use buffer-based io, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 26/27] iotests: Check that images are in read-only mode after block-commit, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 27/27] block/qed: add missed coroutine_fn markers, Kevin Wolf, 2019/04/30
- Re: [Qemu-block] [Qemu-devel] [PULL 00/27] Block layer patches, Peter Maydell, 2019/04/30