mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
conf: Use virTristateXXX in virDomainMemballoonDef
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
108ec08b1b
commit
f940ec5f36
@ -14569,18 +14569,24 @@ virDomainMemballoonDefParseXML(virDomainXMLOption *xmlopt,
|
||||
goto error;
|
||||
}
|
||||
|
||||
if ((deflate = virXMLPropString(node, "autodeflate")) &&
|
||||
(def->autodeflate = virTristateSwitchTypeFromString(deflate)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("invalid autodeflate attribute value '%s'"), deflate);
|
||||
goto error;
|
||||
if ((deflate = virXMLPropString(node, "autodeflate"))) {
|
||||
int value;
|
||||
if ((value = virTristateSwitchTypeFromString(deflate)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("invalid autodeflate attribute value '%s'"), deflate);
|
||||
goto error;
|
||||
}
|
||||
def->autodeflate = value;
|
||||
}
|
||||
|
||||
if ((freepage_reporting = virXMLPropString(node, "freePageReporting")) &&
|
||||
(def->free_page_reporting = virTristateSwitchTypeFromString(freepage_reporting)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("invalid freePageReporting attribute value '%s'"), freepage_reporting);
|
||||
goto error;
|
||||
if ((freepage_reporting = virXMLPropString(node, "freePageReporting"))) {
|
||||
int value;
|
||||
if ((value = virTristateSwitchTypeFromString(freepage_reporting)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("invalid freePageReporting attribute value '%s'"), freepage_reporting);
|
||||
goto error;
|
||||
}
|
||||
def->free_page_reporting = value;
|
||||
}
|
||||
|
||||
ctxt->node = node;
|
||||
|
@ -1915,8 +1915,8 @@ struct _virDomainMemballoonDef {
|
||||
int model;
|
||||
virDomainDeviceInfo info;
|
||||
int period; /* seconds between collections */
|
||||
int autodeflate; /* enum virTristateSwitch */
|
||||
int free_page_reporting; /* enum virTristateSwitch */
|
||||
virTristateSwitch autodeflate;
|
||||
virTristateSwitch free_page_reporting;
|
||||
virDomainVirtioOptions *virtio;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user