mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
conf: numa: Reformat virDomainNumatuneParseXML
Collapse few of the conditions so that the program flow is more clear.
This commit is contained in:
parent
60a2ce4962
commit
67bd807c4d
@ -245,32 +245,24 @@ virDomainNumatuneParseXML(virDomainNumaPtr *numatunePtr,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
tmp = virXMLPropString(node, "mode");
|
||||
if (tmp) {
|
||||
mode = virDomainNumatuneMemModeTypeFromString(tmp);
|
||||
if (mode < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported NUMA memory tuning mode '%s'"),
|
||||
tmp);
|
||||
goto cleanup;
|
||||
}
|
||||
if ((tmp = virXMLPropString(node, "mode")) &&
|
||||
(mode = virDomainNumatuneMemModeTypeFromString(tmp)) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported NUMA memory tuning mode '%s'"), tmp);
|
||||
goto cleanup;
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
|
||||
tmp = virXMLPropString(node, "placement");
|
||||
if (tmp) {
|
||||
placement = virDomainNumatunePlacementTypeFromString(tmp);
|
||||
if (placement < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported NUMA memory placement mode '%s'"),
|
||||
tmp);
|
||||
goto cleanup;
|
||||
}
|
||||
if ((tmp = virXMLPropString(node, "placement")) &&
|
||||
(placement = virDomainNumatunePlacementTypeFromString(tmp)) < 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported NUMA memory placement mode '%s'"), tmp);
|
||||
goto cleanup;
|
||||
}
|
||||
VIR_FREE(tmp);
|
||||
|
||||
tmp = virXMLPropString(node, "nodeset");
|
||||
if (tmp && virBitmapParse(tmp, 0, &nodeset, VIR_DOMAIN_CPUMASK_LEN) < 0)
|
||||
if ((tmp = virXMLPropString(node, "nodeset")) &&
|
||||
virBitmapParse(tmp, 0, &nodeset, VIR_DOMAIN_CPUMASK_LEN) < 0)
|
||||
goto cleanup;
|
||||
VIR_FREE(tmp);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user