提交 67bd807c 编写于 作者: P Peter Krempa

conf: numa: Reformat virDomainNumatuneParseXML

Collapse few of the conditions so that the program flow is more clear.
上级 60a2ce49
...@@ -245,32 +245,24 @@ virDomainNumatuneParseXML(virDomainNumaPtr *numatunePtr, ...@@ -245,32 +245,24 @@ virDomainNumatuneParseXML(virDomainNumaPtr *numatunePtr,
goto cleanup; goto cleanup;
} }
tmp = virXMLPropString(node, "mode"); if ((tmp = virXMLPropString(node, "mode")) &&
if (tmp) { (mode = virDomainNumatuneMemModeTypeFromString(tmp)) < 0) {
mode = virDomainNumatuneMemModeTypeFromString(tmp); virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
if (mode < 0) { _("Unsupported NUMA memory tuning mode '%s'"), tmp);
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, goto cleanup;
_("Unsupported NUMA memory tuning mode '%s'"),
tmp);
goto cleanup;
}
} }
VIR_FREE(tmp); VIR_FREE(tmp);
tmp = virXMLPropString(node, "placement"); if ((tmp = virXMLPropString(node, "placement")) &&
if (tmp) { (placement = virDomainNumatunePlacementTypeFromString(tmp)) < 0) {
placement = virDomainNumatunePlacementTypeFromString(tmp); virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
if (placement < 0) { _("Unsupported NUMA memory placement mode '%s'"), tmp);
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, goto cleanup;
_("Unsupported NUMA memory placement mode '%s'"),
tmp);
goto cleanup;
}
} }
VIR_FREE(tmp); VIR_FREE(tmp);
tmp = virXMLPropString(node, "nodeset"); if ((tmp = virXMLPropString(node, "nodeset")) &&
if (tmp && virBitmapParse(tmp, 0, &nodeset, VIR_DOMAIN_CPUMASK_LEN) < 0) virBitmapParse(tmp, 0, &nodeset, VIR_DOMAIN_CPUMASK_LEN) < 0)
goto cleanup; goto cleanup;
VIR_FREE(tmp); VIR_FREE(tmp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册