[libvirt PATCH 01/14] conf: Use virTristateXXX in virStorageSource

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/domain_conf.c         | 12 ++++++++----
 src/conf/storage_source_conf.h |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 1e72171586..b8f6c3d606 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8340,11 +8340,15 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node,
         return -1;
     }
 
-    if ((haveTLS = virXMLPropString(node, "tls")) &&
-        (src->haveTLS = virTristateBoolTypeFromString(haveTLS)) <= 0) {
-        virReportError(VIR_ERR_XML_ERROR,
-                   _("unknown disk source 'tls' setting '%s'"), haveTLS);
+    if ((haveTLS = virXMLPropString(node, "tls"))) {
+        int value;
+
+        if ((value = virTristateBoolTypeFromString(haveTLS)) <= 0) {
+            virReportError(VIR_ERR_XML_ERROR,
+                           _("unknown disk source 'tls' setting '%s'"), haveTLS);
             return -1;
+        }
+        src->haveTLS = value;
     }
 
     if ((flags & VIR_DOMAIN_DEF_PARSE_STATUS) &&
diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h
index f42bb1c67d..e6702a1ffc 100644
--- a/src/conf/storage_source_conf.h
+++ b/src/conf/storage_source_conf.h
@@ -356,7 +356,7 @@ struct _virStorageSource {
     char *nodestorage; /* name of the storage object */
 
     /* An optional setting to enable usage of TLS for the storage source */
-    int haveTLS; /* enum virTristateBool */
+    virTristateBool haveTLS;
 
     /* Indication whether the haveTLS value was altered due to qemu.conf
      * setting when haveTLS is missing from the domain config file */
-- 
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