[virt-tools-list] [PATCH virt-manager]: storage: fix default storage pool lookup

Cole Robinson crobinso at redhat.com
Mon Aug 31 22:30:10 UTC 2015


On 08/12/2015 06:00 PM, Charles Arnold wrote:
> virt-convert fails when the storage pool is already present but
> is not called 'default'.
> 
> If the 'default' pool has been removed but another pool uses the
> default location of /var/lib/libvirt/images virt-convert will fail
> to find the pool and attempt to create another one with the same
> path. This causes the conversion to fail.
> 
> Signed-off-by: Charles Arnold <carnold at suse.com>
> 
> diff --git a/virtinst/storage.py b/virtinst/storage.py
> index 285acb8..ea5eab8 100644
> --- a/virtinst/storage.py
> +++ b/virtinst/storage.py
> @@ -209,10 +209,13 @@ class StoragePool(_StorageObject):
>          try:
>              pool = conn.storagePoolLookupByName(name)
>          except libvirt.libvirtError:
> +            # Try default pool path when "default" name fails
> +            pool = StoragePool.lookup_pool_by_path(conn, path)
>              pass
>  
>          if pool:
> -            return
> +            # This is a libvirt pool object so create a StoragePool from it
> +            return StoragePool(conn, parsexml=pool.XMLDesc(0))
>  
>          try:
>              logging.debug("Attempting to build default pool with target '%s'",

Make sense, pushed now, but with the now redundant 'pass' dropped

(sorry for the delay, I've been offline for weeks)

Thanks,
Cole




More information about the virt-tools-list mailing list