conf: Use virTristateXXX in virStorageSource

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-07 13:48:28 +02:00 committed by Peter Krempa
parent a0491637e1
commit c33c482df4
2 changed files with 9 additions and 5 deletions

View 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) &&

View 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 */