Skip to contentSkip to conversation

numa: improve cpu hotplug error message with a wrong node-id

PATCH Applied Laurent Vivier 3 participants 3 messages May 29, 2019 – May 31, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 numa: improve cpu hotplug error message with a wrong node-id

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

---

Notes:
v4: simplify the message

v3: only add the topology to the existing message
As suggested by Igor replace
Error: core-id 30 can only be plugged into node-id 0
by
Error: node-id=1 must match numa node specified with -numa option 'node-id 0'

v2: display full topology in the error message

 numa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
numa.c +2 -2
index 3875e1efda3a..955ec0c830db 100644
@@ -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);
     }
 }
 
Signature · 1 line
2.20.1
Reviewed-by on v4 1/1
#1 lore raw
Quoted 10 lines · On Wed, 29 May 2019 18:07:47 +0200 Laurent Vivier <[email protected]> wrote:

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

Quoted 6 lines

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

Quoted 31 lines

---

Notes:
v4: simplify the message

v3: only add the topology to the existing message
As suggested by Igor replace
Error: core-id 30 can only be plugged into node-id 0
by
Error: node-id=1 must match numa node specified with -numa option 'node-id 0'

v2: display full topology in the error message

 numa.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
numa.c +2 -2
index 3875e1efda3a..955ec0c830db 100644
@@ -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);
     }
 }
 
#2 lore raw
In reply to Laurent Vivier
Quoted 10 lines · Laurent Vivier

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

Quoted 6 lines

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

Queued, thanks.

Signature · 1 line
Eduardo