[PULL,v4,41/43] numa: Make deprecation warnings conditional on !qtest_enabled()
diff mbox series

Message ID 20190703180726.31267-42-ehabkost@redhat.com
State New
Headers show
Series
  • [PULL,v4,01/43] hw/boards: Add struct CpuTopology to MachineState
Related show

Commit Message

Eduardo Habkost July 3, 2019, 6:07 p.m. UTC
This will help us avoid spurious warnings during "make check".

Note that this will silence the warnings generated by
tests/numa-test, but not the ones generated by
tests/bios-tables-test.  We still need to change
tests/bios-tables-test to use "-numa ...,memdev=" to silence
these warnings.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20190702215726.23661-1-ehabkost@redhat.com>
---
 numa.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

Patch
diff mbox series

diff --git a/numa.c b/numa.c
index 48fd43ecc6..2fcc99e154 100644
--- a/numa.c
+++ b/numa.c
@@ -35,6 +35,7 @@ 
 #include "qapi/qapi-visit-misc.h"
 #include "hw/boards.h"
 #include "sysemu/hostmem.h"
+#include "sysemu/qtest.h"
 #include "hw/mem/pc-dimm.h"
 #include "hw/mem/memory-device.h"
 #include "qemu/option.h"
@@ -122,8 +123,10 @@  static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
 
     if (node->has_mem) {
         numa_info[nodenr].node_mem = node->mem;
-        warn_report("Parameter -numa node,mem is deprecated,"
-                    " use -numa node,memdev instead");
+        if (!qtest_enabled()) {
+            warn_report("Parameter -numa node,mem is deprecated,"
+                        " use -numa node,memdev instead");
+        }
     }
     if (node->has_memdev) {
         Object *o;
@@ -410,9 +413,11 @@  void numa_complete_configuration(MachineState *ms)
         if (i == nb_numa_nodes) {
             assert(mc->numa_auto_assign_ram);
             mc->numa_auto_assign_ram(mc, numa_info, nb_numa_nodes, ram_size);
-            warn_report("Default splitting of RAM between nodes is deprecated,"
-                        " Use '-numa node,memdev' to explictly define RAM"
-                        " allocation per node");
+            if (!qtest_enabled()) {
+                warn_report("Default splitting of RAM between nodes is deprecated,"
+                            " Use '-numa node,memdev' to explictly define RAM"
+                            " allocation per node");
+            }
         }
 
         numa_total = 0;