mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +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)
|
void *data)
|
||||||
{
|
{
|
||||||
virCPUx86MapPtr map = data;
|
virCPUx86MapPtr map = data;
|
||||||
virCPUx86ModelPtr model;
|
virCPUx86ModelPtr model = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
|
if (x86ModelFind(map, name)) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Multiple definitions of CPU model '%s'"), name);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(model = x86ModelNew()))
|
if (!(model = x86ModelNew()))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user