mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 01:04:59 +00:00
virDomainBackupDiskDefParseXML: Fill default backup state after parsing it
Set the backup mode to VIR_TRISTATE_BOOL_YES after virXMLPropTristateBool left it set to VIR_TRISTATE_BOOL_ABSENT. This will allow fixing virXMLPropTristateBool to always initialize @result. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
23fdb5e3db
commit
46e6542a92
@ -121,12 +121,13 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
def->backup = VIR_TRISTATE_BOOL_YES;
|
|
||||||
|
|
||||||
if (virXMLPropTristateBool(node, "backup", VIR_XML_PROP_NONE,
|
if (virXMLPropTristateBool(node, "backup", VIR_XML_PROP_NONE,
|
||||||
&def->backup) < 0)
|
&def->backup) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
if (def->backup == VIR_TRISTATE_BOOL_ABSENT)
|
||||||
|
def->backup = VIR_TRISTATE_BOOL_YES;
|
||||||
|
|
||||||
/* don't parse anything else if backup is disabled */
|
/* don't parse anything else if backup is disabled */
|
||||||
if (def->backup == VIR_TRISTATE_BOOL_NO)
|
if (def->backup == VIR_TRISTATE_BOOL_NO)
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user