Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- 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 756a35f33b..011745e73a 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13172,10 +13172,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; @@ -13194,20 +13192,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 (virXMLPropYesNo(glNode, "enable", &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