[virt-tools-list] [virt-manager PATCH] Fix progress bars in virt-clone once more

Martin Kletzander mkletzan at redhat.com
Fri Jul 26 08:14:18 UTC 2013


Commit 665375db was meant to fix the progress bar problems, but as
I've found out just made one race (which still persisted) a little
less probable.  The real problem was in the upper code which meant to
finish the progress bar properly, however this was not done thanks to
'finally' statement being not executed when the function returned in
the 'try' part.  This patch makes the upper caller wait for the
updating thread to finish and then properly end()s the progress bar's
output.

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 virtinst/Storage.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/virtinst/Storage.py b/virtinst/Storage.py
index 8a3f51a..e0b0ef1 100644
--- a/virtinst/Storage.py
+++ b/virtinst/Storage.py
@@ -1219,6 +1219,8 @@ class StorageVolume(StorageObject):
             else:
                 vol = self.pool.createXML(xml, 0)

+            self._install_finished = True
+            t.join()
             meter.end(self.capacity)
             logging.debug("Storage volume '%s' install complete.",
                           self.name)
@@ -1231,8 +1233,6 @@ class StorageVolume(StorageObject):
         except Exception, e:
             raise RuntimeError("Couldn't create storage volume "
                                "'%s': '%s'" % (self.name, str(e)))
-        finally:
-            self._install_finished = True

     def _progress_thread(self, meter):
         lookup_attempts = 10
-- 
1.8.3.2




More information about the virt-tools-list mailing list