From 665375db1bdaa4075f90cfd6e736484798ba306e Mon Sep 17 00:00:00 2001 From: Leonardo Garcia Date: Sun, 9 Jun 2013 16:19:35 -0300 Subject: [PATCH] Fix progres bar output bug in virt-clone. The loop in StorageVolume._progress_thread that updates the cloning progress bar has a call to sleep in the beginning of the loop which causes issues with the progress bar. An example output (shorten to use less columns) with the problem: [laggarcia@fedora18 virt-manager]$ ./virt-clone --connect qemu+ssh://root@192.168.122.1/system --original=Fedora18-test --auto-clone root@192.168.122.1's password: Allocating 'Fedora18-test-clone.img' | 20 GB 00:00:56 Clone 'Fedora18-test-clone' created successfully. [laggarcia@fedora18 virt-manager]$ ' 4% [===- ] -300039887.4 B/s | 881 MB --:--:-- ETA As the StorageVolume._progress_thread sleeps for one second when the loop starts, it might occur that, when the cloning procedure finishes, the loop is still awaiting to update the progress bar, which will cause a bad progress bar update. This simple fix solves this issue. --- virtinst/Storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virtinst/Storage.py b/virtinst/Storage.py index 13233ad30..1dc176894 100644 --- a/virtinst/Storage.py +++ b/virtinst/Storage.py @@ -1278,9 +1278,9 @@ class StorageVolume(StorageObject): return while not self._install_finished: - time.sleep(1) ignore, ignore, alloc = vol.info() meter.update(alloc) + time.sleep(1) def is_size_conflict(self):