mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Move virDomainDefPostParseInternal after virDomainDeviceDefPostParse
Future commit will call DeviceDefPostParse on a device auto-added
in DomainDefPostParse.
(cherry picked from commit e4d131b8cb
)
This commit is contained in:
parent
d460558ea8
commit
2b574dcabf
@ -3899,45 +3899,6 @@ virDomainDefPostParseTimer(virDomainDefPtr def)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
virDomainDefPostParseInternal(virDomainDefPtr def,
|
||||
virCapsPtr caps ATTRIBUTE_UNUSED,
|
||||
unsigned int parseFlags)
|
||||
{
|
||||
/* 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, parseFlags) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefRejectDuplicateControllers(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefRejectDuplicatePanics(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefPostParseTimer(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefAddImplicitDevices(def) < 0)
|
||||
return -1;
|
||||
|
||||
/* Mark the first video as primary. If the user specified primary="yes",
|
||||
* the parser already inserted the device at def->videos[0] */
|
||||
if (def->nvideos != 0)
|
||||
def->videos[0]->primary = true;
|
||||
|
||||
/* clean up possibly duplicated metadata entries */
|
||||
virDomainDefMetadataSanitize(def);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Check if a drive type address $controller:$bus:$target:$unit is already
|
||||
* taken by a disk or not.
|
||||
*/
|
||||
@ -4352,6 +4313,45 @@ virDomainDefPostParseDeviceIterator(virDomainDefPtr def ATTRIBUTE_UNUSED,
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
virDomainDefPostParseInternal(virDomainDefPtr def,
|
||||
virCapsPtr caps ATTRIBUTE_UNUSED,
|
||||
unsigned int parseFlags)
|
||||
{
|
||||
/* 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, parseFlags) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefRejectDuplicateControllers(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefRejectDuplicatePanics(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefPostParseTimer(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefAddImplicitDevices(def) < 0)
|
||||
return -1;
|
||||
|
||||
/* Mark the first video as primary. If the user specified primary="yes",
|
||||
* the parser already inserted the device at def->videos[0] */
|
||||
if (def->nvideos != 0)
|
||||
def->videos[0]->primary = true;
|
||||
|
||||
/* clean up possibly duplicated metadata entries */
|
||||
virDomainDefMetadataSanitize(def);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
virDomainDefPostParse(virDomainDefPtr def,
|
||||
virCapsPtr caps,
|
||||
|
Loading…
Reference in New Issue
Block a user