cpu_x86: Move *CheckFeature functions

They are static and we will need to call them a little bit closer to the
beginning of the file.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Jiri Denemark 2019-03-22 16:44:21 +01:00
parent fcf4846a6b
commit e17d10386b

View File

@ -2707,6 +2707,41 @@ cpuidSet(uint32_t base, virCPUDataPtr data)
}
static int
virCPUx86CheckFeature(const virCPUDef *cpu,
const char *name)
{
int ret = -1;
virCPUx86MapPtr map;
virCPUx86ModelPtr model = NULL;
if (!(map = virCPUx86GetMap()))
return -1;
if (!(model = x86ModelFromCPU(cpu, map, -1)))
goto cleanup;
ret = x86FeatureInData(name, &model->data, map);
cleanup:
x86ModelFree(model);
return ret;
}
static int
virCPUx86DataCheckFeature(const virCPUData *data,
const char *name)
{
virCPUx86MapPtr map;
if (!(map = virCPUx86GetMap()))
return -1;
return x86FeatureInData(name, &data->data.x86, map);
}
static int
virCPUx86GetHost(virCPUDefPtr cpu,
virDomainCapsCPUModelsPtr models)
@ -3063,40 +3098,6 @@ virCPUx86UpdateLive(virCPUDefPtr cpu,
}
static int
virCPUx86CheckFeature(const virCPUDef *cpu,
const char *name)
{
int ret = -1;
virCPUx86MapPtr map;
virCPUx86ModelPtr model = NULL;
if (!(map = virCPUx86GetMap()))
return -1;
if (!(model = x86ModelFromCPU(cpu, map, -1)))
goto cleanup;
ret = x86FeatureInData(name, &model->data, map);
cleanup:
x86ModelFree(model);
return ret;
}
static int
virCPUx86DataCheckFeature(const virCPUData *data,
const char *name)
{
virCPUx86MapPtr map;
if (!(map = virCPUx86GetMap()))
return -1;
return x86FeatureInData(name, &data->data.x86, map);
}
static int
virCPUx86GetModels(char ***models)
{