mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
cpu: Set nfeatures_max correctly in x86Decode
Keeping nfeatures_max set to 0 while nfeatures > 0 and some features are already stored in features array is just asking for problems once we want to add a new feature into the array. Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
3b6be3c0c5
commit
0b119e2b19
@ -1871,10 +1871,12 @@ x86Decode(virCPUDefPtr cpu,
|
|||||||
if (vendor && VIR_STRDUP(cpu->vendor, vendor->name) < 0)
|
if (vendor && VIR_STRDUP(cpu->vendor, vendor->name) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
cpu->model = cpuModel->model;
|
VIR_STEAL_PTR(cpu->model, cpuModel->model);
|
||||||
|
VIR_STEAL_PTR(cpu->features, cpuModel->features);
|
||||||
cpu->nfeatures = cpuModel->nfeatures;
|
cpu->nfeatures = cpuModel->nfeatures;
|
||||||
cpu->features = cpuModel->features;
|
cpuModel->nfeatures = 0;
|
||||||
VIR_FREE(cpuModel);
|
cpu->nfeatures_max = cpuModel->nfeatures_max;
|
||||||
|
cpuModel->nfeatures_max = 0;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user