From c33c482df436ee34d610604fe4c4ad74f467cf4f Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Wed, 7 Apr 2021 13:48:28 +0200 Subject: [PATCH] conf: Use virTristateXXX in virStorageSource Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- 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 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 */ -- 2.47.2