mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 14:35: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;
|
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 *
|
static const char *
|
||||||
qemuDomainDefaultNetModel(const virDomainDef *def,
|
qemuDomainDefaultNetModel(const virDomainDef *def,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps)
|
||||||
@ -2419,6 +2435,7 @@ virDomainDefParserConfig virQEMUDriverDomainDefParserConfig = {
|
|||||||
.devicesPostParseCallback = qemuDomainDeviceDefPostParse,
|
.devicesPostParseCallback = qemuDomainDeviceDefPostParse,
|
||||||
.domainPostParseCallback = qemuDomainDefPostParse,
|
.domainPostParseCallback = qemuDomainDefPostParse,
|
||||||
.assignAddressesCallback = qemuDomainDefAssignAddresses,
|
.assignAddressesCallback = qemuDomainDefAssignAddresses,
|
||||||
|
.domainValidateCallback = qemuDomainDefValidate,
|
||||||
.features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
|
.features = VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG |
|
||||||
VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN
|
VIR_DOMAIN_DEF_FEATURE_OFFLINE_VCPUPIN
|
||||||
};
|
};
|
||||||
|
@ -4307,13 +4307,6 @@ qemuProcessStartValidateXML(virQEMUDriverPtr driver,
|
|||||||
virDomainDefValidate(vm->def, caps, 0, driver->xmlopt) < 0)
|
virDomainDefValidate(vm->def, caps, 0, driver->xmlopt) < 0)
|
||||||
return -1;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user