From: Tim Wiederhake Date: Wed, 7 Apr 2021 11:48:28 +0000 (+0200) Subject: conf: Use virTristateXXX in virStorageSource X-Git-Tag: v7.3.0-rc1~213 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c33c482df436ee34d610604fe4c4ad74f467cf4f;p=thirdparty%2Flibvirt.git conf: Use virTristateXXX in virStorageSource Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 029f2d8d9c..1bee0c78ab 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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) && diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index b388cb5497..6f9dae2d66 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -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 */