[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/6] qemu-img: rebase: use backing files' BlockBackend for buffer
From: |
Andrey Drobyshev |
Subject: |
[PATCH 3/6] qemu-img: rebase: use backing files' BlockBackend for buffer alignment |
Date: |
Thu, 1 Jun 2023 22:28:33 +0300 |
Since commit bb1c05973cf ("qemu-img: Use qemu_blockalign"), buffers for
the data read from the old and new backing files are aligned using
BlockDriverState (or BlockBackend later on) referring to the target image.
However, this isn't quite right, because target image is only being
written to and has nothing to do with those buffers. Let's fix that.
Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com>
---
qemu-img.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 78433f3746..60f4c06487 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -3746,8 +3746,8 @@ static int img_rebase(int argc, char **argv)
int64_t n;
float local_progress = 0;
- buf_old = blk_blockalign(blk, IO_BUF_SIZE);
- buf_new = blk_blockalign(blk, IO_BUF_SIZE);
+ buf_old = blk_blockalign(blk_old_backing, IO_BUF_SIZE);
+ buf_new = blk_blockalign(blk_new_backing, IO_BUF_SIZE);
size = blk_getlength(blk);
if (size < 0) {
--
2.31.1
- [PATCH 0/6] qemu-img: rebase: add compression support, Andrey Drobyshev, 2023/06/01
- [PATCH 2/6] qemu-iotests: 024: add rebasing test case for overlay_size > backing_size, Andrey Drobyshev, 2023/06/01
- [PATCH 6/6] iotests: add test 314 for "qemu-img rebase" with compression, Andrey Drobyshev, 2023/06/01
- [PATCH 3/6] qemu-img: rebase: use backing files' BlockBackend for buffer alignment,
Andrey Drobyshev <=
- [PATCH 5/6] qemu-img: add compression option to rebase subcommand, Andrey Drobyshev, 2023/06/01
- [PATCH 4/6] qemu-img: rebase: avoid unnecessary COW operations, Andrey Drobyshev, 2023/06/01
- [PATCH 1/6] qemu-img: rebase: stop when reaching EOF of old backing file, Andrey Drobyshev, 2023/06/01
- Re: [PATCH 0/6] qemu-img: rebase: add compression support, Denis V. Lunev, 2023/06/30