mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 04:55:18 +00:00
virDomainChrSourceDefParseFile: Use virXMLProp*
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
c348da7c4c
commit
fcc563a29b
@ -11695,20 +11695,11 @@ static int
|
|||||||
virDomainChrSourceDefParseFile(virDomainChrSourceDef *def,
|
virDomainChrSourceDefParseFile(virDomainChrSourceDef *def,
|
||||||
xmlNodePtr source)
|
xmlNodePtr source)
|
||||||
{
|
{
|
||||||
g_autofree char *append = NULL;
|
|
||||||
|
|
||||||
def->data.file.path = virXMLPropString(source, "path");
|
def->data.file.path = virXMLPropString(source, "path");
|
||||||
|
|
||||||
if ((append = virXMLPropString(source, "append"))) {
|
if (virXMLPropTristateSwitch(source, "append", VIR_XML_PROP_NONE,
|
||||||
int value;
|
&def->data.file.append) < 0)
|
||||||
if ((value = virTristateSwitchTypeFromString(append)) <= 0) {
|
return -1;
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("Invalid append attribute value '%s'"),
|
|
||||||
append);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
def->data.file.append = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user