mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 09:53:10 +00:00
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: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
8d249df9c9
commit
8d7245441a
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user