提交 8d724544 编写于 作者: J Jiri Denemark

cpu_x86: Make sure CPU model names are unique in cpu_map

Having multiple CPU model definitions with the same name could result in
unexpected behavior.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 8d249df9
......@@ -1293,9 +1293,15 @@ x86ModelParse(xmlXPathContextPtr ctxt,
void *data)
{
virCPUx86MapPtr map = data;
virCPUx86ModelPtr model;
virCPUx86ModelPtr model = NULL;
int ret = -1;
if (x86ModelFind(map, name)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Multiple definitions of CPU model '%s'"), name);
goto cleanup;
}
if (!(model = x86ModelNew()))
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册