Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/conf/domain_conf.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 619a4306f6..3409355722 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13044,7 +13044,6 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def, g_autofree char *websocketGenerated = virXMLPropString(node, "websocketGenerated"); g_autofree char *sharePolicy = virXMLPropString(node, "sharePolicy"); g_autofree char *autoport = virXMLPropString(node, "autoport"); - g_autofree char *powerControl = virXMLPropString(node, "powerControl"); xmlNodePtr audioNode; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -13103,15 +13102,9 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def, } } - if (powerControl) { - int powerControlVal = virTristateBoolTypeFromString(powerControl); - if (powerControlVal < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse vnc power control '%s'"), powerControl); - return -1; - } - def->data.vnc.powerControl = powerControlVal; - } + if ((virXMLPropTristateBool(node, "powerControl", false, + &def->data.vnc.powerControl)) < 0) + return -1; def->data.vnc.keymap = virXMLPropString(node, "keymap"); -- 2.26.2