[virt-tools-list] [virt-manager PATCH] virtinst.storage: check _pool_xml before using it

Cole Robinson crobinso at redhat.com
Tue May 16 21:37:31 UTC 2017


On 05/16/2017 10:59 AM, Pavel Hrdina wrote:
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1450311
> 
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> ---
>  virtinst/storage.py | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/virtinst/storage.py b/virtinst/storage.py
> index a6963d50..66201efc 100644
> --- a/virtinst/storage.py
> +++ b/virtinst/storage.py
> @@ -698,7 +698,9 @@ class StorageVolume(_StorageObject):
>                  return self.TYPE_DIR
>              elif self.type == "network":
>                  return self.TYPE_NETWORK
> -        return self._pool_xml.get_disk_type()
> +        if self._pool_xml:
> +            return self._pool_xml.get_disk_type()
> +        return None
>      file_type = property(_get_vol_type)
>  
>  
> 

There's a couple other places in the StorageVolume code that seem to depend on
self._pool_xml being populated, so I don't think this is a complete fix. I
think we need to figure out what the root cause is and then add a test case to
trigger it. I've asked for more info in the bug

Thanks,
Cole




More information about the virt-tools-list mailing list