mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
cpuBaseline: Don't mess with the CPU returned by arch driver
All features in the baseline CPU definition were always created with policy='require' even though an arch driver returned them with different policy settings.
This commit is contained in:
parent
20a7a1be6e
commit
4e0f648fbb
@ -354,7 +354,6 @@ cpuBaseline(virCPUDefPtr *cpus,
|
|||||||
unsigned int nmodels)
|
unsigned int nmodels)
|
||||||
{
|
{
|
||||||
struct cpuArchDriver *driver;
|
struct cpuArchDriver *driver;
|
||||||
virCPUDefPtr cpu;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
VIR_DEBUG("ncpus=%u, nmodels=%u", ncpus, nmodels);
|
VIR_DEBUG("ncpus=%u, nmodels=%u", ncpus, nmodels);
|
||||||
@ -394,16 +393,7 @@ cpuBaseline(virCPUDefPtr *cpus,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((cpu = driver->baseline(cpus, ncpus, models, nmodels))) {
|
return driver->baseline(cpus, ncpus, models, nmodels);
|
||||||
cpu->type = VIR_CPU_TYPE_GUEST;
|
|
||||||
cpu->match = VIR_CPU_MATCH_EXACT;
|
|
||||||
VIR_FREE(cpu->arch);
|
|
||||||
|
|
||||||
for (i = 0; i < cpu->nfeatures; i++)
|
|
||||||
cpu->features[i].policy = VIR_CPU_FEATURE_REQUIRE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return cpu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1366,6 +1366,8 @@ x86Baseline(virCPUDefPtr *cpus,
|
|||||||
if (x86Decode(cpu, data, models, nmodels, NULL) < 0)
|
if (x86Decode(cpu, data, models, nmodels, NULL) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
VIR_FREE(cpu->arch);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
x86DataFree(data);
|
x86DataFree(data);
|
||||||
x86ModelFree(base_model);
|
x86ModelFree(base_model);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user