From a808bd669293ac66047a716b2e84a5a64c99667b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 12 Feb 2014 13:57:44 -0500 Subject: connection: Handle volume XMLDesc errors (bz 1064275) This commonly happens when a file is deleted from a storage pool behind libvirt's back. --- virtinst/connection.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'virtinst') diff --git a/virtinst/connection.py b/virtinst/connection.py index 0fa097cd..210d927b 100644 --- a/virtinst/connection.py +++ b/virtinst/connection.py @@ -225,8 +225,13 @@ class VirtualConnection(object): pool = self._libvirtconn.storagePoolLookupByName(xmlobj.name) ignore, ignore, vols = pollhelpers.fetch_volumes( self, pool, {}, lambda obj, ignore: obj) - ret += [StorageVolume(weakref.ref(self), parsexml=obj.XMLDesc(0)) - for obj in vols.values()] + + for vol in vols.values(): + try: + xml = vol.XMLDesc(0) + ret.append(StorageVolume(weakref.ref(self), parsexml=xml)) + except libvirt.libvirtError, e: + logging.debug("Fetching volume XML failed: %s", e) if self.cache_object_fetch: self._fetch_cache[key] = ret -- cgit v1.2.1