Re: [virt-manager PATCH] Fix progress bars in virt-clone once more

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

 



On 07/26/2013 04: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@xxxxxxxxxx>
> ---
>  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
> 

ACK

Thanks,
Cole

_______________________________________________
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