diff mbox series

[1/2] numa: Report expected initiator

Message ID ebdf871551ea995bafa7a858899a26aa9bc153d3.1625662776.git.mprivozn@redhat.com (mailing list archive)
State New, archived
Headers show
Series numa: Parse initiator= attribute before cpus= attribute | expand

Commit Message

Michal Privoznik July 7, 2021, 1:40 p.m. UTC
When setting up NUMA with HMAT enabled there's a check performed
in machine_set_cpu_numa_node() that reports an error when a NUMA
node has a CPU but the node's initiator is not itself. The error
message reported contains only the expected value and not the
actual value (which is different because an error is being
reported). Report both values in the error message.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 hw/core/machine.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Igor Mammedov July 9, 2021, 9:27 a.m. UTC | #1
On Wed,  7 Jul 2021 15:40:29 +0200
Michal Privoznik <mprivozn@redhat.com> wrote:

> When setting up NUMA with HMAT enabled there's a check performed
> in machine_set_cpu_numa_node() that reports an error when a NUMA
> node has a CPU but the node's initiator is not itself. The error
> message reported contains only the expected value and not the
> actual value (which is different because an error is being
> reported). Report both values in the error message.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>

Reviewed-by: Igor Mammedov <imammedo@redhat.com>

> ---
>  hw/core/machine.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 57c18f909a..6f59fb0b7f 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -728,7 +728,8 @@ void machine_set_cpu_numa_node(MachineState *machine,
>              if ((numa_info[props->node_id].initiator < MAX_NODES) &&
>                  (props->node_id != numa_info[props->node_id].initiator)) {
>                  error_setg(errp, "The initiator of CPU NUMA node %" PRId64
> -                        " should be itself", props->node_id);
> +                           " should be itself (got %" PRIu16 ")",
> +                           props->node_id, numa_info[props->node_id].initiator);
>                  return;
>              }
>              numa_info[props->node_id].has_cpu = true;
Pankaj Gupta July 9, 2021, 7:33 p.m. UTC | #2
> When setting up NUMA with HMAT enabled there's a check performed
> in machine_set_cpu_numa_node() that reports an error when a NUMA
> node has a CPU but the node's initiator is not itself. The error
> message reported contains only the expected value and not the
> actual value (which is different because an error is being
> reported). Report both values in the error message.
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  hw/core/machine.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index 57c18f909a..6f59fb0b7f 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -728,7 +728,8 @@ void machine_set_cpu_numa_node(MachineState *machine,
>              if ((numa_info[props->node_id].initiator < MAX_NODES) &&
>                  (props->node_id != numa_info[props->node_id].initiator)) {
>                  error_setg(errp, "The initiator of CPU NUMA node %" PRId64
> -                        " should be itself", props->node_id);
> +                           " should be itself (got %" PRIu16 ")",
> +                           props->node_id, numa_info[props->node_id].initiator);
>                  return;
>              }
>              numa_info[props->node_id].has_cpu = true;

Reviewed-by: Pankaj Gupta <pankaj.gupta@ionos.com>
diff mbox series

Patch

diff --git a/hw/core/machine.c b/hw/core/machine.c
index 57c18f909a..6f59fb0b7f 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -728,7 +728,8 @@  void machine_set_cpu_numa_node(MachineState *machine,
             if ((numa_info[props->node_id].initiator < MAX_NODES) &&
                 (props->node_id != numa_info[props->node_id].initiator)) {
                 error_setg(errp, "The initiator of CPU NUMA node %" PRId64
-                        " should be itself", props->node_id);
+                           " should be itself (got %" PRIu16 ")",
+                           props->node_id, numa_info[props->node_id].initiator);
                 return;
             }
             numa_info[props->node_id].has_cpu = true;