The new name is virCPUModelIsAllowed.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
return data;
}
+
+/** virCPUModelIsAllowed:
+ *
+ * @model: CPU model to be checked
+ * @models: list of supported CPU models
+ * @nmodels: number of models in @models
+ *
+ * Checks whether @model can be found in the list of supported @models.
+ * If @models is empty, all models are supported.
+ *
+ * Returns true if @model is supported, false otherwise.
+ */
bool
-cpuModelIsAllowed(const char *model,
- const char **models,
- unsigned int nmodels)
+virCPUModelIsAllowed(const char *model,
+ const char **models,
+ unsigned int nmodels)
{
size_t i;
return false;
}
+
/**
* virCPUGetModels:
*
cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH)
return 0;
- if (cpuModelIsAllowed(cpu->model, (const char **) models, nmodels))
+ if (virCPUModelIsAllowed(cpu->model, (const char **) models, nmodels))
return 0;
if (cpu->fallback != VIR_CPU_FALLBACK_ALLOW) {
bool
-cpuModelIsAllowed(const char *model,
- const char **models,
- unsigned int nmodels)
+virCPUModelIsAllowed(const char *model,
+ const char **models,
+ unsigned int nmodels)
ATTRIBUTE_NONNULL(1);
int
goto cleanup;
}
- if (!cpuModelIsAllowed(model->name, models, nmodels)) {
+ if (!virCPUModelIsAllowed(model->name, models, nmodels)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("CPU model %s is not supported by hypervisor"),
model->name);
*/
for (i = map->nmodels - 1; i >= 0; i--) {
candidate = map->models[i];
- if (!cpuModelIsAllowed(candidate->name, models, nmodels)) {
+ if (!virCPUModelIsAllowed(candidate->name, models, nmodels)) {
if (preferred && STREQ(candidate->name, preferred)) {
if (cpu->fallback != VIR_CPU_FALLBACK_ALLOW) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,