提交 0b119e2b 编写于 作者: J Jiri Denemark

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: NJiri Denemark <jdenemar@redhat.com>
上级 3b6be3c0
......@@ -1871,10 +1871,12 @@ x86Decode(virCPUDefPtr cpu,
if (vendor && VIR_STRDUP(cpu->vendor, vendor->name) < 0)
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->features = cpuModel->features;
VIR_FREE(cpuModel);
cpuModel->nfeatures = 0;
cpu->nfeatures_max = cpuModel->nfeatures_max;
cpuModel->nfeatures_max = 0;
ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册