[virt-tools-list] [virt-manager PATCH 1/4] storage: make "target_path" optional

Giuseppe Scrivano gscrivan at redhat.com
Wed Feb 12 12:28:01 UTC 2014


Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 virtManager/createpool.py | 6 ++++--
 virtinst/storage.py       | 5 +++++
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/virtManager/createpool.py b/virtManager/createpool.py
index 0d261c5..17daf2a 100644
--- a/virtManager/createpool.py
+++ b/virtManager/createpool.py
@@ -275,8 +275,10 @@ class vmmCreatePool(vmmGObjectUI):
         show_row("pool-build", buildsens)
         show_row("pool-iqn", iqn)
 
-        self.widget("pool-target-path").get_child().set_text(
-            self._pool.target_path)
+        if tgt:
+            self.widget("pool-target-path").get_child().set_text(
+                self._pool.target_path)
+
         self.widget("pool-target-button").set_sensitive(tgt_b)
         self.widget("pool-source-button").set_sensitive(src_b)
         self.widget("pool-build").set_active(builddef)
diff --git a/virtinst/storage.py b/virtinst/storage.py
index da6427a..559b20a 100644
--- a/virtinst/storage.py
+++ b/virtinst/storage.py
@@ -284,6 +284,8 @@ class StoragePool(_StorageObject):
                                 name))
 
     def _get_default_target_path(self):
+        if not self.supports_property("target_path"):
+            return None
         if (self.type == self.TYPE_DIR or
             self.type == self.TYPE_NETFS or
             self.type == self.TYPE_FS):
@@ -385,6 +387,9 @@ class StoragePool(_StorageObject):
             "host": [self.TYPE_NETFS, self.TYPE_ISCSI],
             "format": [self.TYPE_FS, self.TYPE_NETFS, self.TYPE_DISK],
             "iqn": [self.TYPE_ISCSI],
+            "target_path" : [self.TYPE_DIR, self.TYPE_FS, self.TYPE_NETFS,
+                             self.TYPE_LOGICAL, self.TYPE_DISK, self.TYPE_ISCSI,
+                             self.TYPE_SCSI, self.TYPE_MPATH]
         }
 
         if users.get(propname):
-- 
1.8.5.3




More information about the virt-tools-list mailing list