[RFC PATCH 20/35] hw/intc/i8259: Emit warning when old code is used

Philippe Mathieu-Daudé posted 35 patches 5 years, 8 months ago
There is a newer version of this series
[RFC PATCH 20/35] hw/intc/i8259: Emit warning when old code is used
Posted by Philippe Mathieu-Daudé 5 years, 8 months ago
This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/intc/i8259.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
index 51b27f6a34..9d9609cdab 100644
--- a/hw/intc/i8259.c
+++ b/hw/intc/i8259.c
@@ -30,6 +30,7 @@
 #include "qemu/log.h"
 #include "hw/isa/i8259_internal.h"
 #include "trace.h"
+#include "hw/qdev-deprecated.h"
 
 /* debug PIC */
 //#define DEBUG_PIC
@@ -414,6 +415,8 @@ qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
     ISADevice *isadev;
     int i;
 
+    qdev_warn_deprecated_function_used();
+
     irq_set = g_new0(qemu_irq, ISA_NUM_IRQS);
 
     isadev = i8259_init_chip(TYPE_I8259, bus, true);
-- 
2.21.3


Re: [RFC PATCH 20/35] hw/intc/i8259: Emit warning when old code is used
Posted by Paolo Bonzini 5 years, 8 months ago
On 08/06/20 18:00, Philippe Mathieu-Daudé wrote:
> This code hasn't been QOM'ified yet. Warn the user.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/intc/i8259.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
> index 51b27f6a34..9d9609cdab 100644
> --- a/hw/intc/i8259.c
> +++ b/hw/intc/i8259.c
> @@ -30,6 +30,7 @@
>  #include "qemu/log.h"
>  #include "hw/isa/i8259_internal.h"
>  #include "trace.h"
> +#include "hw/qdev-deprecated.h"
>  
>  /* debug PIC */
>  //#define DEBUG_PIC
> @@ -414,6 +415,8 @@ qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
>      ISADevice *isadev;
>      int i;
>  
> +    qdev_warn_deprecated_function_used();
> +
>      irq_set = g_new0(qemu_irq, ISA_NUM_IRQS);
>  
>      isadev = i8259_init_chip(TYPE_I8259, bus, true);
> 

This one is okay too.

Paolo