Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 54c647bfd5..1cec2edde7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -11724,23 +11724,18 @@ virDomainChrSourceDefParseTCP(virDomainChrSourceDefPtr def,
int mode;
int tmpVal;
g_autofree char *tmp = NULL;
+ virTristateBool haveTLS = VIR_TRISTATE_BOOL_ABSENT;
if ((mode = virDomainChrSourceDefParseMode(source)) < 0)
return -1;
+ if (virXMLPropYesNo(source, "tls", &haveTLS) < 0)
+ return -1;
+
def->data.tcp.listen = mode == VIR_DOMAIN_CHR_SOURCE_MODE_BIND;
def->data.tcp.host = virXMLPropString(source, "host");
def->data.tcp.service = virXMLPropString(source, "service");
-
- if ((tmp = virXMLPropString(source, "tls"))) {
- if ((def->data.tcp.haveTLS = virTristateBoolTypeFromString(tmp)) <= 0) {
- virReportError(VIR_ERR_XML_ERROR,
- _("unknown chardev 'tls' setting
'%s'"),
- tmp);
- return -1;
- }
- VIR_FREE(tmp);
- }
+ def->data.tcp.haveTLS = haveTLS;
if ((flags & VIR_DOMAIN_DEF_PARSE_STATUS) &&
(tmp = virXMLPropString(source, "tlsFromConfig"))) {
--
2.26.2