Re: [virt-manager PATCH] storage: remove attempt counter from disk allocation thread

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

 



On 11/19/2015 09:11 AM, Pavel Hrdina wrote:
> Remove the lookup counter from _progress_thread, it's not necessary, the
> loop is terminated by _install_finished boolean.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1270277
> 
> Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
> ---
>  virtinst/storage.py | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/virtinst/storage.py b/virtinst/storage.py
> index e50b78f..9901cfb 100644
> --- a/virtinst/storage.py
> +++ b/virtinst/storage.py
> @@ -809,25 +809,20 @@ class StorageVolume(_StorageObject):
>                                 "'%s': '%s'" % (self.name, str(e)))
>  
>      def _progress_thread(self, meter):
> -        lookup_attempts = 10
>          vol = None
>          if not meter:
>              return
>  
> -        while lookup_attempts > 0:
> +        while True:
>              try:
>                  if not vol:
>                      vol = self.pool.storageVolLookupByName(self.name)
>                  vol.info()
>                  break
>              except:
> -                lookup_attempts -= 1
>                  time.sleep(.2)
>                  if self._install_finished:
>                      break
> -                else:
> -                    continue
> -            break
>  
>          if vol is None:
>              logging.debug("Couldn't lookup storage volume in prog thread.")
> 

ACK

- 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