diff mbox

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

Message ID 1510846183-756-1-git-send-email-thuth@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Huth Nov. 16, 2017, 3:29 p.m. UTC
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.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 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(-)

Comments

Wei Huang Nov. 16, 2017, 4:57 p.m. UTC | #1
On 11/16/2017 09:29 AM, Thomas Huth wrote:
> 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.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  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(-)
> 
> diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
> index 9631a53..bbe7d04 100644
> --- a/hw/arm/xlnx-zcu102.c
> +++ b/hw/arm/xlnx-zcu102.c
> @@ -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);
>  }
> 

I tested it and it did solve the problem.

Acked-by: Wei Huang <wei@redhat.com>
Alistair Francis Nov. 16, 2017, 5:09 p.m. UTC | #2
On Thu, Nov 16, 2017 at 7:29 AM, Thomas Huth <thuth@redhat.com> wrote:
> 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.
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  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(-)
>
> diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
> index 9631a53..bbe7d04 100644
> --- a/hw/arm/xlnx-zcu102.c
> +++ b/hw/arm/xlnx-zcu102.c
> @@ -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.");
> +    }

Looks good to me.

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

Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>

Alistair

>
>      xlnx_zynqmp_init(s, machine);
>  }
> --
> 1.8.3.1
>
>
Peter Maydell Nov. 20, 2017, 1:48 p.m. UTC | #3
On 16 November 2017 at 17:09, Alistair Francis
<alistair.francis@xilinx.com> wrote:
> On Thu, Nov 16, 2017 at 7:29 AM, Thomas Huth <thuth@redhat.com> wrote:
>> 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.
>>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>  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(-)
>>
>> diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
>> index 9631a53..bbe7d04 100644
>> --- a/hw/arm/xlnx-zcu102.c
>> +++ b/hw/arm/xlnx-zcu102.c
>> @@ -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.");
>> +    }
>
> Looks good to me.
>
> In future maybe it makes sense to never print info_report() when running qtest.
>
> Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>

Thanks; applied to target-arm.next.

-- PMM
diff mbox

Patch

diff --git a/hw/arm/xlnx-zcu102.c b/hw/arm/xlnx-zcu102.c
index 9631a53..bbe7d04 100644
--- a/hw/arm/xlnx-zcu102.c
+++ b/hw/arm/xlnx-zcu102.c
@@ -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);
 }