virt-manager/53615662-call-path_exists-before-getting-storage-volume.patch

25 lines
1.1 KiB
Diff
Raw Normal View History

Subject: connection: Call path_exists before getting storage volume (bz 1092739)
From: Cole Robinson crobinso@redhat.com Wed Apr 30 16:00:34 2014 -0400
Date: Wed Apr 30 16:00:34 2014 -0400:
Git: 5c28a00d3e28ba7446f323a31ac47a194eb200b1
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.
Index: virt-manager-1.0.1/virtManager/connection.py
===================================================================
--- virt-manager-1.0.1.orig/virtManager/connection.py
+++ virt-manager-1.0.1/virtManager/connection.py
@@ -751,6 +751,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: