Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/conf/domain_conf.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3409355722..c6c78abb84 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13140,10 +13140,8 @@ virDomainGraphicsDefParseXMLSDL(virDomainGraphicsDefPtr def,
xmlXPathContextPtr ctxt)
{
VIR_XPATH_NODE_AUTORESTORE(ctxt)
- int enableVal;
xmlNodePtr glNode;
g_autofree char *fullscreen = virXMLPropString(node, "fullscreen");
- g_autofree char *enable = NULL;
ctxt->node = node;
@@ -13162,20 +13160,14 @@ virDomainGraphicsDefParseXMLSDL(virDomainGraphicsDefPtr def,
glNode = virXPathNode("./gl", ctxt);
if (glNode) {
- enable = virXMLPropString(glNode, "enable");
- if (!enable) {
- virReportError(VIR_ERR_XML_ERROR, "%s",
- _("sdl gl element missing enable"));
+ if (virXMLPropTristateBool(glNode, "enable", false,
&def->data.sdl.gl) < 0)
return -1;
- }
- enableVal = virTristateBoolTypeFromString(enable);
- if (enableVal < 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown enable value '%s'"), enable);
+ if (def->data.sdl.gl == VIR_TRISTATE_BOOL_ABSENT) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("sdl gl element missing enable"));
return -1;
}
- def->data.sdl.gl = enableVal;
}
return 0;
--
2.26.2