[virt-manager][PATCH] Fix progres bar output bug in virt-clone.

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

 



From: Leonardo Garcia <lagarcia@xxxxxxxxxx>

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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/virtinst/Storage.py b/virtinst/Storage.py
index 54ee631..b29532a 100644
--- a/virtinst/Storage.py
+++ b/virtinst/Storage.py
@@ -1279,9 +1279,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):
-- 
1.7.1

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux