49 lines
1.9 KiB
Diff
49 lines
1.9 KiB
Diff
|
|
From 38de3be1e41bff18bf21cbf16a1dc585359dd4bd Mon Sep 17 00:00:00 2001
|
||
|
|
From: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||
|
|
Date: Fri, 8 Mar 2024 05:39:12 +0000
|
||
|
|
Subject: [PATCH] block/parallels: Fix buffer-based write call mainline
|
||
|
|
inclusion commit eba088f91d21d9e42a81bef847173da30c5da961 category: bugfix
|
||
|
|
|
||
|
|
---------------------------------------------------------------
|
||
|
|
|
||
|
|
Commit a4072543ccdddbd241d5962d9237b8b41fd006bf has changed the I/O here
|
||
|
|
from working on a local one-element I/O vector to just using the buffer
|
||
|
|
directly (using the bdrv_co_pread()/bdrv_co_pwrite() helper functions
|
||
|
|
introduced shortly before).
|
||
|
|
|
||
|
|
However, it only changed the bdrv_co_preadv() call to bdrv_co_pread() -
|
||
|
|
the subsequent bdrv_co_pwritev() call stayed this way, and so still
|
||
|
|
expects a QEMUIOVector pointer instead of a plain buffer. We must
|
||
|
|
change that to be a bdrv_co_pwrite() call.
|
||
|
|
|
||
|
|
Fixes: a4072543ccdddbd241d5962d ("block/parallels: use buffer-based io")
|
||
|
|
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
|
||
|
|
Reviewed-by: Denis V. Lunev <den@openvz.org>
|
||
|
|
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
||
|
|
Message-Id: <20220714132801.72464-2-hreitz@redhat.com>
|
||
|
|
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
|
||
|
|
|
||
|
|
Signed-off-by: tangbinzy <tangbin_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
block/parallels.c | 4 ++--
|
||
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/block/parallels.c b/block/parallels.c
|
||
|
|
index 6ebad2a2bb..f3352b6aa7 100644
|
||
|
|
--- a/block/parallels.c
|
||
|
|
+++ b/block/parallels.c
|
||
|
|
@@ -240,8 +240,8 @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num,
|
||
|
|
return ret;
|
||
|
|
}
|
||
|
|
|
||
|
|
- ret = bdrv_co_pwritev(bs->file, s->data_end * BDRV_SECTOR_SIZE,
|
||
|
|
- nb_cow_bytes, buf, 0);
|
||
|
|
+ ret = bdrv_co_pwrite(bs->file, s->data_end * BDRV_SECTOR_SIZE,
|
||
|
|
+ nb_cow_bytes, buf, 0);
|
||
|
|
qemu_vfree(buf);
|
||
|
|
if (ret < 0) {
|
||
|
|
return ret;
|
||
|
|
--
|
||
|
|
2.27.0
|
||
|
|
|