diff mbox series

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

Message ID 20200608160044.15531-21-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series hw/qdev: Warn when using pre-qdev/QOM devices | expand

Commit Message

Philippe Mathieu-Daudé June 8, 2020, 4 p.m. UTC
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(+)

Comments

Paolo Bonzini June 9, 2020, 11:10 a.m. UTC | #1
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
diff mbox series

Patch

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);