[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 24/27] qemu-img: use buffer-based io
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 24/27] qemu-img: use buffer-based io |
Date: |
Tue, 30 Apr 2019 17:42:41 +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>
---
qemu-img.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index ddd55ab291..e6ad5978e0 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1680,7 +1680,6 @@ static int coroutine_fn convert_co_read(ImgConvertState
*s, int64_t sector_num,
int nb_sectors, uint8_t *buf)
{
int n, ret;
- QEMUIOVector qiov;
assert(nb_sectors <= s->buf_sectors);
while (nb_sectors > 0) {
@@ -1696,11 +1695,10 @@ static int coroutine_fn convert_co_read(ImgConvertState
*s, int64_t sector_num,
bs_sectors = s->src_sectors[src_cur];
n = MIN(nb_sectors, bs_sectors - (sector_num - src_cur_offset));
- qemu_iovec_init_buf(&qiov, buf, n << BDRV_SECTOR_BITS);
- ret = blk_co_preadv(
+ ret = blk_co_pread(
blk, (sector_num - src_cur_offset) << BDRV_SECTOR_BITS,
- n << BDRV_SECTOR_BITS, &qiov, 0);
+ n << BDRV_SECTOR_BITS, buf, 0);
if (ret < 0) {
return ret;
}
@@ -1719,7 +1717,6 @@ static int coroutine_fn convert_co_write(ImgConvertState
*s, int64_t sector_num,
enum ImgConvertBlockStatus status)
{
int ret;
- QEMUIOVector qiov;
while (nb_sectors > 0) {
int n = nb_sectors;
@@ -1747,10 +1744,8 @@ static int coroutine_fn convert_co_write(ImgConvertState
*s, int64_t sector_num,
(s->compressed &&
!buffer_is_zero(buf, n * BDRV_SECTOR_SIZE)))
{
- qemu_iovec_init_buf(&qiov, buf, n << BDRV_SECTOR_BITS);
-
- ret = blk_co_pwritev(s->target, sector_num << BDRV_SECTOR_BITS,
- n << BDRV_SECTOR_BITS, &qiov, flags);
+ ret = blk_co_pwrite(s->target, sector_num << BDRV_SECTOR_BITS,
+ n << BDRV_SECTOR_BITS, buf, flags);
if (ret < 0) {
return ret;
}
--
2.20.1
- [Qemu-block] [PULL 15/27] qcow2: Fix error handling in the compression code, (continued)
- [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, 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 <=
- [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