Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/conf/domain_conf.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1cec2edde7..d9330f9ee7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -11808,17 +11808,13 @@ static int virDomainChrSourceDefParseFile(virDomainChrSourceDefPtr def, xmlNodePtr source) { - g_autofree char *append = NULL; - - def->data.file.path = virXMLPropString(source, "path"); + virTristateSwitch append = VIR_TRISTATE_SWITCH_ABSENT; - if ((append = virXMLPropString(source, "append")) && - (def->data.file.append = virTristateSwitchTypeFromString(append)) <= 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("Invalid append attribute value '%s'"), - append); + if (virXMLPropOnOff(source, "append", &append) < 0) return -1; - } + + def->data.file.path = virXMLPropString(source, "path"); + def->data.file.append = append; return 0; } -- 2.26.2