mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
qemu: Move check that validates 'min_guarantee' to qemuDomainDefValidate
Introduce a validation callback for qemu and move checking of min_guarantee to the new callback.
This commit is contained in:
parent
18f1dda390
commit
5972f185e1
@ -2168,6 +2168,22 @@ qemuDomainDefPostParse(virDomainDefPtr def,
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainDefValidate(const virDomainDef *def,
|
||||
virCapsPtr caps ATTRIBUTE_UNUSED,
|
||||
void *opaque ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (def->mem.min_guarantee) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Parameter 'min_guarantee' not supported by QEMU."));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
qemuDomainDefaultNetModel(const virDomainDef *def,
|
||||
virQEMUCapsPtr qemuCaps)
|
||||
@ -2419,6 +2435,7 @@ virDomainDefParserConfig virQEMUDriverDomainDefParserConfig = {
|
||||
.devicesPostParseCallback = qemuDomainDeviceDefPostParse,
|
||||
.domainPostParseCallback = qemuDomainDefPostParse,
|
||||
.assignAddressesCallback = qemuDomainDefAssignAddresses,
|
||||
.domainValidateCallback = qemuDomainDefValidate,
|
||||
.features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
|
||||
VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN
|
||||
};
|
||||
|
@ -4307,13 +4307,6 @@ qemuProcessStartValidateXML(virQEMUDriverPtr driver,
|
||||
virDomainDefValidate(vm->def, caps, 0, driver->xmlopt) < 0)
|
||||
return -1;
|
||||
|
||||
if (vm->def->mem.min_guarantee) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Parameter 'min_guarantee' "
|
||||
"not supported by QEMU."));
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user