提交 e17d1038 编写于 作者: J Jiri Denemark

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: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 fcf4846a
......@@ -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)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册