vmm: conn: Don't abuse path_definitely_exists for pool refreshing

Just catch any errors and continue on
This commit is contained in:
Cole Robinson 2014-12-04 20:38:55 -05:00
parent 6489df83ca
commit 66a8c5d374

View File

@ -553,15 +553,15 @@ class vmmConnection(vmmGObject):
return None
def get_vol_by_path(self, path):
# path_exists will handle stuff like refreshing a busted pool
if not virtinst.VirtualDisk.path_definitely_exists(self.get_backend(),
path):
return None
for pool in self._pools.values():
for vol in pool.get_volumes().values():
if vol.get_target_path() == path:
return vol
try:
if vol.get_target_path() == path:
return vol
except Exception, e:
# Errors can happen if the volume disappeared, bug 1092739
logging.debug("Error looking up volume from path=%s: %s",
path, e)
return None