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

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