qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] numa: improve cpu hotplug error message with a wrong node-id
@ 2019-05-20 15:29 Laurent Vivier
  2019-05-20 21:11 ` Eduardo Habkost
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Vivier @ 2019-05-20 15:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Eduardo Habkost, qemu-arm, qemu-ppc, Igor Mammedov,
	David Gibson

On pseries, core-ids are strongly binded to a node-id by the command
line option. If a 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: core-id 30 can only be plugged into node-id 0

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 numa.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/numa.c b/numa.c
index 3875e1efda3a..c419c5b5b8ee 100644
--- a/numa.c
+++ b/numa.c
@@ -470,8 +470,9 @@ 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,
+                   "core-id %"PRId64" can only be plugged into node-id %"PRId64,
+                   slot->props.core_id, slot->props.node_id);
     }
 }
 
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] numa: improve cpu hotplug error message with a wrong node-id
  2019-05-20 15:29 [Qemu-devel] [PATCH] numa: improve cpu hotplug error message with a wrong node-id Laurent Vivier
@ 2019-05-20 21:11 ` Eduardo Habkost
  0 siblings, 0 replies; 2+ messages in thread
From: Eduardo Habkost @ 2019-05-20 21:11 UTC (permalink / raw)
  To: Laurent Vivier
  Cc: Peter Maydell, qemu-devel, qemu-arm, qemu-ppc, Igor Mammedov,
	David Gibson

On Mon, May 20, 2019 at 05:29:21PM +0200, Laurent Vivier wrote:
> On pseries, core-ids are strongly binded to a node-id by the command
> line option. If a 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: core-id 30 can only be plugged into node-id 0

Why just core-id?  What about the other fields at slot->props?

> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  numa.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/numa.c b/numa.c
> index 3875e1efda3a..c419c5b5b8ee 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -470,8 +470,9 @@ 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,
> +                   "core-id %"PRId64" can only be plugged into node-id %"PRId64,
> +                   slot->props.core_id, slot->props.node_id);
>      }
>  }
>  
> -- 
> 2.20.1
> 

-- 
Eduardo


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-20 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-20 15:29 [Qemu-devel] [PATCH] numa: improve cpu hotplug error message with a wrong node-id Laurent Vivier
2019-05-20 21:11 ` Eduardo Habkost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).