|
|
860ffc |
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
|
|
|
860ffc |
Date: Wed, 11 May 2016 11:57:33 +0200
|
|
|
860ffc |
Subject: [PATCH] Move virDomainDefPostParseInternal after
|
|
|
860ffc |
virDomainDeviceDefPostParse
|
|
|
860ffc |
|
|
|
860ffc |
Future commit will call DeviceDefPostParse on a device auto-added
|
|
|
860ffc |
in DomainDefPostParse.
|
|
|
860ffc |
|
|
|
860ffc |
(cherry picked from commit e4d131b8cb12679814b6fda159281f472b615524)
|
|
|
860ffc |
---
|
|
|
860ffc |
src/conf/domain_conf.c | 78 +++++++++++++++++++++++++-------------------------
|
|
|
860ffc |
1 file changed, 39 insertions(+), 39 deletions(-)
|
|
|
860ffc |
|
|
|
860ffc |
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
|
860ffc |
index d93d981..e9206f9 100644
|
|
|
860ffc |
--- a/src/conf/domain_conf.c
|
|
|
860ffc |
+++ b/src/conf/domain_conf.c
|
|
|
860ffc |
@@ -3905,45 +3905,6 @@ virDomainDefPostParseTimer(virDomainDefPtr def)
|
|
|
860ffc |
}
|
|
|
860ffc |
|
|
|
860ffc |
|
|
|
860ffc |
-static int
|
|
|
860ffc |
-virDomainDefPostParseInternal(virDomainDefPtr def,
|
|
|
860ffc |
- virCapsPtr caps ATTRIBUTE_UNUSED,
|
|
|
860ffc |
- unsigned int parseFlags)
|
|
|
860ffc |
-{
|
|
|
860ffc |
- /* verify init path for container based domains */
|
|
|
860ffc |
- if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
|
|
|
860ffc |
- virReportError(VIR_ERR_XML_ERROR, "%s",
|
|
|
860ffc |
- _("init binary must be specified"));
|
|
|
860ffc |
- return -1;
|
|
|
860ffc |
- }
|
|
|
860ffc |
-
|
|
|
860ffc |
- if (virDomainDefPostParseMemory(def, parseFlags) < 0)
|
|
|
860ffc |
- return -1;
|
|
|
860ffc |
-
|
|
|
860ffc |
- if (virDomainDefRejectDuplicateControllers(def) < 0)
|
|
|
860ffc |
- return -1;
|
|
|
860ffc |
-
|
|
|
860ffc |
- if (virDomainDefRejectDuplicatePanics(def) < 0)
|
|
|
860ffc |
- return -1;
|
|
|
860ffc |
-
|
|
|
860ffc |
- if (virDomainDefPostParseTimer(def) < 0)
|
|
|
860ffc |
- return -1;
|
|
|
860ffc |
-
|
|
|
860ffc |
- if (virDomainDefAddImplicitDevices(def) < 0)
|
|
|
860ffc |
- return -1;
|
|
|
860ffc |
-
|
|
|
860ffc |
- /* Mark the first video as primary. If the user specified primary="yes",
|
|
|
860ffc |
- * the parser already inserted the device at def->videos[0] */
|
|
|
860ffc |
- if (def->nvideos != 0)
|
|
|
860ffc |
- def->videos[0]->primary = true;
|
|
|
860ffc |
-
|
|
|
860ffc |
- /* clean up possibly duplicated metadata entries */
|
|
|
860ffc |
- virDomainDefMetadataSanitize(def);
|
|
|
860ffc |
-
|
|
|
860ffc |
- return 0;
|
|
|
860ffc |
-}
|
|
|
860ffc |
-
|
|
|
860ffc |
-
|
|
|
860ffc |
/* Check if a drive type address $controller:$bus:$target:$unit is already
|
|
|
860ffc |
* taken by a disk or not.
|
|
|
860ffc |
*/
|
|
|
860ffc |
@@ -4358,6 +4319,45 @@ virDomainDefPostParseDeviceIterator(virDomainDefPtr def ATTRIBUTE_UNUSED,
|
|
|
860ffc |
}
|
|
|
860ffc |
|
|
|
860ffc |
|
|
|
860ffc |
+static int
|
|
|
860ffc |
+virDomainDefPostParseInternal(virDomainDefPtr def,
|
|
|
860ffc |
+ virCapsPtr caps ATTRIBUTE_UNUSED,
|
|
|
860ffc |
+ unsigned int parseFlags)
|
|
|
860ffc |
+{
|
|
|
860ffc |
+ /* verify init path for container based domains */
|
|
|
860ffc |
+ if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
|
|
|
860ffc |
+ virReportError(VIR_ERR_XML_ERROR, "%s",
|
|
|
860ffc |
+ _("init binary must be specified"));
|
|
|
860ffc |
+ return -1;
|
|
|
860ffc |
+ }
|
|
|
860ffc |
+
|
|
|
860ffc |
+ if (virDomainDefPostParseMemory(def, parseFlags) < 0)
|
|
|
860ffc |
+ return -1;
|
|
|
860ffc |
+
|
|
|
860ffc |
+ if (virDomainDefRejectDuplicateControllers(def) < 0)
|
|
|
860ffc |
+ return -1;
|
|
|
860ffc |
+
|
|
|
860ffc |
+ if (virDomainDefRejectDuplicatePanics(def) < 0)
|
|
|
860ffc |
+ return -1;
|
|
|
860ffc |
+
|
|
|
860ffc |
+ if (virDomainDefPostParseTimer(def) < 0)
|
|
|
860ffc |
+ return -1;
|
|
|
860ffc |
+
|
|
|
860ffc |
+ if (virDomainDefAddImplicitDevices(def) < 0)
|
|
|
860ffc |
+ return -1;
|
|
|
860ffc |
+
|
|
|
860ffc |
+ /* Mark the first video as primary. If the user specified primary="yes",
|
|
|
860ffc |
+ * the parser already inserted the device at def->videos[0] */
|
|
|
860ffc |
+ if (def->nvideos != 0)
|
|
|
860ffc |
+ def->videos[0]->primary = true;
|
|
|
860ffc |
+
|
|
|
860ffc |
+ /* clean up possibly duplicated metadata entries */
|
|
|
860ffc |
+ virDomainDefMetadataSanitize(def);
|
|
|
860ffc |
+
|
|
|
860ffc |
+ return 0;
|
|
|
860ffc |
+}
|
|
|
860ffc |
+
|
|
|
860ffc |
+
|
|
|
860ffc |
int
|
|
|
860ffc |
virDomainDefPostParse(virDomainDefPtr def,
|
|
|
860ffc |
virCapsPtr caps,
|