qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PATCH 4/6] qcow2: Update total_sectors when resizing the i


From: Leonid Bloch
Subject: [Qemu-block] [PATCH 4/6] qcow2: Update total_sectors when resizing the image
Date: Mon, 30 Jul 2018 00:27:42 +0300

Signed-off-by: Leonid Bloch <address@hidden>
---
 block/qcow2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/qcow2.c b/block/qcow2.c
index ec9e6238a0..223d351e40 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -3646,6 +3646,8 @@ static int coroutine_fn 
qcow2_co_truncate(BlockDriverState *bs, int64_t offset,
         }
     }
 
+    bs->total_sectors = offset / 512;
+
     /* write updated header.size */
     offset = cpu_to_be64(offset);
     ret = bdrv_pwrite_sync(bs->file, offsetof(QCowHeader, size),
-- 
2.17.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]