Subject: vmm connection: Handle missing storage volumes (bz 1070883) From: Cole Robinson crobinso@redhat.com Thu Feb 27 13:16:21 2014 -0500 Date: Thu Feb 27 13:16:21 2014 -0500: Git: f67df117017e6de855a8c0e900e47fe920dfaa48 Similar to what was done in a808bd669293ac66047a716b2e84a5a64c99667b for the virtinst connection wrapper. diff --git a/virtManager/connection.py b/virtManager/connection.py index 6f6c838..96dfa1c 100644 --- a/virtManager/connection.py +++ b/virtManager/connection.py @@ -172,10 +172,17 @@ class vmmConnection(vmmGObject): self._backend.cb_fetch_all_pools = ( lambda: [obj.get_xmlobj(refresh_if_nec=False) for obj in self.pools.values()]) - self._backend.cb_fetch_all_vols = ( - lambda: [obj.get_xmlobj(refresh_if_nec=False) - for pool in self.pools.values() - for obj in pool.get_volumes(refresh=False).values()]) + + def fetch_all_vols(): + ret = [] + for pool in self.pools.values(): + for vol in pool.get_volumes(refresh=False).values(): + try: + ret.append(vol.get_xmlobj(refresh_if_nec=False)) + except libvirt.libvirtError, e: + logging.debug("Fetching volume XML failed: %s", e) + return ret + self._backend.cb_fetch_all_vols = fetch_all_vols def clear_cache(pools=False): if not pools: