aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr.c
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2017-05-30 18:23:56 +0200
committerEduardo Habkost <ehabkost@redhat.com>2017-06-05 14:59:08 -0300
commita0ceb640d083ab583d115fbd2ded14c089044ae8 (patch)
treeddaa37a3b8e7b2f0b9c325b2e996577f62bfe4e9 /hw/ppc/spapr.c
parent1f43571604da85c62f25f3ba6d275b1b5ea76ca2 (diff)
numa: consolidate cpu_preplug fixups/checks for pc/arm/spapr
Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Message-Id: <1496161442-96665-2-git-send-email-imammedo@redhat.com> [ehabkost: Fix indentation] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r--hw/ppc/spapr.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index ab3aab1279..94563cd8f5 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2922,11 +2922,9 @@ static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
MachineClass *mc = MACHINE_GET_CLASS(hotplug_dev);
Error *local_err = NULL;
CPUCore *cc = CPU_CORE(dev);
- sPAPRCPUCore *sc = SPAPR_CPU_CORE(dev);
char *base_core_type = spapr_get_cpu_core_type(machine->cpu_model);
const char *type = object_get_typename(OBJECT(dev));
CPUArchId *core_slot;
- int node_id;
int index;
if (dev->hotplugged && !mc->has_hotpluggable_cpus) {
@@ -2967,20 +2965,7 @@ static void spapr_core_pre_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
goto out;
}
- node_id = core_slot->props.node_id;
- if (!core_slot->props.has_node_id) {
- /* by default CPUState::numa_node was 0 if it's not set via CLI
- * keep it this way for now but in future we probably should
- * refuse to start up with incomplete numa mapping */
- node_id = 0;
- }
- if (sc->node_id == CPU_UNSET_NUMA_NODE_ID) {
- sc->node_id = node_id;
- } else if (sc->node_id != node_id) {
- error_setg(&local_err, "node-id %d must match numa node specified"
- "with -numa option for cpu-index %d", sc->node_id, cc->core_id);
- goto out;
- }
+ numa_cpu_pre_plug(core_slot, dev, &local_err);
out:
g_free(base_core_type);