virDomainChrSourceDefParseFile: 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:27 +02:00 committed by Peter Krempa
parent c348da7c4c
commit fcc563a29b

View File

@ -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;
}