From: Tim Wiederhake Date: Wed, 21 Apr 2021 13:33:27 +0000 (+0200) Subject: virDomainChrSourceDefParseFile: Use virXMLProp* X-Git-Tag: v7.3.0-rc1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fcc563a29bd91bd2a45b8f242eccaf37ab75b5b3;p=thirdparty%2Flibvirt.git virDomainChrSourceDefParseFile: Use virXMLProp* Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d04c4e3074..88d6800365 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11695,20 +11695,11 @@ static int virDomainChrSourceDefParseFile(virDomainChrSourceDef *def, xmlNodePtr source) { - g_autofree char *append = NULL; - def->data.file.path = virXMLPropString(source, "path"); - if ((append = virXMLPropString(source, "append"))) { - int value; - if ((value = virTristateSwitchTypeFromString(append)) <= 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid append attribute value '%s'"), - append); - return -1; - } - def->data.file.append = value; - } + if (virXMLPropTristateSwitch(source, "append", VIR_XML_PROP_NONE, + &def->data.file.append) < 0) + return -1; return 0; }