]> git.proxmox.com Git - mirror_qemu.git/commitdiff
numa: improve cpu hotplug error message with a wrong node-id
authorLaurent Vivier <lvivier@redhat.com>
Wed, 29 May 2019 16:07:47 +0000 (18:07 +0200)
committerEduardo Habkost <ehabkost@redhat.com>
Fri, 7 Jun 2019 18:28:46 +0000 (15:28 -0300)
On pseries, core-ids are strongly binded to a node-id by the command
line option. If an user tries to add a CPU to the wrong node, he has
an error but it is not really helpful:

  qemu-system-ppc64 ... -smp 1,maxcpus=64,cores=1,threads=1,sockets=1 \
                        -numa node,nodeid=0 -numa node,nodeid=1 ...

  (qemu) device_add power9_v2.0-spapr-cpu-core,core-id=30,node-id=1
  Error: node-id=1 must match numa node specified with -numa option

This patch improves this error message by giving to the user the good
node-id to use with the core-id he's providing

  Error: invalid node-id, must be 0

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20190529160747.778-1-lvivier@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
numa.c

diff --git a/numa.c b/numa.c
index 3875e1efda3aafb67ce0427cac714bb1bead6f11..955ec0c830db4981b929d6c9a72fb8f8a8888c59 100644 (file)
--- a/numa.c
+++ b/numa.c
@@ -470,8 +470,8 @@ void numa_cpu_pre_plug(const CPUArchId *slot, DeviceState *dev, Error **errp)
                                     "node-id", errp);
         }
     } else if (node_id != slot->props.node_id) {
-        error_setg(errp, "node-id=%d must match numa node specified "
-                   "with -numa option", node_id);
+        error_setg(errp, "invalid node-id, must be %"PRId64,
+                   slot->props.node_id);
     }
 }