virDomainChrSourceDefParseLog: Use virXMLProp*

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-21 15:33:28 +02:00 committed by Peter Krempa
parent fcc563a29b
commit 97cdb5be1e

View File

@ -11730,20 +11730,11 @@ static int
virDomainChrSourceDefParseLog(virDomainChrSourceDef *def,
xmlNodePtr log)
{
g_autofree char *append = NULL;
def->logfile = virXMLPropString(log, "file");
if ((append = virXMLPropString(log, "append"))) {
int value;
if ((value = virTristateSwitchTypeFromString(append)) <= 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Invalid append attribute value '%s'"),
append);
if (virXMLPropTristateSwitch(log, "append", VIR_XML_PROP_NONE,
&def->logappend) < 0)
return -1;
}
def->logappend = value;
}
return 0;
}