mirror of
https://github.com/virt-manager/virt-manager.git
synced 2026-07-29 15:55:32 -05:00
connection: Call path_exists before getting storage volume (bz 1092739)
path_exists will check to ensure the volume actually survives a pool refresh, incase it was deleted behind libvirt's back. This makes the delete dialog happier at least.
This commit is contained in:
@@ -750,6 +750,10 @@ class vmmConnection(vmmGObject):
|
||||
return self.get_pool_by_name("default")
|
||||
|
||||
def get_vol_by_path(self, path):
|
||||
# path_exists will handle stuff like refreshing a busted pool
|
||||
if not virtinst.VirtualDisk.path_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:
|
||||
|
||||
Reference in New Issue
Block a user