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.
This commit is contained in:
Leonardo Garcia 2013-06-09 16:19:35 -03:00 committed by Cole Robinson
parent 576721d8b2
commit 665375db1b

View File

@ -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):