[libvirt PATCH 37/38] storage_adapter_conf: Use virXMLProp(OnOff|YesNo) in virStorageAdapterParseXMLFCHost

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/storage_adapter_conf.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_conf.c
index 77ecb8d5f2..96e6c733d0 100644
--- a/src/conf/storage_adapter_conf.c
+++ b/src/conf/storage_adapter_conf.c
@@ -64,26 +64,19 @@ static int
 virStorageAdapterParseXMLFCHost(xmlNodePtr node,
                                 virStorageAdapterFCHostPtr fchost)
 {
-    char *managed = NULL;
+    virTristateBool managed = VIR_TRISTATE_BOOL_ABSENT;
 
-    fchost->parent = virXMLPropString(node, "parent");
-    if ((managed = virXMLPropString(node, "managed"))) {
-        if ((fchost->managed = virTristateBoolTypeFromString(managed)) < 0) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("unknown fc_host managed setting '%s'"),
-                           managed);
-            VIR_FREE(managed);
-            return -1;
-        }
-    }
+    if (virXMLPropYesNo(node, "managed", &managed) < 0)
+        return -1;
 
+    fchost->parent = virXMLPropString(node, "parent");
+    fchost->managed = managed;
     fchost->parent_wwnn = virXMLPropString(node, "parent_wwnn");
     fchost->parent_wwpn = virXMLPropString(node, "parent_wwpn");
     fchost->parent_fabric_wwn = virXMLPropString(node, "parent_fabric_wwn");
     fchost->wwpn = virXMLPropString(node, "wwpn");
     fchost->wwnn = virXMLPropString(node, "wwnn");
 
-    VIR_FREE(managed);
     return 0;
 }
 
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux