Blame SOURCES/kvm-numa-clarify-error-message-when-node-index-is-out-of.patch

383d26
From af911371436ef3adf09fca4433f71f8f17631e1b Mon Sep 17 00:00:00 2001
383d26
From: Igor Mammedov <imammedo@redhat.com>
383d26
Date: Mon, 2 Jul 2018 13:57:09 +0200
383d26
Subject: [PATCH 52/57] numa: clarify error message when node index is out of
383d26
 range in -numa dist, ...
383d26
383d26
RH-Author: Igor Mammedov <imammedo@redhat.com>
383d26
Message-id: <1530539829-260581-1-git-send-email-imammedo@redhat.com>
383d26
Patchwork-id: 81184
383d26
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH] numa: clarify error message when node index is out of range in -numa dist, ...
383d26
Bugzilla: 1578381
383d26
RH-Acked-by: Andrew Jones <drjones@redhat.com>
383d26
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
383d26
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
383d26
RH-Acked-by: Pankaj Gupta <pagupta@redhat.com>
383d26
383d26
When using following CLI:
383d26
  -numa dist,src=128,dst=1,val=20
383d26
user gets a rather confusing error message:
383d26
   "Invalid node 128, max possible could be 128"
383d26
383d26
Where 128 is number of nodes that QEMU supports (MAX_NODES),
383d26
while src/dst is an index up to that limit, so it should be
383d26
MAX_NODES - 1 in error message.
383d26
Make error message to explicitly state valid range for node
383d26
index to be more clear.
383d26
383d26
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
383d26
Message-Id: <1526483174-169008-1-git-send-email-imammedo@redhat.com>
383d26
Reviewed-by: Eric Blake <eblake@redhat.com>
383d26
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
383d26
(cherry picked from commit 74f38e96b321ef8df2bf7fa1bd4f673ef06aca5b)
383d26
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
383d26
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
383d26
---
383d26
 numa.c | 5 ++---
383d26
 1 file changed, 2 insertions(+), 3 deletions(-)
383d26
383d26
diff --git a/numa.c b/numa.c
383d26
index daf10d8..bb8f773 100644
383d26
--- a/numa.c
383d26
+++ b/numa.c
383d26
@@ -140,9 +140,8 @@ static void parse_numa_distance(NumaDistOptions *dist, Error **errp)
383d26
     uint8_t val = dist->val;
383d26
 
383d26
     if (src >= MAX_NODES || dst >= MAX_NODES) {
383d26
-        error_setg(errp,
383d26
-                   "Invalid node %d, max possible could be %d",
383d26
-                   MAX(src, dst), MAX_NODES);
383d26
+        error_setg(errp, "Parameter '%s' expects an integer between 0 and %d",
383d26
+                   src >= MAX_NODES ? "src" : "dst", MAX_NODES - 1);
383d26
         return;
383d26
     }
383d26
 
383d26
-- 
383d26
1.8.3.1
383d26