File 025-virtinstall-Fix-the-allocating-disk-size-printed-by-the-progress-bar.patch of Package virt-manager

Subject: virtinstall: Fix the allocating disk size printed by the progress bar
From: Toshiki Sonoda sonoda.toshiki@fujitsu.com Wed Nov 9 18:33:56 2022 +0900
Date: Wed Dec 14 13:07:26 2022 -0500:
Git: 39c7a443146433766e4e71e48ab59145c74924b3

When a sparse file is created during a disk allocation,
virt-install prints not the created disk size but a sparse file size.

Therefore, we fix to print the created disk size during disk allocation
instead of the size of the sparse file by updating the meter with the
self.capacity.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
Signed-off-by: Haruka Ohata <ohata.haruka@fujitsu.com>

diff --git a/virtinst/storage.py b/virtinst/storage.py
index 3c5d39bb..f9a9f7a7 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -695,6 +695,7 @@ class StorageVolume(_StorageObject):
                 log.debug("Using vol create flags=%s", createflags)
                 vol = self.pool.createXML(xml, createflags)
 
+            meter.update(self.capacity)
             meter.end()
             log.debug("Storage volume '%s' install complete.", self.name)
             return vol
openSUSE Build Service is sponsored by