提交 849b5fc4 编写于 作者: P Peter Krempa

conf: Split memory related post parse stuff into separate function

The post parse func is growing rather large. Since later patches will
introduce more logic in the memory post parse code, split it into a
separate handler.
上级 59173c3d
...@@ -3726,18 +3726,8 @@ virDomainDefRemoveDuplicateMetadata(virDomainDefPtr def) ...@@ -3726,18 +3726,8 @@ virDomainDefRemoveDuplicateMetadata(virDomainDefPtr def)
static int static int
virDomainDefPostParseInternal(virDomainDefPtr def, virDomainDefPostParseMemory(virDomainDefPtr def)
virCapsPtr caps ATTRIBUTE_UNUSED)
{ {
size_t i;
/* verify init path for container based domains */
if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("init binary must be specified"));
return -1;
}
if (virDomainDefGetMemoryInitial(def) == 0) { if (virDomainDefGetMemoryInitial(def) == 0) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("Memory size must be specified via <memory> or in the " _("Memory size must be specified via <memory> or in the "
...@@ -3765,6 +3755,26 @@ virDomainDefPostParseInternal(virDomainDefPtr def, ...@@ -3765,6 +3755,26 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
return -1; return -1;
} }
return 0;
}
static int
virDomainDefPostParseInternal(virDomainDefPtr def,
virCapsPtr caps ATTRIBUTE_UNUSED)
{
size_t i;
/* verify init path for container based domains */
if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
virReportError(VIR_ERR_XML_ERROR, "%s",
_("init binary must be specified"));
return -1;
}
if (virDomainDefPostParseMemory(def) < 0)
return -1;
/* /*
* Some really crazy backcompat stuff for consoles * Some really crazy backcompat stuff for consoles
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册