[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 20/27] block/parallels: use buffer-based io
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 20/27] block/parallels: use buffer-based io |
Date: |
Tue, 30 Apr 2019 17:42:37 +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/parallels.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/block/parallels.c b/block/parallels.c
index 15bc97b759..2747400577 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -220,20 +220,18 @@ static int64_t allocate_clusters(BlockDriverState *bs,
int64_t sector_num,
if (bs->backing) {
int64_t nb_cow_sectors = to_allocate * s->tracks;
int64_t nb_cow_bytes = nb_cow_sectors << BDRV_SECTOR_BITS;
- QEMUIOVector qiov =
- QEMU_IOVEC_INIT_BUF(qiov, qemu_blockalign(bs, nb_cow_bytes),
- nb_cow_bytes);
+ void *buf = qemu_blockalign(bs, nb_cow_bytes);
- ret = bdrv_co_preadv(bs->backing, idx * s->tracks * BDRV_SECTOR_SIZE,
- nb_cow_bytes, &qiov, 0);
+ ret = bdrv_co_pread(bs->backing, idx * s->tracks * BDRV_SECTOR_SIZE,
+ nb_cow_bytes, buf, 0);
if (ret < 0) {
- qemu_vfree(qemu_iovec_buf(&qiov));
+ qemu_vfree(buf);
return ret;
}
ret = bdrv_co_pwritev(bs->file, s->data_end * BDRV_SECTOR_SIZE,
- nb_cow_bytes, &qiov, 0);
- qemu_vfree(qemu_iovec_buf(&qiov));
+ nb_cow_bytes, buf, 0);
+ qemu_vfree(buf);
if (ret < 0) {
return ret;
}
--
2.20.1
- [Qemu-block] [PULL 07/27] cutils: Fix size_to_str() on 32-bit platforms, (continued)
- [Qemu-block] [PULL 07/27] cutils: Fix size_to_str() on 32-bit platforms, Kevin Wolf, 2019/04/30
- [Qemu-block] [PULL 09/27] qcow2: Avoid COW during metadata preallocation, Kevin Wolf, 2019/04/30
- [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 <=
- [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, 2019/04/30
- [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