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

Leonardo Augusto Guimarães Garcia lagarcia at linux.vnet.ibm.com
Fri Jul 26 12:56:39 UTC 2013


Some time after I sent 665375db I noticed that it was not sufficient, 
but didn't have time to investigate what was going on.

Tested your patch and it worked fine. ACK.

Best regards,

Leonardo Garcia

On 07/26/2013 05:14 AM, Martin Kletzander wrote:
> 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




More information about the virt-tools-list mailing list