[virt-manager PATCH 4/6] virtManager.clone: don't generate clone path if we don't default to clone

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

 



If we don't default to clone the disk in question don't try to generate
and assign default clone_path, this will force user to select the path
explicitly and avoid some unnecessary errors in debug log.

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 virtManager/clone.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/virtManager/clone.py b/virtManager/clone.py
index 0704b21a..0fa74e6f 100644
--- a/virtManager/clone.py
+++ b/virtManager/clone.py
@@ -407,6 +407,13 @@ class vmmCloneVM(vmmGObjectUI):
                 storage_add(cloneinfo)
                 continue
 
+            storage_row[STORAGE_INFO_CAN_CLONE] = True
+
+            # If we cannot create default clone_path don't even try to do that
+            if not default:
+                storage_add()
+                continue
+
             try:
                 # Generate disk path, make sure that works
                 clone_path = self.generate_clone_path_name(path)
@@ -421,7 +428,6 @@ class vmmCloneVM(vmmGObjectUI):
                                   clone_path)
                 storage_add(str(e))
 
-            storage_row[STORAGE_INFO_CAN_CLONE] = True
             storage_row[STORAGE_INFO_NEW_PATH] = clone_path
             storage_row[STORAGE_INFO_SIZE] = self.pretty_storage(size)
             storage_add()
-- 
2.12.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