mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cpu_x86: Fix placement of *CheckFeature functions
In e17d10386
these functions were mistakenly moved into an #ifdef
block, but remained used outside of it leaving the build broken
for platforms where #ifdef evaluated to false.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
ae3d812b00
commit
0a97486e09
@ -2707,6 +2707,35 @@ cpuidSet(uint32_t base, virCPUDataPtr data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
virCPUx86GetHost(virCPUDefPtr cpu,
|
||||||
|
virDomainCapsCPUModelsPtr models)
|
||||||
|
{
|
||||||
|
virCPUDataPtr cpuData = NULL;
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
|
if (virCPUx86DriverInitialize() < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
if (!(cpuData = virCPUDataNew(archs[0])))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
if (cpuidSet(CPUX86_BASIC, cpuData) < 0 ||
|
||||||
|
cpuidSet(CPUX86_EXTENDED, cpuData) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
ret = x86DecodeCPUData(cpu, cpuData, models);
|
||||||
|
cpu->microcodeVersion = virHostCPUGetMicrocodeVersion();
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
virCPUx86DataFree(cpuData);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
virCPUx86CheckFeature(const virCPUDef *cpu,
|
virCPUx86CheckFeature(const virCPUDef *cpu,
|
||||||
const char *name)
|
const char *name)
|
||||||
@ -2742,33 +2771,6 @@ virCPUx86DataCheckFeature(const virCPUData *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
|
||||||
virCPUx86GetHost(virCPUDefPtr cpu,
|
|
||||||
virDomainCapsCPUModelsPtr models)
|
|
||||||
{
|
|
||||||
virCPUDataPtr cpuData = NULL;
|
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
if (virCPUx86DriverInitialize() < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (!(cpuData = virCPUDataNew(archs[0])))
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
if (cpuidSet(CPUX86_BASIC, cpuData) < 0 ||
|
|
||||||
cpuidSet(CPUX86_EXTENDED, cpuData) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
|
|
||||||
ret = x86DecodeCPUData(cpu, cpuData, models);
|
|
||||||
cpu->microcodeVersion = virHostCPUGetMicrocodeVersion();
|
|
||||||
|
|
||||||
cleanup:
|
|
||||||
virCPUx86DataFree(cpuData);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
static virCPUDefPtr
|
static virCPUDefPtr
|
||||||
virCPUx86Baseline(virCPUDefPtr *cpus,
|
virCPUx86Baseline(virCPUDefPtr *cpus,
|
||||||
unsigned int ncpus,
|
unsigned int ncpus,
|
||||||
|
Loading…
Reference in New Issue
Block a user