mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
vmm connection: Handle missing storage volumes (bz 1070883)
Similar to what was done in a808bd6692
for the virtinst connection wrapper.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user