]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Use virTristateXXX in virStorageSource
authorTim Wiederhake <twiederh@redhat.com>
Wed, 7 Apr 2021 11:48:28 +0000 (13:48 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 16 Apr 2021 07:48:41 +0000 (09:48 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_conf.c
src/conf/storage_source_conf.h

index 029f2d8d9c574b1c93b7effb1d2fa519205339dd..1bee0c78ab3ad6e40f024009e54839961581a8a2 100644 (file)
@@ -8352,11 +8352,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) &&
index b388cb54977185c47d37629264d9659295494fb3..6f9dae2d6635033a700b9c16294121825cffbb6f 100644 (file)
@@ -345,7 +345,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 */