]> git.proxmox.com Git - mirror_qemu.git/commit
cpu: don't allow negative core id
authorLaurent Vivier <lvivier@redhat.com>
Wed, 2 Aug 2017 10:32:59 +0000 (12:32 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 24 Aug 2017 23:40:13 +0000 (18:40 -0500)
commitde9b6728ff712610a4f49a37f20a428f12d3623f
treeb16dd432ceb67eb1d2e93233747dd54cb944c36b
parenta0ddbcfb681fd3341058f5d7ccfb3f208a7dc16a
cpu: don't allow negative core id

With pseries machine type a negative core-id is not managed properly:
-1 gives an inaccurate error message ("core -1 already populated"),
-2 crashes QEMU (core dump)

As it seems a negative value is invalid for any architecture,
instead of checking this in spapr_core_pre_plug() I think it's better
to check this in the generic part, core_prop_set_core_id()

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20170802103259.25940-1-lvivier@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit be2960baae07e5257cde8c814cbd91647e235147)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/cpu/core.c