Skip to contentSkip to conversation

hw/arm: Silence xlnx-ep108 deprecation warning during tests

PATCH In review Thomas Huth 4 participants 4 messages Nov 16, 2017 – Nov 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/arm: Silence xlnx-ep108 deprecation warning during tests

The new deprecation warning for the xlnx-ep108 machine also pops up during "make check" which is kind of confusing. Silence it if testing mode is enabled.

---
Note: I slightly shortened the message so that the code still fits into the 80-columns limit.

 hw/arm/xlnx-zcu102.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
hw/arm/xlnx-zcu102.c +5 -2
index 9631a53..bbe7d04 100644
@@ -24,6 +24,7 @@
 #include "qemu/error-report.h"
 #include "exec/address-spaces.h"
 #include "qemu/log.h"
+#include "sysemu/qtest.h"
 
 typedef struct XlnxZCU102 {
     MachineState parent_obj;
@@ -164,8 +165,10 @@ static void xlnx_ep108_init(MachineState *machine)
 {
     XlnxZCU102 *s = EP108_MACHINE(machine);
 
-    info_report("The Xilinx EP108 machine is deprecated, please use the "
-                "ZCU102 machine instead. It has the same features supported.");
+    if (!qtest_enabled()) {
+        info_report("The Xilinx EP108 machine is deprecated, please use the "
+                    "ZCU102 machine (which has the same features) instead.");
+    }
 
     xlnx_zynqmp_init(s, machine);
 }
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 28 lines · Thomas Huth

The new deprecation warning for the xlnx-ep108 machine also pops up during "make check" which is kind of confusing. Silence it if testing mode is enabled.

---
Note: I slightly shortened the message so that the code still fits into the 80-columns limit.

 hw/arm/xlnx-zcu102.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
hw/arm/xlnx-zcu102.c +1 -0
index 9631a53..bbe7d04 100644
@@ -24,6 +24,7 @@
 #include "qemu/error-report.h"
 #include "exec/address-spaces.h"
 #include "qemu/log.h"
+#include "sysemu/qtest.h"
 
 typedef struct XlnxZCU102 {
     MachineState parent_obj;
@@ -164,8 +165,10 @@ static void xlnx_ep108_init(MachineState *machine)
 {
     XlnxZCU102 *s = EP108_MACHINE(machine);

hw/arm/xlnx-zcu102.c static void xlnx_ep108_init(MachineState *machine) · line 174

Quoted 10 lines
hw/arm/xlnx-zcu102.c +4 -2
 
-    info_report("The Xilinx EP108 machine is deprecated, please use the "
-                "ZCU102 machine instead. It has the same features supported.");
+    if (!qtest_enabled()) {
+        info_report("The Xilinx EP108 machine is deprecated, please use the "
+                    "ZCU102 machine (which has the same features) instead.");
+    }
 
     xlnx_zynqmp_init(s, machine);
 }

I tested it and it did solve the problem.

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 25 lines · Thomas Huth

The new deprecation warning for the xlnx-ep108 machine also pops up during "make check" which is kind of confusing. Silence it if testing mode is enabled.

---
Note: I slightly shortened the message so that the code still fits into the 80-columns limit.

 hw/arm/xlnx-zcu102.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
hw/arm/xlnx-zcu102.c +1 -0
index 9631a53..bbe7d04 100644
@@ -24,6 +24,7 @@
 #include "qemu/error-report.h"
 #include "exec/address-spaces.h"
 #include "qemu/log.h"
+#include "sysemu/qtest.h"
 
 typedef struct XlnxZCU102 {
     MachineState parent_obj;

hw/arm/xlnx-zcu102.c static void xlnx_ep108_init(MachineState *machine) · line 171

Quoted 9 lines
hw/arm/xlnx-zcu102.c +4 -2
@@ -164,8 +165,10 @@ static void xlnx_ep108_init(MachineState *machine)
 {
     XlnxZCU102 *s = EP108_MACHINE(machine);
 
-    info_report("The Xilinx EP108 machine is deprecated, please use the "
-                "ZCU102 machine instead. It has the same features supported.");
+    if (!qtest_enabled()) {
+        info_report("The Xilinx EP108 machine is deprecated, please use the "
+                    "ZCU102 machine (which has the same features) instead.");
+    }

Looks good to me.

In future maybe it makes sense to never print info_report() when running qtest.

Alistair

Quoted 7 lines
hw/arm/xlnx-zcu102.c +0 -1
     xlnx_zynqmp_init(s, machine);
 }
--

1.8.3.1

#3 lore raw
Quoted 38 lines · Alistair Francis
Quoted 25 lines · Thomas Huth

The new deprecation warning for the xlnx-ep108 machine also pops up during "make check" which is kind of confusing. Silence it if testing mode is enabled.

---
Note: I slightly shortened the message so that the code still fits into the 80-columns limit.

 hw/arm/xlnx-zcu102.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
hw/arm/xlnx-zcu102.c +1 -0
index 9631a53..bbe7d04 100644
@@ -24,6 +24,7 @@
 #include "qemu/error-report.h"
 #include "exec/address-spaces.h"
 #include "qemu/log.h"
+#include "sysemu/qtest.h"
 
 typedef struct XlnxZCU102 {
     MachineState parent_obj;

hw/arm/xlnx-zcu102.c static void xlnx_ep108_init(MachineState *machine) · line 171

Quoted 9 lines
hw/arm/xlnx-zcu102.c +4 -2
@@ -164,8 +165,10 @@ static void xlnx_ep108_init(MachineState *machine)
 {
     XlnxZCU102 *s = EP108_MACHINE(machine);
 
-    info_report("The Xilinx EP108 machine is deprecated, please use the "
-                "ZCU102 machine instead. It has the same features supported.");
+    if (!qtest_enabled()) {
+        info_report("The Xilinx EP108 machine is deprecated, please use the "
+                    "ZCU102 machine (which has the same features) instead.");
+    }

Looks good to me.

Quoted 3 lines

In future maybe it makes sense to never print info_report() when running qtest.

Thanks; applied to target-arm.next.

-- PMM