[virt-manager PATCH] diskbackend: make sure path existed before checking vol info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1108922

Signed-off-by: Chen Hanxiao <chenhanxiao@xxxxxxxxxxxxxx>
---
 virtinst/diskbackend.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/virtinst/diskbackend.py b/virtinst/diskbackend.py
index 5f72d00..5725e1f 100644
--- a/virtinst/diskbackend.py
+++ b/virtinst/diskbackend.py
@@ -65,7 +65,8 @@ def check_if_path_managed(conn, path):
     def lookup_vol_by_path():
         try:
             vol = conn.storageVolLookupByPath(path)
-            vol.info()
+            if os.path.exists(vol.path()):
+                vol.info()
             return vol, None
         except libvirt.libvirtError, e:
             if (hasattr(libvirt, "VIR_ERR_NO_STORAGE_VOL")
-- 
1.9.0

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux