mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
domain: separate out function for post parse timer validation
This should be a no-op
This commit is contained in:
parent
11de45bb71
commit
ee719cdcca
@ -3767,31 +3767,10 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def)
|
||||
|
||||
|
||||
static int
|
||||
virDomainDefPostParseInternal(virDomainDefPtr def,
|
||||
virCapsPtr caps ATTRIBUTE_UNUSED,
|
||||
unsigned int parseFlags)
|
||||
virDomainDefPostParseTimer(virDomainDefPtr def)
|
||||
{
|
||||
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, parseFlags) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefAddConsoleCompat(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefRejectDuplicateControllers(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefRejectDuplicatePanics(def) < 0)
|
||||
return -1;
|
||||
|
||||
/* verify settings of guest timers */
|
||||
for (i = 0; i < def->clock.ntimers; i++) {
|
||||
virDomainTimerDefPtr timer = def->clock.timers[i];
|
||||
@ -3847,6 +3826,37 @@ virDomainDefPostParseInternal(virDomainDefPtr def,
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
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 (virDomainDefAddConsoleCompat(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefRejectDuplicateControllers(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefRejectDuplicatePanics(def) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainDefPostParseTimer(def) < 0)
|
||||
return -1;
|
||||
|
||||
/* clean up possibly duplicated metadata entries */
|
||||
virDomainDefMetadataSanitize(def);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user