All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 00/23] hw/qdev: Warn when using pre-qdev/QOM devices
@ 2020-07-04 15:38 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This is a trivial RFC series to anotate pre-qdev/QOM devices
so developers using them without knowing they are not QOM'ified
yet can realize it and convert them if/when they have time.

qdev/QOM devices are introspectable, so easier to test
or even fuzz.

Since RFC v1:
- Addressed bonzini comments, removed invalid patches
- Addressed thuth comment

Philippe Mathieu-Daudé (23):
  qom/object: Update documentation
  hw/core/qdev: Add qdev_warn_deprecated_function_used() helper
  hw/arm/omap: Emit warning when old code is used
  hw/arm/pxa2xx: Emit warning when old code is used
  hw/arm/nseries: Emit warning when old code is used
  hw/char/parallel: Emit warning when old code is used
  hw/display/blizzard: Emit warning when old code is used
  hw/display/ramfb: Emit warning when old code is used
  hw/display/tc6393xb: Emit warning when old code is used
  hw/display/vga-isa-mm: Emit warning when old code is used
  hw/dma/etraxfs_dma: Emit warning when old code is used
  hw/dma/soc_dma: Emit warning when old code is used
  hw/input/lasips2: Emit warning when old code is used
  hw/input/tsc2005: Emit warning when old code is used
  hw/m68k/mcf520x: Emit warning when old code is used
  hw/misc/cbus: Emit warning when old code is used
  hw/nvram/eeprom93xx: Emit warning when old code is used
  hw/openrisc/cputimer: Emit warning when old code is used
  hw/ppc/ppc4xx: Emit warning when old code is used
  hw/sh4: Emit warning when old code is used
  hw/riscv: Emit warning when old code is used
  hw/usb/hcd-musb: Emit warning when old code is used
  hw/xtensa/xtfpga: Emit warning when old code is used

 configure                    |  8 ++++++++
 include/hw/qdev-deprecated.h | 26 ++++++++++++++++++++++++++
 include/qom/object.h         |  6 +++---
 hw/arm/nseries.c             |  2 ++
 hw/arm/omap1.c               |  6 ++++++
 hw/arm/pxa2xx.c              |  3 +++
 hw/char/omap_uart.c          |  5 +++++
 hw/char/parallel.c           |  3 +++
 hw/char/sh_serial.c          |  3 +++
 hw/core/qdev.c               |  8 ++++++++
 hw/display/blizzard.c        |  3 +++
 hw/display/pxa2xx_lcd.c      |  3 +++
 hw/display/ramfb.c           |  3 +++
 hw/display/tc6393xb.c        |  3 +++
 hw/display/vga-isa-mm.c      |  5 +++++
 hw/display/vga.c             |  3 +++
 hw/dma/etraxfs_dma.c         |  4 +++-
 hw/dma/soc_dma.c             |  3 +++
 hw/input/lasips2.c           |  4 +++-
 hw/input/pxa2xx_keypad.c     |  3 +++
 hw/input/tsc2005.c           |  3 +++
 hw/intc/sh_intc.c            |  3 +++
 hw/m68k/mcf5206.c            |  5 +++++
 hw/m68k/mcf5208.c            |  3 +++
 hw/misc/cbus.c               |  3 +++
 hw/misc/omap_gpmc.c          |  3 +++
 hw/misc/omap_l4.c            |  3 +++
 hw/misc/omap_sdrc.c          |  3 +++
 hw/nvram/eeprom93xx.c        |  3 +++
 hw/openrisc/cputimer.c       |  3 +++
 hw/ppc/ppc405_boards.c       |  5 +++++
 hw/ppc/ppc405_uc.c           | 21 +++++++++++++++++++++
 hw/ppc/ppc4xx_devs.c         |  7 +++++++
 hw/riscv/riscv_htif.c        |  4 ++++
 hw/riscv/sifive_uart.c       |  4 ++++
 hw/sd/omap_mmc.c             |  5 +++++
 hw/sh4/r2d.c                 |  3 +++
 hw/sh4/sh7750.c              |  4 ++++
 hw/ssi/omap_spi.c            |  3 +++
 hw/timer/omap_synctimer.c    |  4 ++++
 hw/timer/sh_timer.c          |  5 +++++
 hw/usb/hcd-musb.c            |  3 +++
 hw/xtensa/xtfpga.c           |  3 +++
 43 files changed, 202 insertions(+), 5 deletions(-)
 create mode 100644 include/hw/qdev-deprecated.h

-- 
2.21.3



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 00/23] hw/qdev: Warn when using pre-qdev/QOM devices
@ 2020-07-04 15:38 ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This is a trivial RFC series to anotate pre-qdev/QOM devices
so developers using them without knowing they are not QOM'ified
yet can realize it and convert them if/when they have time.

qdev/QOM devices are introspectable, so easier to test
or even fuzz.

Since RFC v1:
- Addressed bonzini comments, removed invalid patches
- Addressed thuth comment

Philippe Mathieu-Daudé (23):
  qom/object: Update documentation
  hw/core/qdev: Add qdev_warn_deprecated_function_used() helper
  hw/arm/omap: Emit warning when old code is used
  hw/arm/pxa2xx: Emit warning when old code is used
  hw/arm/nseries: Emit warning when old code is used
  hw/char/parallel: Emit warning when old code is used
  hw/display/blizzard: Emit warning when old code is used
  hw/display/ramfb: Emit warning when old code is used
  hw/display/tc6393xb: Emit warning when old code is used
  hw/display/vga-isa-mm: Emit warning when old code is used
  hw/dma/etraxfs_dma: Emit warning when old code is used
  hw/dma/soc_dma: Emit warning when old code is used
  hw/input/lasips2: Emit warning when old code is used
  hw/input/tsc2005: Emit warning when old code is used
  hw/m68k/mcf520x: Emit warning when old code is used
  hw/misc/cbus: Emit warning when old code is used
  hw/nvram/eeprom93xx: Emit warning when old code is used
  hw/openrisc/cputimer: Emit warning when old code is used
  hw/ppc/ppc4xx: Emit warning when old code is used
  hw/sh4: Emit warning when old code is used
  hw/riscv: Emit warning when old code is used
  hw/usb/hcd-musb: Emit warning when old code is used
  hw/xtensa/xtfpga: Emit warning when old code is used

 configure                    |  8 ++++++++
 include/hw/qdev-deprecated.h | 26 ++++++++++++++++++++++++++
 include/qom/object.h         |  6 +++---
 hw/arm/nseries.c             |  2 ++
 hw/arm/omap1.c               |  6 ++++++
 hw/arm/pxa2xx.c              |  3 +++
 hw/char/omap_uart.c          |  5 +++++
 hw/char/parallel.c           |  3 +++
 hw/char/sh_serial.c          |  3 +++
 hw/core/qdev.c               |  8 ++++++++
 hw/display/blizzard.c        |  3 +++
 hw/display/pxa2xx_lcd.c      |  3 +++
 hw/display/ramfb.c           |  3 +++
 hw/display/tc6393xb.c        |  3 +++
 hw/display/vga-isa-mm.c      |  5 +++++
 hw/display/vga.c             |  3 +++
 hw/dma/etraxfs_dma.c         |  4 +++-
 hw/dma/soc_dma.c             |  3 +++
 hw/input/lasips2.c           |  4 +++-
 hw/input/pxa2xx_keypad.c     |  3 +++
 hw/input/tsc2005.c           |  3 +++
 hw/intc/sh_intc.c            |  3 +++
 hw/m68k/mcf5206.c            |  5 +++++
 hw/m68k/mcf5208.c            |  3 +++
 hw/misc/cbus.c               |  3 +++
 hw/misc/omap_gpmc.c          |  3 +++
 hw/misc/omap_l4.c            |  3 +++
 hw/misc/omap_sdrc.c          |  3 +++
 hw/nvram/eeprom93xx.c        |  3 +++
 hw/openrisc/cputimer.c       |  3 +++
 hw/ppc/ppc405_boards.c       |  5 +++++
 hw/ppc/ppc405_uc.c           | 21 +++++++++++++++++++++
 hw/ppc/ppc4xx_devs.c         |  7 +++++++
 hw/riscv/riscv_htif.c        |  4 ++++
 hw/riscv/sifive_uart.c       |  4 ++++
 hw/sd/omap_mmc.c             |  5 +++++
 hw/sh4/r2d.c                 |  3 +++
 hw/sh4/sh7750.c              |  4 ++++
 hw/ssi/omap_spi.c            |  3 +++
 hw/timer/omap_synctimer.c    |  4 ++++
 hw/timer/sh_timer.c          |  5 +++++
 hw/usb/hcd-musb.c            |  3 +++
 hw/xtensa/xtfpga.c           |  3 +++
 43 files changed, 202 insertions(+), 5 deletions(-)
 create mode 100644 include/hw/qdev-deprecated.h

-- 
2.21.3



^ permalink raw reply	[flat|nested] 60+ messages in thread

* [PATCH v2 01/23] qom/object: Update documentation
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

The documentation was introduced in 2f28d2ff9dc, then
0d09e41a51 and a27bd6c77 moved the headers around.
Update the comment.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/qom/object.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index 94a61ccc3f..03dcd3623e 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -43,7 +43,7 @@ typedef struct InterfaceInfo InterfaceInfo;
  * <example>
  *   <title>Creating a minimal type</title>
  *   <programlisting>
- * #include "qdev.h"
+ * #include "hw/qdev-core.h"
  *
  * #define TYPE_MY_DEVICE "my-device"
  *
@@ -144,7 +144,7 @@ typedef struct InterfaceInfo InterfaceInfo;
  * <example>
  *   <title>Overriding a virtual function</title>
  *   <programlisting>
- * #include "qdev.h"
+ * #include "hw/qdev-core.h"
  *
  * void my_device_class_init(ObjectClass *klass, void *class_data)
  * {
@@ -168,7 +168,7 @@ typedef struct InterfaceInfo InterfaceInfo;
  * <example>
  *   <title>Defining an abstract class</title>
  *   <programlisting>
- * #include "qdev.h"
+ * #include "hw/qdev-core.h"
  *
  * typedef struct MyDeviceClass
  * {
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [PATCH v2 01/23] qom/object: Update documentation
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

The documentation was introduced in 2f28d2ff9dc, then
0d09e41a51 and a27bd6c77 moved the headers around.
Update the comment.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/qom/object.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index 94a61ccc3f..03dcd3623e 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -43,7 +43,7 @@ typedef struct InterfaceInfo InterfaceInfo;
  * <example>
  *   <title>Creating a minimal type</title>
  *   <programlisting>
- * #include "qdev.h"
+ * #include "hw/qdev-core.h"
  *
  * #define TYPE_MY_DEVICE "my-device"
  *
@@ -144,7 +144,7 @@ typedef struct InterfaceInfo InterfaceInfo;
  * <example>
  *   <title>Overriding a virtual function</title>
  *   <programlisting>
- * #include "qdev.h"
+ * #include "hw/qdev-core.h"
  *
  * void my_device_class_init(ObjectClass *klass, void *class_data)
  * {
@@ -168,7 +168,7 @@ typedef struct InterfaceInfo InterfaceInfo;
  * <example>
  *   <title>Defining an abstract class</title>
  *   <programlisting>
- * #include "qdev.h"
+ * #include "hw/qdev-core.h"
  *
  * typedef struct MyDeviceClass
  * {
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 02/23] hw/core/qdev: Add qdev_warn_deprecated_function_used() helper
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

When built with --enable-qdev-deprecation-warning, calling
qdev_warn_deprecated_function_used() will emit a warning such:

  $ qemu-system-arm -M verdex ...
  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa2xx_lcdc_init()
  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa2xx_i2s_init()
  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa27x_keypad_init()

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
I'd rather use --enable-qdev-debug suggested here:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg719802.html
---
 configure                    |  8 ++++++++
 include/hw/qdev-deprecated.h | 26 ++++++++++++++++++++++++++
 hw/core/qdev.c               |  8 ++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 include/hw/qdev-deprecated.h

diff --git a/configure b/configure
index 8a65240d4a..aac3dc0767 100755
--- a/configure
+++ b/configure
@@ -441,6 +441,7 @@ edk2_blobs="no"
 pkgversion=""
 pie=""
 qom_cast_debug="yes"
+qdev_deprecation_warning="no"
 trace_backends="log"
 trace_file="trace"
 spice=""
@@ -1124,6 +1125,8 @@ for opt do
   ;;
   --enable-qom-cast-debug) qom_cast_debug="yes"
   ;;
+  --enable-qdev-deprecation-warning) qdev_deprecation_warning="yes"
+  ;;
   --disable-virtfs) virtfs="no"
   ;;
   --enable-virtfs) virtfs="yes"
@@ -1915,6 +1918,7 @@ disabled with --disable-FEATURE, default is enabled if available:
   virglrenderer   virgl rendering support
   xfsctl          xfsctl support
   qom-cast-debug  cast debugging support
+  qdev-deprecation-warning display qdev deprecation warnings
   tools           build qemu-io, qemu-nbd and qemu-img tools
   vxhs            Veritas HyperScale vDisk backend support
   bochs           bochs image format support
@@ -6966,6 +6970,7 @@ echo "gcov enabled      $gcov"
 echo "TPM support       $tpm"
 echo "libssh support    $libssh"
 echo "QOM debugging     $qom_cast_debug"
+echo "QDEV deprecation warnings $qdev_deprecation_warning"
 echo "Live block migration $live_block_migration"
 echo "lzo support       $lzo"
 echo "snappy support    $snappy"
@@ -7594,6 +7599,9 @@ fi
 if test "$qom_cast_debug" = "yes" ; then
   echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
 fi
+if test "$qdev_deprecation_warning" = "yes" ; then
+  echo "CONFIG_QDEV_DEPRECATION_WARNING=y" >> $config_host_mak
+fi
 if test "$rbd" = "yes" ; then
   echo "CONFIG_RBD=m" >> $config_host_mak
   echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak
diff --git a/include/hw/qdev-deprecated.h b/include/hw/qdev-deprecated.h
new file mode 100644
index 0000000000..b815f62dae
--- /dev/null
+++ b/include/hw/qdev-deprecated.h
@@ -0,0 +1,26 @@
+/*
+ * QEMU QOM qdev deprecation helpers
+ *
+ * Copyright (c) 2020 Red Hat, Inc.
+ *
+ * Author:
+ *   Philippe Mathieu-Daudé <philmd@redhat.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef HW_QDEV_DEPRECATED_H
+#define HW_QDEV_DEPRECATED_H
+
+/**
+ * qdev_warn_deprecated_function_used:
+ *
+ * Display a warning that deprecated code is used.
+ */
+#define qdev_warn_deprecated_function_used() \
+    qdev_warn_deprecated_function(__func__)
+void qdev_warn_deprecated_function(const char *function);
+
+#endif
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2131c7f951..1134f46631 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -35,6 +35,7 @@
 #include "hw/hotplug.h"
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
+#include "hw/qdev-deprecated.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
 #include "hw/qdev-clock.h"
@@ -838,6 +839,13 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)
     } while (class != object_class_by_name(TYPE_DEVICE));
 }
 
+void qdev_warn_deprecated_function(const char *function)
+{
+#ifdef CONFIG_QDEV_DEPRECATION_WARNING
+    warn_report("use of deprecated non-qdev/non-qom code in %s()", function);
+#endif
+}
+
 static bool device_get_realized(Object *obj, Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 02/23] hw/core/qdev: Add qdev_warn_deprecated_function_used() helper
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

When built with --enable-qdev-deprecation-warning, calling
qdev_warn_deprecated_function_used() will emit a warning such:

  $ qemu-system-arm -M verdex ...
  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa2xx_lcdc_init()
  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa2xx_i2s_init()
  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa27x_keypad_init()

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
I'd rather use --enable-qdev-debug suggested here:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg719802.html
---
 configure                    |  8 ++++++++
 include/hw/qdev-deprecated.h | 26 ++++++++++++++++++++++++++
 hw/core/qdev.c               |  8 ++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 include/hw/qdev-deprecated.h

diff --git a/configure b/configure
index 8a65240d4a..aac3dc0767 100755
--- a/configure
+++ b/configure
@@ -441,6 +441,7 @@ edk2_blobs="no"
 pkgversion=""
 pie=""
 qom_cast_debug="yes"
+qdev_deprecation_warning="no"
 trace_backends="log"
 trace_file="trace"
 spice=""
@@ -1124,6 +1125,8 @@ for opt do
   ;;
   --enable-qom-cast-debug) qom_cast_debug="yes"
   ;;
+  --enable-qdev-deprecation-warning) qdev_deprecation_warning="yes"
+  ;;
   --disable-virtfs) virtfs="no"
   ;;
   --enable-virtfs) virtfs="yes"
@@ -1915,6 +1918,7 @@ disabled with --disable-FEATURE, default is enabled if available:
   virglrenderer   virgl rendering support
   xfsctl          xfsctl support
   qom-cast-debug  cast debugging support
+  qdev-deprecation-warning display qdev deprecation warnings
   tools           build qemu-io, qemu-nbd and qemu-img tools
   vxhs            Veritas HyperScale vDisk backend support
   bochs           bochs image format support
@@ -6966,6 +6970,7 @@ echo "gcov enabled      $gcov"
 echo "TPM support       $tpm"
 echo "libssh support    $libssh"
 echo "QOM debugging     $qom_cast_debug"
+echo "QDEV deprecation warnings $qdev_deprecation_warning"
 echo "Live block migration $live_block_migration"
 echo "lzo support       $lzo"
 echo "snappy support    $snappy"
@@ -7594,6 +7599,9 @@ fi
 if test "$qom_cast_debug" = "yes" ; then
   echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
 fi
+if test "$qdev_deprecation_warning" = "yes" ; then
+  echo "CONFIG_QDEV_DEPRECATION_WARNING=y" >> $config_host_mak
+fi
 if test "$rbd" = "yes" ; then
   echo "CONFIG_RBD=m" >> $config_host_mak
   echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak
diff --git a/include/hw/qdev-deprecated.h b/include/hw/qdev-deprecated.h
new file mode 100644
index 0000000000..b815f62dae
--- /dev/null
+++ b/include/hw/qdev-deprecated.h
@@ -0,0 +1,26 @@
+/*
+ * QEMU QOM qdev deprecation helpers
+ *
+ * Copyright (c) 2020 Red Hat, Inc.
+ *
+ * Author:
+ *   Philippe Mathieu-Daudé <philmd@redhat.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+#ifndef HW_QDEV_DEPRECATED_H
+#define HW_QDEV_DEPRECATED_H
+
+/**
+ * qdev_warn_deprecated_function_used:
+ *
+ * Display a warning that deprecated code is used.
+ */
+#define qdev_warn_deprecated_function_used() \
+    qdev_warn_deprecated_function(__func__)
+void qdev_warn_deprecated_function(const char *function);
+
+#endif
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2131c7f951..1134f46631 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -35,6 +35,7 @@
 #include "hw/hotplug.h"
 #include "hw/irq.h"
 #include "hw/qdev-properties.h"
+#include "hw/qdev-deprecated.h"
 #include "hw/boards.h"
 #include "hw/sysbus.h"
 #include "hw/qdev-clock.h"
@@ -838,6 +839,13 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)
     } while (class != object_class_by_name(TYPE_DEVICE));
 }
 
+void qdev_warn_deprecated_function(const char *function)
+{
+#ifdef CONFIG_QDEV_DEPRECATION_WARNING
+    warn_report("use of deprecated non-qdev/non-qom code in %s()", function);
+#endif
+}
+
 static bool device_get_realized(Object *obj, Error **errp)
 {
     DeviceState *dev = DEVICE(obj);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 03/23] hw/arm/omap: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/omap1.c            | 6 ++++++
 hw/char/omap_uart.c       | 5 +++++
 hw/misc/omap_gpmc.c       | 3 +++
 hw/misc/omap_l4.c         | 3 +++
 hw/misc/omap_sdrc.c       | 3 +++
 hw/sd/omap_mmc.c          | 5 +++++
 hw/ssi/omap_spi.c         | 3 +++
 hw/timer/omap_synctimer.c | 4 ++++
 8 files changed, 32 insertions(+)

diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index 6ba0df6b6d..db4f2ee304 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -40,6 +40,7 @@
 #include "hw/sysbus.h"
 #include "qemu/cutils.h"
 #include "qemu/bcd.h"
+#include "hw/qdev-deprecated.h"
 
 static inline void omap_log_badwidth(const char *funcname, hwaddr addr, int sz)
 {
@@ -1451,6 +1452,7 @@ static struct dpll_ctl_s  *omap_dpll_init(MemoryRegion *memory,
                            hwaddr base, omap_clk clk)
 {
     struct dpll_ctl_s *s = g_malloc0(sizeof(*s));
+    qdev_warn_deprecated_function_used();
     memory_region_init_io(&s->iomem, NULL, &omap_dpll_ops, s, "omap-dpll", 0x100);
 
     s->dpll = clk;
@@ -2427,6 +2429,8 @@ static struct omap_pwl_s *omap_pwl_init(MemoryRegion *system_memory,
 {
     struct omap_pwl_s *s = g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
+
     omap_pwl_reset(s);
 
     memory_region_init_io(&s->iomem, NULL, &omap_pwl_ops, s,
@@ -2534,6 +2538,8 @@ static struct omap_pwt_s *omap_pwt_init(MemoryRegion *system_memory,
                                         omap_clk clk)
 {
     struct omap_pwt_s *s = g_malloc0(sizeof(*s));
+
+    qdev_warn_deprecated_function_used();
     s->clk = clk;
     omap_pwt_reset(s);
 
diff --git a/hw/char/omap_uart.c b/hw/char/omap_uart.c
index e8da933378..7e106772ce 100644
--- a/hw/char/omap_uart.c
+++ b/hw/char/omap_uart.c
@@ -22,6 +22,7 @@
 #include "hw/arm/omap.h"
 #include "hw/char/serial.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 /* UARTs */
 struct omap_uart_s {
@@ -57,6 +58,8 @@ struct omap_uart_s *omap_uart_init(hwaddr base,
 {
     struct omap_uart_s *s = g_new0(struct omap_uart_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     s->base = base;
     s->fclk = fclk;
     s->irq = irq;
@@ -168,6 +171,8 @@ struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem,
     struct omap_uart_s *s = omap_uart_init(base, irq,
                     fclk, iclk, txdma, rxdma, label, chr);
 
+    qdev_warn_deprecated_function_used();
+
     memory_region_init_io(&s->iomem, NULL, &omap_uart_ops, s, "omap.uart", 0x100);
 
     s->ta = ta;
diff --git a/hw/misc/omap_gpmc.c b/hw/misc/omap_gpmc.c
index 10de7a5523..9e29d7a8bd 100644
--- a/hw/misc/omap_gpmc.c
+++ b/hw/misc/omap_gpmc.c
@@ -25,6 +25,7 @@
 #include "hw/arm/omap.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 /* General-Purpose Memory Controller */
 struct omap_gpmc_s {
@@ -830,6 +831,8 @@ struct omap_gpmc_s *omap_gpmc_init(struct omap_mpu_state_s *mpu,
     int cs;
     struct omap_gpmc_s *s = g_new0(struct omap_gpmc_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     memory_region_init_io(&s->iomem, NULL, &omap_gpmc_ops, s, "omap-gpmc", 0x1000);
     memory_region_add_subregion(get_system_memory(), base, &s->iomem);
 
diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c
index 54aeaecd69..b412790c19 100644
--- a/hw/misc/omap_l4.c
+++ b/hw/misc/omap_l4.c
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "hw/arm/omap.h"
+#include "hw/qdev-deprecated.h"
 
 struct omap_l4_s {
     MemoryRegion *address_space;
@@ -33,6 +34,8 @@ struct omap_l4_s *omap_l4_init(MemoryRegion *address_space,
     struct omap_l4_s *bus = g_malloc0(
                     sizeof(*bus) + ta_num * sizeof(*bus->ta));
 
+    qdev_warn_deprecated_function_used();
+
     bus->address_space = address_space;
     bus->ta_num = ta_num;
     bus->base = base;
diff --git a/hw/misc/omap_sdrc.c b/hw/misc/omap_sdrc.c
index f2f72f6810..4f8440ea56 100644
--- a/hw/misc/omap_sdrc.c
+++ b/hw/misc/omap_sdrc.c
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "hw/arm/omap.h"
+#include "hw/qdev-deprecated.h"
 
 /* SDRAM Controller Subsystem */
 struct omap_sdrc_s {
@@ -159,6 +160,8 @@ struct omap_sdrc_s *omap_sdrc_init(MemoryRegion *sysmem,
 {
     struct omap_sdrc_s *s = g_new0(struct omap_sdrc_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     omap_sdrc_reset(s);
 
     memory_region_init_io(&s->iomem, NULL, &omap_sdrc_ops, s, "omap.sdrc", 0x1000);
diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c
index 4088a8a80b..88fd20e17a 100644
--- a/hw/sd/omap_mmc.c
+++ b/hw/sd/omap_mmc.c
@@ -24,6 +24,7 @@
 #include "hw/irq.h"
 #include "hw/arm/omap.h"
 #include "hw/sd/sd.h"
+#include "hw/qdev-deprecated.h"
 
 struct omap_mmc_s {
     qemu_irq irq;
@@ -599,6 +600,8 @@ struct omap_mmc_s *omap_mmc_init(hwaddr base,
 {
     struct omap_mmc_s *s = g_new0(struct omap_mmc_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     s->dma = dma;
     s->clk = clk;
@@ -625,6 +628,8 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
 {
     struct omap_mmc_s *s = g_new0(struct omap_mmc_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     s->dma = dma;
     s->clk = fclk;
diff --git a/hw/ssi/omap_spi.c b/hw/ssi/omap_spi.c
index 7c7e689707..276f963ae2 100644
--- a/hw/ssi/omap_spi.c
+++ b/hw/ssi/omap_spi.c
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "hw/irq.h"
 #include "hw/arm/omap.h"
+#include "hw/qdev-deprecated.h"
 
 /* Multichannel SPI */
 struct omap_mcspi_s {
@@ -353,6 +354,8 @@ struct omap_mcspi_s *omap_mcspi_init(struct omap_target_agent_s *ta, int chnum,
     struct omap_mcspi_s *s = g_new0(struct omap_mcspi_s, 1);
     struct omap_mcspi_ch_s *ch = s->ch;
 
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     s->chnum = chnum;
     while (chnum --) {
diff --git a/hw/timer/omap_synctimer.c b/hw/timer/omap_synctimer.c
index 72b997939b..4be24e970e 100644
--- a/hw/timer/omap_synctimer.c
+++ b/hw/timer/omap_synctimer.c
@@ -20,6 +20,8 @@
 #include "qemu/osdep.h"
 #include "qemu/timer.h"
 #include "hw/arm/omap.h"
+#include "hw/qdev-deprecated.h"
+
 struct omap_synctimer_s {
     MemoryRegion iomem;
     uint32_t val;
@@ -101,6 +103,8 @@ struct omap_synctimer_s *omap_synctimer_init(struct omap_target_agent_s *ta,
 {
     struct omap_synctimer_s *s = g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
+
     omap_synctimer_reset(s);
     memory_region_init_io(&s->iomem, NULL, &omap_synctimer_ops, s, "omap.synctimer",
                           omap_l4_region_size(ta, 0));
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 03/23] hw/arm/omap: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/omap1.c            | 6 ++++++
 hw/char/omap_uart.c       | 5 +++++
 hw/misc/omap_gpmc.c       | 3 +++
 hw/misc/omap_l4.c         | 3 +++
 hw/misc/omap_sdrc.c       | 3 +++
 hw/sd/omap_mmc.c          | 5 +++++
 hw/ssi/omap_spi.c         | 3 +++
 hw/timer/omap_synctimer.c | 4 ++++
 8 files changed, 32 insertions(+)

diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index 6ba0df6b6d..db4f2ee304 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -40,6 +40,7 @@
 #include "hw/sysbus.h"
 #include "qemu/cutils.h"
 #include "qemu/bcd.h"
+#include "hw/qdev-deprecated.h"
 
 static inline void omap_log_badwidth(const char *funcname, hwaddr addr, int sz)
 {
@@ -1451,6 +1452,7 @@ static struct dpll_ctl_s  *omap_dpll_init(MemoryRegion *memory,
                            hwaddr base, omap_clk clk)
 {
     struct dpll_ctl_s *s = g_malloc0(sizeof(*s));
+    qdev_warn_deprecated_function_used();
     memory_region_init_io(&s->iomem, NULL, &omap_dpll_ops, s, "omap-dpll", 0x100);
 
     s->dpll = clk;
@@ -2427,6 +2429,8 @@ static struct omap_pwl_s *omap_pwl_init(MemoryRegion *system_memory,
 {
     struct omap_pwl_s *s = g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
+
     omap_pwl_reset(s);
 
     memory_region_init_io(&s->iomem, NULL, &omap_pwl_ops, s,
@@ -2534,6 +2538,8 @@ static struct omap_pwt_s *omap_pwt_init(MemoryRegion *system_memory,
                                         omap_clk clk)
 {
     struct omap_pwt_s *s = g_malloc0(sizeof(*s));
+
+    qdev_warn_deprecated_function_used();
     s->clk = clk;
     omap_pwt_reset(s);
 
diff --git a/hw/char/omap_uart.c b/hw/char/omap_uart.c
index e8da933378..7e106772ce 100644
--- a/hw/char/omap_uart.c
+++ b/hw/char/omap_uart.c
@@ -22,6 +22,7 @@
 #include "hw/arm/omap.h"
 #include "hw/char/serial.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 /* UARTs */
 struct omap_uart_s {
@@ -57,6 +58,8 @@ struct omap_uart_s *omap_uart_init(hwaddr base,
 {
     struct omap_uart_s *s = g_new0(struct omap_uart_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     s->base = base;
     s->fclk = fclk;
     s->irq = irq;
@@ -168,6 +171,8 @@ struct omap_uart_s *omap2_uart_init(MemoryRegion *sysmem,
     struct omap_uart_s *s = omap_uart_init(base, irq,
                     fclk, iclk, txdma, rxdma, label, chr);
 
+    qdev_warn_deprecated_function_used();
+
     memory_region_init_io(&s->iomem, NULL, &omap_uart_ops, s, "omap.uart", 0x100);
 
     s->ta = ta;
diff --git a/hw/misc/omap_gpmc.c b/hw/misc/omap_gpmc.c
index 10de7a5523..9e29d7a8bd 100644
--- a/hw/misc/omap_gpmc.c
+++ b/hw/misc/omap_gpmc.c
@@ -25,6 +25,7 @@
 #include "hw/arm/omap.h"
 #include "exec/memory.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 /* General-Purpose Memory Controller */
 struct omap_gpmc_s {
@@ -830,6 +831,8 @@ struct omap_gpmc_s *omap_gpmc_init(struct omap_mpu_state_s *mpu,
     int cs;
     struct omap_gpmc_s *s = g_new0(struct omap_gpmc_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     memory_region_init_io(&s->iomem, NULL, &omap_gpmc_ops, s, "omap-gpmc", 0x1000);
     memory_region_add_subregion(get_system_memory(), base, &s->iomem);
 
diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c
index 54aeaecd69..b412790c19 100644
--- a/hw/misc/omap_l4.c
+++ b/hw/misc/omap_l4.c
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "hw/arm/omap.h"
+#include "hw/qdev-deprecated.h"
 
 struct omap_l4_s {
     MemoryRegion *address_space;
@@ -33,6 +34,8 @@ struct omap_l4_s *omap_l4_init(MemoryRegion *address_space,
     struct omap_l4_s *bus = g_malloc0(
                     sizeof(*bus) + ta_num * sizeof(*bus->ta));
 
+    qdev_warn_deprecated_function_used();
+
     bus->address_space = address_space;
     bus->ta_num = ta_num;
     bus->base = base;
diff --git a/hw/misc/omap_sdrc.c b/hw/misc/omap_sdrc.c
index f2f72f6810..4f8440ea56 100644
--- a/hw/misc/omap_sdrc.c
+++ b/hw/misc/omap_sdrc.c
@@ -19,6 +19,7 @@
  */
 #include "qemu/osdep.h"
 #include "hw/arm/omap.h"
+#include "hw/qdev-deprecated.h"
 
 /* SDRAM Controller Subsystem */
 struct omap_sdrc_s {
@@ -159,6 +160,8 @@ struct omap_sdrc_s *omap_sdrc_init(MemoryRegion *sysmem,
 {
     struct omap_sdrc_s *s = g_new0(struct omap_sdrc_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     omap_sdrc_reset(s);
 
     memory_region_init_io(&s->iomem, NULL, &omap_sdrc_ops, s, "omap.sdrc", 0x1000);
diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c
index 4088a8a80b..88fd20e17a 100644
--- a/hw/sd/omap_mmc.c
+++ b/hw/sd/omap_mmc.c
@@ -24,6 +24,7 @@
 #include "hw/irq.h"
 #include "hw/arm/omap.h"
 #include "hw/sd/sd.h"
+#include "hw/qdev-deprecated.h"
 
 struct omap_mmc_s {
     qemu_irq irq;
@@ -599,6 +600,8 @@ struct omap_mmc_s *omap_mmc_init(hwaddr base,
 {
     struct omap_mmc_s *s = g_new0(struct omap_mmc_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     s->dma = dma;
     s->clk = clk;
@@ -625,6 +628,8 @@ struct omap_mmc_s *omap2_mmc_init(struct omap_target_agent_s *ta,
 {
     struct omap_mmc_s *s = g_new0(struct omap_mmc_s, 1);
 
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     s->dma = dma;
     s->clk = fclk;
diff --git a/hw/ssi/omap_spi.c b/hw/ssi/omap_spi.c
index 7c7e689707..276f963ae2 100644
--- a/hw/ssi/omap_spi.c
+++ b/hw/ssi/omap_spi.c
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "hw/irq.h"
 #include "hw/arm/omap.h"
+#include "hw/qdev-deprecated.h"
 
 /* Multichannel SPI */
 struct omap_mcspi_s {
@@ -353,6 +354,8 @@ struct omap_mcspi_s *omap_mcspi_init(struct omap_target_agent_s *ta, int chnum,
     struct omap_mcspi_s *s = g_new0(struct omap_mcspi_s, 1);
     struct omap_mcspi_ch_s *ch = s->ch;
 
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     s->chnum = chnum;
     while (chnum --) {
diff --git a/hw/timer/omap_synctimer.c b/hw/timer/omap_synctimer.c
index 72b997939b..4be24e970e 100644
--- a/hw/timer/omap_synctimer.c
+++ b/hw/timer/omap_synctimer.c
@@ -20,6 +20,8 @@
 #include "qemu/osdep.h"
 #include "qemu/timer.h"
 #include "hw/arm/omap.h"
+#include "hw/qdev-deprecated.h"
+
 struct omap_synctimer_s {
     MemoryRegion iomem;
     uint32_t val;
@@ -101,6 +103,8 @@ struct omap_synctimer_s *omap_synctimer_init(struct omap_target_agent_s *ta,
 {
     struct omap_synctimer_s *s = g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
+
     omap_synctimer_reset(s);
     memory_region_init_io(&s->iomem, NULL, &omap_synctimer_ops, s, "omap.synctimer",
                           omap_l4_region_size(ta, 0));
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 04/23] hw/arm/pxa2xx: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/pxa2xx.c          | 3 +++
 hw/display/pxa2xx_lcd.c  | 3 +++
 hw/input/pxa2xx_keypad.c | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index f104a33463..adc7263e59 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -27,6 +27,7 @@
 #include "sysemu/qtest.h"
 #include "qemu/cutils.h"
 #include "qemu/log.h"
+#include "hw/qdev-deprecated.h"
 
 static struct {
     hwaddr io_base;
@@ -1768,6 +1769,8 @@ static PXA2xxI2SState *pxa2xx_i2s_init(MemoryRegion *sysmem,
 {
     PXA2xxI2SState *s = g_new0(PXA2xxI2SState, 1);
 
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     s->rx_dma = rx_dma;
     s->tx_dma = tx_dma;
diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c
index ff90104b80..cf6241ff21 100644
--- a/hw/display/pxa2xx_lcd.c
+++ b/hw/display/pxa2xx_lcd.c
@@ -20,6 +20,7 @@
 /* FIXME: For graphic_rotate. Should probably be done in common code.  */
 #include "sysemu/sysemu.h"
 #include "framebuffer.h"
+#include "hw/qdev-deprecated.h"
 
 struct DMAChannel {
     uint32_t branch;
@@ -1011,6 +1012,8 @@ PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem,
     PXA2xxLCDState *s;
     DisplaySurface *surface;
 
+    qdev_warn_deprecated_function_used();
+
     s = (PXA2xxLCDState *) g_malloc0(sizeof(PXA2xxLCDState));
     s->invalidated = 1;
     s->irq = irq;
diff --git a/hw/input/pxa2xx_keypad.c b/hw/input/pxa2xx_keypad.c
index 62aa6f6b15..6de1e9e4bb 100644
--- a/hw/input/pxa2xx_keypad.c
+++ b/hw/input/pxa2xx_keypad.c
@@ -17,6 +17,7 @@
 #include "migration/vmstate.h"
 #include "hw/arm/pxa.h"
 #include "ui/console.h"
+#include "hw/qdev-deprecated.h"
 
 /*
  * Keypad
@@ -316,6 +317,8 @@ PXA2xxKeyPadState *pxa27x_keypad_init(MemoryRegion *sysmem,
 {
     PXA2xxKeyPadState *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = (PXA2xxKeyPadState *) g_malloc0(sizeof(PXA2xxKeyPadState));
     s->irq = irq;
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 04/23] hw/arm/pxa2xx: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/pxa2xx.c          | 3 +++
 hw/display/pxa2xx_lcd.c  | 3 +++
 hw/input/pxa2xx_keypad.c | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index f104a33463..adc7263e59 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -27,6 +27,7 @@
 #include "sysemu/qtest.h"
 #include "qemu/cutils.h"
 #include "qemu/log.h"
+#include "hw/qdev-deprecated.h"
 
 static struct {
     hwaddr io_base;
@@ -1768,6 +1769,8 @@ static PXA2xxI2SState *pxa2xx_i2s_init(MemoryRegion *sysmem,
 {
     PXA2xxI2SState *s = g_new0(PXA2xxI2SState, 1);
 
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     s->rx_dma = rx_dma;
     s->tx_dma = tx_dma;
diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c
index ff90104b80..cf6241ff21 100644
--- a/hw/display/pxa2xx_lcd.c
+++ b/hw/display/pxa2xx_lcd.c
@@ -20,6 +20,7 @@
 /* FIXME: For graphic_rotate. Should probably be done in common code.  */
 #include "sysemu/sysemu.h"
 #include "framebuffer.h"
+#include "hw/qdev-deprecated.h"
 
 struct DMAChannel {
     uint32_t branch;
@@ -1011,6 +1012,8 @@ PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem,
     PXA2xxLCDState *s;
     DisplaySurface *surface;
 
+    qdev_warn_deprecated_function_used();
+
     s = (PXA2xxLCDState *) g_malloc0(sizeof(PXA2xxLCDState));
     s->invalidated = 1;
     s->irq = irq;
diff --git a/hw/input/pxa2xx_keypad.c b/hw/input/pxa2xx_keypad.c
index 62aa6f6b15..6de1e9e4bb 100644
--- a/hw/input/pxa2xx_keypad.c
+++ b/hw/input/pxa2xx_keypad.c
@@ -17,6 +17,7 @@
 #include "migration/vmstate.h"
 #include "hw/arm/pxa.h"
 #include "ui/console.h"
+#include "hw/qdev-deprecated.h"
 
 /*
  * Keypad
@@ -316,6 +317,8 @@ PXA2xxKeyPadState *pxa27x_keypad_init(MemoryRegion *sysmem,
 {
     PXA2xxKeyPadState *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = (PXA2xxKeyPadState *) g_malloc0(sizeof(PXA2xxKeyPadState));
     s->irq = irq;
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 05/23] hw/arm/nseries: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index 428a2a2c5a..e647ec32e3 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -44,6 +44,7 @@
 #include "hw/sysbus.h"
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 /* Nokia N8x0 support */
 struct n800_s {
@@ -703,6 +704,7 @@ static void *mipid_init(void)
 {
     struct mipid_s *s = (struct mipid_s *) g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
     s->id = 0x838f03;
     mipid_reset(s);
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 05/23] hw/arm/nseries: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index 428a2a2c5a..e647ec32e3 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -44,6 +44,7 @@
 #include "hw/sysbus.h"
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 /* Nokia N8x0 support */
 struct n800_s {
@@ -703,6 +704,7 @@ static void *mipid_init(void)
 {
     struct mipid_s *s = (struct mipid_s *) g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
     s->id = 0x838f03;
     mipid_reset(s);
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 06/23] hw/char/parallel: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index c0f34bf924..02eb1a7ef4 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -36,6 +36,7 @@
 #include "hw/char/parallel.h"
 #include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
+#include "hw/qdev-deprecated.h"
 #include "trace.h"
 
 //#define DEBUG_PARALLEL
@@ -621,6 +622,8 @@ bool parallel_mm_init(MemoryRegion *address_space,
 {
     ParallelState *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(ParallelState));
     s->irq = irq;
     qemu_chr_fe_init(&s->chr, chr, &error_abort);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 06/23] hw/char/parallel: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/char/parallel.c b/hw/char/parallel.c
index c0f34bf924..02eb1a7ef4 100644
--- a/hw/char/parallel.c
+++ b/hw/char/parallel.c
@@ -36,6 +36,7 @@
 #include "hw/char/parallel.h"
 #include "sysemu/reset.h"
 #include "sysemu/sysemu.h"
+#include "hw/qdev-deprecated.h"
 #include "trace.h"
 
 //#define DEBUG_PARALLEL
@@ -621,6 +622,8 @@ bool parallel_mm_init(MemoryRegion *address_space,
 {
     ParallelState *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(ParallelState));
     s->irq = irq;
     qemu_chr_fe_init(&s->chr, chr, &error_abort);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 07/23] hw/display/blizzard: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c
index 105241577d..74557b152b 100644
--- a/hw/display/blizzard.c
+++ b/hw/display/blizzard.c
@@ -23,6 +23,7 @@
 #include "ui/console.h"
 #include "hw/display/blizzard.h"
 #include "ui/pixel_ops.h"
+#include "hw/qdev-deprecated.h"
 
 typedef void (*blizzard_fn_t)(uint8_t *, const uint8_t *, unsigned int);
 
@@ -1010,6 +1011,8 @@ void *s1d13745_init(qemu_irq gpio_int)
     BlizzardState *s = (BlizzardState *) g_malloc0(sizeof(*s));
     DisplaySurface *surface;
 
+    qdev_warn_deprecated_function_used();
+
     s->fb = g_malloc(0x180000);
 
     s->con = graphic_console_init(NULL, 0, &blizzard_ops, s);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 07/23] hw/display/blizzard: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c
index 105241577d..74557b152b 100644
--- a/hw/display/blizzard.c
+++ b/hw/display/blizzard.c
@@ -23,6 +23,7 @@
 #include "ui/console.h"
 #include "hw/display/blizzard.h"
 #include "ui/pixel_ops.h"
+#include "hw/qdev-deprecated.h"
 
 typedef void (*blizzard_fn_t)(uint8_t *, const uint8_t *, unsigned int);
 
@@ -1010,6 +1011,8 @@ void *s1d13745_init(qemu_irq gpio_int)
     BlizzardState *s = (BlizzardState *) g_malloc0(sizeof(*s));
     DisplaySurface *surface;
 
+    qdev_warn_deprecated_function_used();
+
     s->fb = g_malloc(0x180000);
 
     s->con = graphic_console_init(NULL, 0, &blizzard_ops, s);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 08/23] hw/display/ramfb: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c
index 79b9754a58..a4a427e5c7 100644
--- a/hw/display/ramfb.c
+++ b/hw/display/ramfb.c
@@ -18,6 +18,7 @@
 #include "hw/display/bochs-vbe.h" /* for limits */
 #include "ui/console.h"
 #include "sysemu/reset.h"
+#include "hw/qdev-deprecated.h"
 
 struct QEMU_PACKED RAMFBCfg {
     uint64_t addr;
@@ -120,6 +121,8 @@ RAMFBState *ramfb_setup(Error **errp)
     FWCfgState *fw_cfg = fw_cfg_find();
     RAMFBState *s;
 
+    qdev_warn_deprecated_function_used();
+
     if (!fw_cfg || !fw_cfg->dma_enabled) {
         error_setg(errp, "ramfb device requires fw_cfg with DMA");
         return NULL;
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 08/23] hw/display/ramfb: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c
index 79b9754a58..a4a427e5c7 100644
--- a/hw/display/ramfb.c
+++ b/hw/display/ramfb.c
@@ -18,6 +18,7 @@
 #include "hw/display/bochs-vbe.h" /* for limits */
 #include "ui/console.h"
 #include "sysemu/reset.h"
+#include "hw/qdev-deprecated.h"
 
 struct QEMU_PACKED RAMFBCfg {
     uint64_t addr;
@@ -120,6 +121,8 @@ RAMFBState *ramfb_setup(Error **errp)
     FWCfgState *fw_cfg = fw_cfg_find();
     RAMFBState *s;
 
+    qdev_warn_deprecated_function_used();
+
     if (!fw_cfg || !fw_cfg->dma_enabled) {
         error_setg(errp, "ramfb device requires fw_cfg with DMA");
         return NULL;
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 09/23] hw/display/tc6393xb: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c
index 49a676d1b0..e4900e9502 100644
--- a/hw/display/tc6393xb.c
+++ b/hw/display/tc6393xb.c
@@ -21,6 +21,7 @@
 #include "ui/console.h"
 #include "ui/pixel_ops.h"
 #include "sysemu/blockdev.h"
+#include "hw/qdev-deprecated.h"
 
 #define IRQ_TC6393_NAND		0
 #define IRQ_TC6393_MMC		1
@@ -556,6 +557,8 @@ TC6393xbState *tc6393xb_init(MemoryRegion *sysmem, uint32_t base, qemu_irq irq)
         },
     };
 
+    qdev_warn_deprecated_function_used();
+
     s = (TC6393xbState *) g_malloc0(sizeof(TC6393xbState));
     s->irq = irq;
     s->gpio_in = qemu_allocate_irqs(tc6393xb_gpio_set, s, TC6393XB_GPIOS);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 09/23] hw/display/tc6393xb: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c
index 49a676d1b0..e4900e9502 100644
--- a/hw/display/tc6393xb.c
+++ b/hw/display/tc6393xb.c
@@ -21,6 +21,7 @@
 #include "ui/console.h"
 #include "ui/pixel_ops.h"
 #include "sysemu/blockdev.h"
+#include "hw/qdev-deprecated.h"
 
 #define IRQ_TC6393_NAND		0
 #define IRQ_TC6393_MMC		1
@@ -556,6 +557,8 @@ TC6393xbState *tc6393xb_init(MemoryRegion *sysmem, uint32_t base, qemu_irq irq)
         },
     };
 
+    qdev_warn_deprecated_function_used();
+
     s = (TC6393xbState *) g_malloc0(sizeof(TC6393xbState));
     s->irq = irq;
     s->gpio_in = qemu_allocate_irqs(tc6393xb_gpio_set, s, TC6393XB_GPIOS);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 10/23] hw/display/vga-isa-mm: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/display/vga-isa-mm.c | 5 +++++
 hw/display/vga.c        | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/hw/display/vga-isa-mm.c b/hw/display/vga-isa-mm.c
index 7321b7a06d..3e62389b63 100644
--- a/hw/display/vga-isa-mm.c
+++ b/hw/display/vga-isa-mm.c
@@ -29,6 +29,7 @@
 #include "hw/display/vga.h"
 #include "vga_int.h"
 #include "ui/pixel_ops.h"
+#include "hw/qdev-deprecated.h"
 
 #define VGA_RAM_SIZE (8 * MiB)
 
@@ -71,6 +72,8 @@ static void vga_mm_init(ISAVGAMMState *s, hwaddr vram_base,
 {
     MemoryRegion *s_ioport_ctrl, *vga_io_memory;
 
+    qdev_warn_deprecated_function_used();
+
     s->it_shift = it_shift;
     s_ioport_ctrl = g_malloc(sizeof(*s_ioport_ctrl));
     memory_region_init_io(s_ioport_ctrl, NULL, &vga_mm_ctrl_ops, s,
@@ -99,6 +102,8 @@ int isa_vga_mm_init(hwaddr vram_base,
 
     s = g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
+
     s->vga.vram_size_mb = VGA_RAM_SIZE / MiB;
     s->vga.global_vmstate = true;
     vga_common_init(&s->vga, NULL);
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 061fd9ab8f..d59a9c896b 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -35,6 +35,7 @@
 #include "hw/xen/xen.h"
 #include "migration/vmstate.h"
 #include "trace.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_VGA_MEM
 //#define DEBUG_VGA_REG
@@ -2262,6 +2263,8 @@ MemoryRegion *vga_init_io(VGACommonState *s, Object *obj,
 {
     MemoryRegion *vga_mem;
 
+    qdev_warn_deprecated_function_used();
+
     *vga_ports = vga_portio_list;
     *vbe_ports = vbe_portio_list;
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 10/23] hw/display/vga-isa-mm: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/display/vga-isa-mm.c | 5 +++++
 hw/display/vga.c        | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/hw/display/vga-isa-mm.c b/hw/display/vga-isa-mm.c
index 7321b7a06d..3e62389b63 100644
--- a/hw/display/vga-isa-mm.c
+++ b/hw/display/vga-isa-mm.c
@@ -29,6 +29,7 @@
 #include "hw/display/vga.h"
 #include "vga_int.h"
 #include "ui/pixel_ops.h"
+#include "hw/qdev-deprecated.h"
 
 #define VGA_RAM_SIZE (8 * MiB)
 
@@ -71,6 +72,8 @@ static void vga_mm_init(ISAVGAMMState *s, hwaddr vram_base,
 {
     MemoryRegion *s_ioport_ctrl, *vga_io_memory;
 
+    qdev_warn_deprecated_function_used();
+
     s->it_shift = it_shift;
     s_ioport_ctrl = g_malloc(sizeof(*s_ioport_ctrl));
     memory_region_init_io(s_ioport_ctrl, NULL, &vga_mm_ctrl_ops, s,
@@ -99,6 +102,8 @@ int isa_vga_mm_init(hwaddr vram_base,
 
     s = g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
+
     s->vga.vram_size_mb = VGA_RAM_SIZE / MiB;
     s->vga.global_vmstate = true;
     vga_common_init(&s->vga, NULL);
diff --git a/hw/display/vga.c b/hw/display/vga.c
index 061fd9ab8f..d59a9c896b 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -35,6 +35,7 @@
 #include "hw/xen/xen.h"
 #include "migration/vmstate.h"
 #include "trace.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_VGA_MEM
 //#define DEBUG_VGA_REG
@@ -2262,6 +2263,8 @@ MemoryRegion *vga_init_io(VGACommonState *s, Object *obj,
 {
     MemoryRegion *vga_mem;
 
+    qdev_warn_deprecated_function_used();
+
     *vga_ports = vga_portio_list;
     *vbe_ports = vbe_portio_list;
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 11/23] hw/dma/etraxfs_dma: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c
index c4334e87bf..d2f7e7ca9d 100644
--- a/hw/dma/etraxfs_dma.c
+++ b/hw/dma/etraxfs_dma.c
@@ -28,7 +28,7 @@
 #include "qemu/main-loop.h"
 #include "sysemu/runstate.h"
 #include "exec/address-spaces.h"
-
+#include "hw/qdev-deprecated.h"
 #include "hw/cris/etraxfs_dma.h"
 
 #define D(x)
@@ -765,6 +765,8 @@ void *etraxfs_dmac_init(hwaddr base, int nr_channels)
 {
 	struct fs_dma_ctrl *ctrl = NULL;
 
+    qdev_warn_deprecated_function_used();
+
 	ctrl = g_malloc0(sizeof *ctrl);
 
         ctrl->bh = qemu_bh_new(DMA_run, ctrl);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 11/23] hw/dma/etraxfs_dma: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/dma/etraxfs_dma.c b/hw/dma/etraxfs_dma.c
index c4334e87bf..d2f7e7ca9d 100644
--- a/hw/dma/etraxfs_dma.c
+++ b/hw/dma/etraxfs_dma.c
@@ -28,7 +28,7 @@
 #include "qemu/main-loop.h"
 #include "sysemu/runstate.h"
 #include "exec/address-spaces.h"
-
+#include "hw/qdev-deprecated.h"
 #include "hw/cris/etraxfs_dma.h"
 
 #define D(x)
@@ -765,6 +765,8 @@ void *etraxfs_dmac_init(hwaddr base, int nr_channels)
 {
 	struct fs_dma_ctrl *ctrl = NULL;
 
+    qdev_warn_deprecated_function_used();
+
 	ctrl = g_malloc0(sizeof *ctrl);
 
         ctrl->bh = qemu_bh_new(DMA_run, ctrl);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 12/23] hw/dma/soc_dma: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c
index 3a430057f5..22fd8c38b0 100644
--- a/hw/dma/soc_dma.c
+++ b/hw/dma/soc_dma.c
@@ -21,6 +21,7 @@
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "hw/arm/soc_dma.h"
+#include "hw/qdev-deprecated.h"
 
 static void transfer_mem2mem(struct soc_dma_ch_s *ch)
 {
@@ -242,6 +243,8 @@ struct soc_dma_s *soc_dma_init(int n)
     int i;
     struct dma_s *s = g_malloc0(sizeof(*s) + n * sizeof(*s->ch));
 
+    qdev_warn_deprecated_function_used();
+
     s->chnum = n;
     s->soc.ch = s->ch;
     for (i = 0; i < n; i ++) {
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 12/23] hw/dma/soc_dma: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c
index 3a430057f5..22fd8c38b0 100644
--- a/hw/dma/soc_dma.c
+++ b/hw/dma/soc_dma.c
@@ -21,6 +21,7 @@
 #include "qemu/error-report.h"
 #include "qemu/timer.h"
 #include "hw/arm/soc_dma.h"
+#include "hw/qdev-deprecated.h"
 
 static void transfer_mem2mem(struct soc_dma_ch_s *ch)
 {
@@ -242,6 +243,8 @@ struct soc_dma_s *soc_dma_init(int n)
     int i;
     struct dma_s *s = g_malloc0(sizeof(*s) + n * sizeof(*s->ch));
 
+    qdev_warn_deprecated_function_used();
+
     s->chnum = n;
     s->soc.ch = s->ch;
     for (i = 0; i < n; i ++) {
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 13/23] hw/input/lasips2: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c
index 0786e57338..452244f037 100644
--- a/hw/input/lasips2.c
+++ b/hw/input/lasips2.c
@@ -34,7 +34,7 @@
 #include "exec/address-spaces.h"
 #include "migration/vmstate.h"
 #include "hw/irq.h"
-
+#include "hw/qdev-deprecated.h"
 
 struct LASIPS2State;
 typedef struct LASIPS2Port {
@@ -269,6 +269,8 @@ void lasips2_init(MemoryRegion *address_space,
 {
     LASIPS2State *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(LASIPS2State));
 
     s->irq = irq;
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 13/23] hw/input/lasips2: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c
index 0786e57338..452244f037 100644
--- a/hw/input/lasips2.c
+++ b/hw/input/lasips2.c
@@ -34,7 +34,7 @@
 #include "exec/address-spaces.h"
 #include "migration/vmstate.h"
 #include "hw/irq.h"
-
+#include "hw/qdev-deprecated.h"
 
 struct LASIPS2State;
 typedef struct LASIPS2Port {
@@ -269,6 +269,8 @@ void lasips2_init(MemoryRegion *address_space,
 {
     LASIPS2State *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(LASIPS2State));
 
     s->irq = irq;
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 14/23] hw/input/tsc2005: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c
index 55d61cc843..1f97b82379 100644
--- a/hw/input/tsc2005.c
+++ b/hw/input/tsc2005.c
@@ -27,6 +27,7 @@
 #include "hw/irq.h"
 #include "migration/vmstate.h"
 #include "trace.h"
+#include "hw/qdev-deprecated.h"
 
 #define TSC_CUT_RESOLUTION(value, p)	((value) >> (16 - (p ? 12 : 10)))
 
@@ -489,6 +490,8 @@ void *tsc2005_init(qemu_irq pintdav)
 {
     TSC2005State *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = (TSC2005State *)
             g_malloc0(sizeof(TSC2005State));
     s->x = 400;
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 14/23] hw/input/tsc2005: Emit warning when old code is used
@ 2020-07-04 15:38   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c
index 55d61cc843..1f97b82379 100644
--- a/hw/input/tsc2005.c
+++ b/hw/input/tsc2005.c
@@ -27,6 +27,7 @@
 #include "hw/irq.h"
 #include "migration/vmstate.h"
 #include "trace.h"
+#include "hw/qdev-deprecated.h"
 
 #define TSC_CUT_RESOLUTION(value, p)	((value) >> (16 - (p ? 12 : 10)))
 
@@ -489,6 +490,8 @@ void *tsc2005_init(qemu_irq pintdav)
 {
     TSC2005State *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = (TSC2005State *)
             g_malloc0(sizeof(TSC2005State));
     s->x = 400;
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 15/23] hw/m68k/mcf520x: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v2: Add comment (thuth)
---
 hw/m68k/mcf5206.c | 5 +++++
 hw/m68k/mcf5208.c | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c
index a2fef04f8e..ec0d176674 100644
--- a/hw/m68k/mcf5206.c
+++ b/hw/m68k/mcf5206.c
@@ -16,6 +16,7 @@
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
 #include "sysemu/sysemu.h"
+#include "hw/qdev-deprecated.h"
 
 /* General purpose timer module.  */
 typedef struct {
@@ -144,6 +145,8 @@ static m5206_timer_state *m5206_timer_init(qemu_irq irq)
 {
     m5206_timer_state *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_new0(m5206_timer_state, 1);
     s->timer = ptimer_init(m5206_timer_trigger, s, PTIMER_POLICY_DEFAULT);
     s->irq = irq;
@@ -566,6 +569,8 @@ qemu_irq *mcf5206_init(MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu)
     m5206_mbar_state *s;
     qemu_irq *pic;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_new0(m5206_mbar_state, 1);
 
     memory_region_init_io(&s->iomem, NULL, &m5206_mbar_ops, s,
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index d310a98e7b..0bfcbb6332 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -26,6 +26,7 @@
 #include "hw/sysbus.h"
 #include "elf.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 #define SYS_FREQ 166666666
 
@@ -194,7 +195,9 @@ static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic)
     /* SDRAMC.  */
     memory_region_init_io(iomem, NULL, &m5208_sys_ops, NULL, "m5208-sys", 0x00004000);
     memory_region_add_subregion(address_space, 0xfc0a8000, iomem);
+
     /* Timers.  */
+    qdev_warn_deprecated_function_used(); /* m5208_timer_state is not QOM */
     for (i = 0; i < 2; i++) {
         s = g_new0(m5208_timer_state, 1);
         s->timer = ptimer_init(m5208_timer_trigger, s, PTIMER_POLICY_DEFAULT);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 15/23] hw/m68k/mcf520x: Emit warning when old code is used
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
v2: Add comment (thuth)
---
 hw/m68k/mcf5206.c | 5 +++++
 hw/m68k/mcf5208.c | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c
index a2fef04f8e..ec0d176674 100644
--- a/hw/m68k/mcf5206.c
+++ b/hw/m68k/mcf5206.c
@@ -16,6 +16,7 @@
 #include "qemu/timer.h"
 #include "hw/ptimer.h"
 #include "sysemu/sysemu.h"
+#include "hw/qdev-deprecated.h"
 
 /* General purpose timer module.  */
 typedef struct {
@@ -144,6 +145,8 @@ static m5206_timer_state *m5206_timer_init(qemu_irq irq)
 {
     m5206_timer_state *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_new0(m5206_timer_state, 1);
     s->timer = ptimer_init(m5206_timer_trigger, s, PTIMER_POLICY_DEFAULT);
     s->irq = irq;
@@ -566,6 +569,8 @@ qemu_irq *mcf5206_init(MemoryRegion *sysmem, uint32_t base, M68kCPU *cpu)
     m5206_mbar_state *s;
     qemu_irq *pic;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_new0(m5206_mbar_state, 1);
 
     memory_region_init_io(&s->iomem, NULL, &m5206_mbar_ops, s,
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index d310a98e7b..0bfcbb6332 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -26,6 +26,7 @@
 #include "hw/sysbus.h"
 #include "elf.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 #define SYS_FREQ 166666666
 
@@ -194,7 +195,9 @@ static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic)
     /* SDRAMC.  */
     memory_region_init_io(iomem, NULL, &m5208_sys_ops, NULL, "m5208-sys", 0x00004000);
     memory_region_add_subregion(address_space, 0xfc0a8000, iomem);
+
     /* Timers.  */
+    qdev_warn_deprecated_function_used(); /* m5208_timer_state is not QOM */
     for (i = 0; i < 2; i++) {
         s = g_new0(m5208_timer_state, 1);
         s->timer = ptimer_init(m5208_timer_trigger, s, PTIMER_POLICY_DEFAULT);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 16/23] hw/misc/cbus: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c
index 3c3721ad2d..24e197684f 100644
--- a/hw/misc/cbus.c
+++ b/hw/misc/cbus.c
@@ -25,6 +25,7 @@
 #include "hw/irq.h"
 #include "hw/misc/cbus.h"
 #include "sysemu/runstate.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG
 
@@ -135,6 +136,8 @@ CBus *cbus_init(qemu_irq dat)
 {
     CBusPriv *s = (CBusPriv *) g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
+
     s->dat_out = dat;
     s->cbus.clk = qemu_allocate_irq(cbus_clk, s, 0);
     s->cbus.dat = qemu_allocate_irq(cbus_dat, s, 0);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 16/23] hw/misc/cbus: Emit warning when old code is used
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c
index 3c3721ad2d..24e197684f 100644
--- a/hw/misc/cbus.c
+++ b/hw/misc/cbus.c
@@ -25,6 +25,7 @@
 #include "hw/irq.h"
 #include "hw/misc/cbus.h"
 #include "sysemu/runstate.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG
 
@@ -135,6 +136,8 @@ CBus *cbus_init(qemu_irq dat)
 {
     CBusPriv *s = (CBusPriv *) g_malloc0(sizeof(*s));
 
+    qdev_warn_deprecated_function_used();
+
     s->dat_out = dat;
     s->cbus.clk = qemu_allocate_irq(cbus_clk, s, 0);
     s->cbus.dat = qemu_allocate_irq(cbus_dat, s, 0);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 17/23] hw/nvram/eeprom93xx: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/nvram/eeprom93xx.c b/hw/nvram/eeprom93xx.c
index ca6f591c84..56603ea42b 100644
--- a/hw/nvram/eeprom93xx.c
+++ b/hw/nvram/eeprom93xx.c
@@ -39,6 +39,7 @@
 #include "hw/nvram/eeprom93xx.h"
 #include "migration/qemu-file-types.h"
 #include "migration/vmstate.h"
+#include "hw/qdev-deprecated.h"
 
 /* Debug EEPROM emulation. */
 //~ #define DEBUG_EEPROM
@@ -300,6 +301,8 @@ eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords)
     eeprom_t *eeprom;
     uint8_t addrbits;
 
+    qdev_warn_deprecated_function_used();
+
     switch (nwords) {
     case 16:
     case 64:
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 17/23] hw/nvram/eeprom93xx: Emit warning when old code is used
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/nvram/eeprom93xx.c b/hw/nvram/eeprom93xx.c
index ca6f591c84..56603ea42b 100644
--- a/hw/nvram/eeprom93xx.c
+++ b/hw/nvram/eeprom93xx.c
@@ -39,6 +39,7 @@
 #include "hw/nvram/eeprom93xx.h"
 #include "migration/qemu-file-types.h"
 #include "migration/vmstate.h"
+#include "hw/qdev-deprecated.h"
 
 /* Debug EEPROM emulation. */
 //~ #define DEBUG_EEPROM
@@ -300,6 +301,8 @@ eeprom_t *eeprom93xx_new(DeviceState *dev, uint16_t nwords)
     eeprom_t *eeprom;
     uint8_t addrbits;
 
+    qdev_warn_deprecated_function_used();
+
     switch (nwords) {
     case 16:
     case 64:
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 18/23] hw/openrisc/cputimer: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c
index 93268815d8..60f2c9667f 100644
--- a/hw/openrisc/cputimer.c
+++ b/hw/openrisc/cputimer.c
@@ -22,6 +22,7 @@
 #include "cpu.h"
 #include "migration/vmstate.h"
 #include "qemu/timer.h"
+#include "hw/qdev-deprecated.h"
 
 #define TIMER_PERIOD 50 /* 50 ns period for 20 MHz timer */
 
@@ -135,6 +136,8 @@ static const VMStateDescription vmstate_or1k_timer = {
 
 void cpu_openrisc_clock_init(OpenRISCCPU *cpu)
 {
+    qdev_warn_deprecated_function_used();
+
     cpu->env.timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &openrisc_timer_cb, cpu);
     cpu->env.ttmr = 0x00000000;
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 18/23] hw/openrisc/cputimer: Emit warning when old code is used
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c
index 93268815d8..60f2c9667f 100644
--- a/hw/openrisc/cputimer.c
+++ b/hw/openrisc/cputimer.c
@@ -22,6 +22,7 @@
 #include "cpu.h"
 #include "migration/vmstate.h"
 #include "qemu/timer.h"
+#include "hw/qdev-deprecated.h"
 
 #define TIMER_PERIOD 50 /* 50 ns period for 20 MHz timer */
 
@@ -135,6 +136,8 @@ static const VMStateDescription vmstate_or1k_timer = {
 
 void cpu_openrisc_clock_init(OpenRISCCPU *cpu)
 {
+    qdev_warn_deprecated_function_used();
+
     cpu->env.timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &openrisc_timer_cb, cpu);
     cpu->env.ttmr = 0x00000000;
 
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 19/23] hw/ppc/ppc4xx: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/ppc/ppc405_boards.c |  5 +++++
 hw/ppc/ppc405_uc.c     | 21 +++++++++++++++++++++
 hw/ppc/ppc4xx_devs.c   |  7 +++++++
 3 files changed, 33 insertions(+)

diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 6198ec1035..eb1216b5f0 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -41,6 +41,7 @@
 #include "hw/loader.h"
 #include "exec/address-spaces.h"
 #include "qemu/cutils.h"
+#include "hw/qdev-deprecated.h"
 
 #define BIOS_FILENAME "ppc405_rom.bin"
 #define BIOS_SIZE (2 * MiB)
@@ -129,6 +130,8 @@ static void ref405ep_fpga_init(MemoryRegion *sysmem, uint32_t base)
     ref405ep_fpga_t *fpga;
     MemoryRegion *fpga_memory = g_new(MemoryRegion, 1);
 
+    qdev_warn_deprecated_function_used();
+
     fpga = g_malloc0(sizeof(ref405ep_fpga_t));
     memory_region_init_io(fpga_memory, NULL, &ref405ep_fpga_ops, fpga,
                           "fpga", 0x00000100);
@@ -408,6 +411,8 @@ static void taihu_cpld_init(MemoryRegion *sysmem, uint32_t base)
     taihu_cpld_t *cpld;
     MemoryRegion *cpld_memory = g_new(MemoryRegion, 1);
 
+    qdev_warn_deprecated_function_used();
+
     cpld = g_malloc0(sizeof(taihu_cpld_t));
     memory_region_init_io(cpld_memory, NULL, &taihu_cpld_ops, cpld, "cpld", 0x100);
     memory_region_add_subregion(sysmem, base, cpld_memory);
diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c
index 381720aced..160604c62e 100644
--- a/hw/ppc/ppc405_uc.c
+++ b/hw/ppc/ppc405_uc.c
@@ -36,6 +36,7 @@
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_OPBA
 //#define DEBUG_SDRAM
@@ -182,6 +183,8 @@ void ppc4xx_plb_init(CPUPPCState *env)
 {
     ppc4xx_plb_t *plb;
 
+    qdev_warn_deprecated_function_used();
+
     plb = g_malloc0(sizeof(ppc4xx_plb_t));
     ppc_dcr_register(env, PLB3A0_ACR, plb, &dcr_read_plb, &dcr_write_plb);
     ppc_dcr_register(env, PLB4A0_ACR, plb, &dcr_read_plb, &dcr_write_plb);
@@ -267,6 +270,8 @@ static void ppc4xx_pob_init(CPUPPCState *env)
 {
     ppc4xx_pob_t *pob;
 
+    qdev_warn_deprecated_function_used();
+
     pob = g_malloc0(sizeof(ppc4xx_pob_t));
     ppc_dcr_register(env, POB0_BEAR, pob, &dcr_read_pob, &dcr_write_pob);
     ppc_dcr_register(env, POB0_BESR0, pob, &dcr_read_pob, &dcr_write_pob);
@@ -351,6 +356,8 @@ static void ppc4xx_opba_init(hwaddr base)
 {
     ppc4xx_opba_t *opba;
 
+    qdev_warn_deprecated_function_used();
+
     opba = g_malloc0(sizeof(ppc4xx_opba_t));
 #ifdef DEBUG_OPBA
     printf("%s: offset " TARGET_FMT_plx "\n", __func__, base);
@@ -549,6 +556,8 @@ void ppc405_ebc_init(CPUPPCState *env)
 {
     ppc4xx_ebc_t *ebc;
 
+    qdev_warn_deprecated_function_used();
+
     ebc = g_malloc0(sizeof(ppc4xx_ebc_t));
     qemu_register_reset(&ebc_reset, ebc);
     ppc_dcr_register(env, EBC0_CFGADDR,
@@ -632,6 +641,8 @@ static void ppc405_dma_init(CPUPPCState *env, qemu_irq irqs[4])
 {
     ppc405_dma_t *dma;
 
+    qdev_warn_deprecated_function_used();
+
     dma = g_malloc0(sizeof(ppc405_dma_t));
     memcpy(dma->irqs, irqs, 4 * sizeof(qemu_irq));
     qemu_register_reset(&ppc405_dma_reset, dma);
@@ -735,6 +746,8 @@ static void ppc405_gpio_init(hwaddr base)
 {
     ppc405_gpio_t *gpio;
 
+    qdev_warn_deprecated_function_used();
+
     gpio = g_malloc0(sizeof(ppc405_gpio_t));
 #ifdef DEBUG_GPIO
     printf("%s: offset " TARGET_FMT_plx "\n", __func__, base);
@@ -897,6 +910,8 @@ static void ppc405_ocm_init(CPUPPCState *env)
 {
     ppc405_ocm_t *ocm;
 
+    qdev_warn_deprecated_function_used();
+
     ocm = g_malloc0(sizeof(ppc405_ocm_t));
     /* XXX: Size is 4096 or 0x04000000 */
     memory_region_init_ram(&ocm->isarc_ram, NULL, "ppc405.ocm", 4 * KiB,
@@ -1142,6 +1157,8 @@ static void ppc4xx_gpt_init(hwaddr base, qemu_irq irqs[5])
     ppc4xx_gpt_t *gpt;
     int i;
 
+    qdev_warn_deprecated_function_used();
+
     gpt = g_malloc0(sizeof(ppc4xx_gpt_t));
     for (i = 0; i < 5; i++) {
         gpt->irqs[i] = irqs[i];
@@ -1410,6 +1427,8 @@ static void ppc405cr_cpc_init (CPUPPCState *env, clk_setup_t clk_setup[7],
 {
     ppc405cr_cpc_t *cpc;
 
+    qdev_warn_deprecated_function_used();
+
     cpc = g_malloc0(sizeof(ppc405cr_cpc_t));
     memcpy(cpc->clk_setup, clk_setup,
            PPC405CR_CLK_NB * sizeof(clk_setup_t));
@@ -1755,6 +1774,8 @@ static void ppc405ep_cpc_init (CPUPPCState *env, clk_setup_t clk_setup[8],
 {
     ppc405ep_cpc_t *cpc;
 
+    qdev_warn_deprecated_function_used();
+
     cpc = g_malloc0(sizeof(ppc405ep_cpc_t));
     memcpy(cpc->clk_setup, clk_setup,
            PPC405EP_CLK_NB * sizeof(clk_setup_t));
diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c
index f1651e04d9..b09d7ab5c6 100644
--- a/hw/ppc/ppc4xx_devs.c
+++ b/hw/ppc/ppc4xx_devs.c
@@ -33,6 +33,7 @@
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
+#include "hw/qdev-deprecated.h"
 
 /*#define DEBUG_UIC*/
 
@@ -303,6 +304,8 @@ qemu_irq *ppcuic_init (CPUPPCState *env, qemu_irq *irqs,
     ppcuic_t *uic;
     int i;
 
+    qdev_warn_deprecated_function_used();
+
     uic = g_malloc0(sizeof(ppcuic_t));
     uic->dcr_base = dcr_base;
     uic->irqs = irqs;
@@ -647,6 +650,8 @@ void ppc4xx_sdram_init (CPUPPCState *env, qemu_irq irq, int nbanks,
 {
     ppc4xx_sdram_t *sdram;
 
+    qdev_warn_deprecated_function_used();
+
     sdram = g_malloc0(sizeof(ppc4xx_sdram_t));
     sdram->irq = irq;
     sdram->nbanks = nbanks;
@@ -908,6 +913,8 @@ void ppc4xx_mal_init(CPUPPCState *env, uint8_t txcnum, uint8_t rxcnum,
     ppc4xx_mal_t *mal;
     int i;
 
+    qdev_warn_deprecated_function_used();
+
     assert(txcnum <= 32 && rxcnum <= 32);
     mal = g_malloc0(sizeof(*mal));
     mal->txcnum = txcnum;
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 19/23] hw/ppc/ppc4xx: Emit warning when old code is used
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/ppc/ppc405_boards.c |  5 +++++
 hw/ppc/ppc405_uc.c     | 21 +++++++++++++++++++++
 hw/ppc/ppc4xx_devs.c   |  7 +++++++
 3 files changed, 33 insertions(+)

diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c
index 6198ec1035..eb1216b5f0 100644
--- a/hw/ppc/ppc405_boards.c
+++ b/hw/ppc/ppc405_boards.c
@@ -41,6 +41,7 @@
 #include "hw/loader.h"
 #include "exec/address-spaces.h"
 #include "qemu/cutils.h"
+#include "hw/qdev-deprecated.h"
 
 #define BIOS_FILENAME "ppc405_rom.bin"
 #define BIOS_SIZE (2 * MiB)
@@ -129,6 +130,8 @@ static void ref405ep_fpga_init(MemoryRegion *sysmem, uint32_t base)
     ref405ep_fpga_t *fpga;
     MemoryRegion *fpga_memory = g_new(MemoryRegion, 1);
 
+    qdev_warn_deprecated_function_used();
+
     fpga = g_malloc0(sizeof(ref405ep_fpga_t));
     memory_region_init_io(fpga_memory, NULL, &ref405ep_fpga_ops, fpga,
                           "fpga", 0x00000100);
@@ -408,6 +411,8 @@ static void taihu_cpld_init(MemoryRegion *sysmem, uint32_t base)
     taihu_cpld_t *cpld;
     MemoryRegion *cpld_memory = g_new(MemoryRegion, 1);
 
+    qdev_warn_deprecated_function_used();
+
     cpld = g_malloc0(sizeof(taihu_cpld_t));
     memory_region_init_io(cpld_memory, NULL, &taihu_cpld_ops, cpld, "cpld", 0x100);
     memory_region_add_subregion(sysmem, base, cpld_memory);
diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c
index 381720aced..160604c62e 100644
--- a/hw/ppc/ppc405_uc.c
+++ b/hw/ppc/ppc405_uc.c
@@ -36,6 +36,7 @@
 #include "sysemu/sysemu.h"
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_OPBA
 //#define DEBUG_SDRAM
@@ -182,6 +183,8 @@ void ppc4xx_plb_init(CPUPPCState *env)
 {
     ppc4xx_plb_t *plb;
 
+    qdev_warn_deprecated_function_used();
+
     plb = g_malloc0(sizeof(ppc4xx_plb_t));
     ppc_dcr_register(env, PLB3A0_ACR, plb, &dcr_read_plb, &dcr_write_plb);
     ppc_dcr_register(env, PLB4A0_ACR, plb, &dcr_read_plb, &dcr_write_plb);
@@ -267,6 +270,8 @@ static void ppc4xx_pob_init(CPUPPCState *env)
 {
     ppc4xx_pob_t *pob;
 
+    qdev_warn_deprecated_function_used();
+
     pob = g_malloc0(sizeof(ppc4xx_pob_t));
     ppc_dcr_register(env, POB0_BEAR, pob, &dcr_read_pob, &dcr_write_pob);
     ppc_dcr_register(env, POB0_BESR0, pob, &dcr_read_pob, &dcr_write_pob);
@@ -351,6 +356,8 @@ static void ppc4xx_opba_init(hwaddr base)
 {
     ppc4xx_opba_t *opba;
 
+    qdev_warn_deprecated_function_used();
+
     opba = g_malloc0(sizeof(ppc4xx_opba_t));
 #ifdef DEBUG_OPBA
     printf("%s: offset " TARGET_FMT_plx "\n", __func__, base);
@@ -549,6 +556,8 @@ void ppc405_ebc_init(CPUPPCState *env)
 {
     ppc4xx_ebc_t *ebc;
 
+    qdev_warn_deprecated_function_used();
+
     ebc = g_malloc0(sizeof(ppc4xx_ebc_t));
     qemu_register_reset(&ebc_reset, ebc);
     ppc_dcr_register(env, EBC0_CFGADDR,
@@ -632,6 +641,8 @@ static void ppc405_dma_init(CPUPPCState *env, qemu_irq irqs[4])
 {
     ppc405_dma_t *dma;
 
+    qdev_warn_deprecated_function_used();
+
     dma = g_malloc0(sizeof(ppc405_dma_t));
     memcpy(dma->irqs, irqs, 4 * sizeof(qemu_irq));
     qemu_register_reset(&ppc405_dma_reset, dma);
@@ -735,6 +746,8 @@ static void ppc405_gpio_init(hwaddr base)
 {
     ppc405_gpio_t *gpio;
 
+    qdev_warn_deprecated_function_used();
+
     gpio = g_malloc0(sizeof(ppc405_gpio_t));
 #ifdef DEBUG_GPIO
     printf("%s: offset " TARGET_FMT_plx "\n", __func__, base);
@@ -897,6 +910,8 @@ static void ppc405_ocm_init(CPUPPCState *env)
 {
     ppc405_ocm_t *ocm;
 
+    qdev_warn_deprecated_function_used();
+
     ocm = g_malloc0(sizeof(ppc405_ocm_t));
     /* XXX: Size is 4096 or 0x04000000 */
     memory_region_init_ram(&ocm->isarc_ram, NULL, "ppc405.ocm", 4 * KiB,
@@ -1142,6 +1157,8 @@ static void ppc4xx_gpt_init(hwaddr base, qemu_irq irqs[5])
     ppc4xx_gpt_t *gpt;
     int i;
 
+    qdev_warn_deprecated_function_used();
+
     gpt = g_malloc0(sizeof(ppc4xx_gpt_t));
     for (i = 0; i < 5; i++) {
         gpt->irqs[i] = irqs[i];
@@ -1410,6 +1427,8 @@ static void ppc405cr_cpc_init (CPUPPCState *env, clk_setup_t clk_setup[7],
 {
     ppc405cr_cpc_t *cpc;
 
+    qdev_warn_deprecated_function_used();
+
     cpc = g_malloc0(sizeof(ppc405cr_cpc_t));
     memcpy(cpc->clk_setup, clk_setup,
            PPC405CR_CLK_NB * sizeof(clk_setup_t));
@@ -1755,6 +1774,8 @@ static void ppc405ep_cpc_init (CPUPPCState *env, clk_setup_t clk_setup[8],
 {
     ppc405ep_cpc_t *cpc;
 
+    qdev_warn_deprecated_function_used();
+
     cpc = g_malloc0(sizeof(ppc405ep_cpc_t));
     memcpy(cpc->clk_setup, clk_setup,
            PPC405EP_CLK_NB * sizeof(clk_setup_t));
diff --git a/hw/ppc/ppc4xx_devs.c b/hw/ppc/ppc4xx_devs.c
index f1651e04d9..b09d7ab5c6 100644
--- a/hw/ppc/ppc4xx_devs.c
+++ b/hw/ppc/ppc4xx_devs.c
@@ -33,6 +33,7 @@
 #include "qemu/log.h"
 #include "exec/address-spaces.h"
 #include "qemu/error-report.h"
+#include "hw/qdev-deprecated.h"
 
 /*#define DEBUG_UIC*/
 
@@ -303,6 +304,8 @@ qemu_irq *ppcuic_init (CPUPPCState *env, qemu_irq *irqs,
     ppcuic_t *uic;
     int i;
 
+    qdev_warn_deprecated_function_used();
+
     uic = g_malloc0(sizeof(ppcuic_t));
     uic->dcr_base = dcr_base;
     uic->irqs = irqs;
@@ -647,6 +650,8 @@ void ppc4xx_sdram_init (CPUPPCState *env, qemu_irq irq, int nbanks,
 {
     ppc4xx_sdram_t *sdram;
 
+    qdev_warn_deprecated_function_used();
+
     sdram = g_malloc0(sizeof(ppc4xx_sdram_t));
     sdram->irq = irq;
     sdram->nbanks = nbanks;
@@ -908,6 +913,8 @@ void ppc4xx_mal_init(CPUPPCState *env, uint8_t txcnum, uint8_t rxcnum,
     ppc4xx_mal_t *mal;
     int i;
 
+    qdev_warn_deprecated_function_used();
+
     assert(txcnum <= 32 && rxcnum <= 32);
     mal = g_malloc0(sizeof(*mal));
     mal->txcnum = txcnum;
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 20/23] hw/sh4: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/char/sh_serial.c | 3 +++
 hw/intc/sh_intc.c   | 3 +++
 hw/sh4/r2d.c        | 3 +++
 hw/sh4/sh7750.c     | 4 ++++
 hw/timer/sh_timer.c | 5 +++++
 5 files changed, 18 insertions(+)

diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c
index 167f4d8cb9..9366a23dd2 100644
--- a/hw/char/sh_serial.c
+++ b/hw/char/sh_serial.c
@@ -31,6 +31,7 @@
 #include "chardev/char-fe.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_SERIAL
 
@@ -382,6 +383,8 @@ void sh_serial_init(MemoryRegion *sysmem,
 {
     sh_serial_state *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(sh_serial_state));
 
     s->feat = feat;
diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c
index 72a55e32dd..c90fbf47bb 100644
--- a/hw/intc/sh_intc.c
+++ b/hw/intc/sh_intc.c
@@ -13,6 +13,7 @@
 #include "hw/sh4/sh_intc.h"
 #include "hw/irq.h"
 #include "hw/sh4/sh.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_INTC
 //#define DEBUG_INTC_SOURCES
@@ -444,6 +445,8 @@ int sh_intc_init(MemoryRegion *sysmem,
 {
     unsigned int i, j;
 
+    qdev_warn_deprecated_function_used();
+
     desc->pending = 0;
     desc->nr_sources = nr_sources;
     desc->mask_regs = mask_regs;
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index 443820901d..5b4d383a86 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -43,6 +43,7 @@
 #include "hw/usb.h"
 #include "hw/block/flash.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 #define FLASH_BASE 0x00000000
 #define FLASH_SIZE (16 * MiB)
@@ -187,6 +188,8 @@ static qemu_irq *r2d_fpga_init(MemoryRegion *sysmem,
 {
     r2d_fpga_t *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(r2d_fpga_t));
 
     s->irl = irl;
diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c
index f8ac3ec6e3..82549139f9 100644
--- a/hw/sh4/sh7750.c
+++ b/hw/sh4/sh7750.c
@@ -33,6 +33,7 @@
 #include "hw/timer/tmu012.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
+#include "hw/qdev-deprecated.h"
 
 #define NB_DEVICES 4
 
@@ -757,6 +758,8 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem)
 {
     SH7750State *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(SH7750State));
     s->cpu = cpu;
     s->periph_freq = 60000000;	/* 60MHz */
@@ -867,6 +870,7 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem)
 
 qemu_irq sh7750_irl(SH7750State *s)
 {
+    qdev_warn_deprecated_function_used();
     sh_intc_toggle_source(sh_intc_source(&s->intc, IRL), 1, 0); /* enable */
     return qemu_allocate_irq(sh_intc_set_irl, sh_intc_source(&s->intc, IRL), 0);
 }
diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c
index bb0e1c8ee5..d0740b2ae6 100644
--- a/hw/timer/sh_timer.c
+++ b/hw/timer/sh_timer.c
@@ -15,6 +15,7 @@
 #include "hw/sh4/sh.h"
 #include "hw/timer/tmu012.h"
 #include "hw/ptimer.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_TIMER
 
@@ -200,6 +201,8 @@ static void *sh_timer_init(uint32_t freq, int feat, qemu_irq irq)
 {
     sh_timer_state *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = (sh_timer_state *)g_malloc0(sizeof(sh_timer_state));
     s->freq = freq;
     s->feat = feat;
@@ -320,6 +323,8 @@ void tmu012_init(MemoryRegion *sysmem, hwaddr base,
     tmu012_state *s;
     int timer_feat = (feat & TMU012_FEAT_EXTCLK) ? TIMER_FEAT_EXTCLK : 0;
 
+    qdev_warn_deprecated_function_used();
+
     s = (tmu012_state *)g_malloc0(sizeof(tmu012_state));
     s->feat = feat;
     s->timer[0] = sh_timer_init(freq, timer_feat, ch0_irq);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 20/23] hw/sh4: Emit warning when old code is used
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/char/sh_serial.c | 3 +++
 hw/intc/sh_intc.c   | 3 +++
 hw/sh4/r2d.c        | 3 +++
 hw/sh4/sh7750.c     | 4 ++++
 hw/timer/sh_timer.c | 5 +++++
 5 files changed, 18 insertions(+)

diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c
index 167f4d8cb9..9366a23dd2 100644
--- a/hw/char/sh_serial.c
+++ b/hw/char/sh_serial.c
@@ -31,6 +31,7 @@
 #include "chardev/char-fe.h"
 #include "qapi/error.h"
 #include "qemu/timer.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_SERIAL
 
@@ -382,6 +383,8 @@ void sh_serial_init(MemoryRegion *sysmem,
 {
     sh_serial_state *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(sh_serial_state));
 
     s->feat = feat;
diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c
index 72a55e32dd..c90fbf47bb 100644
--- a/hw/intc/sh_intc.c
+++ b/hw/intc/sh_intc.c
@@ -13,6 +13,7 @@
 #include "hw/sh4/sh_intc.h"
 #include "hw/irq.h"
 #include "hw/sh4/sh.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_INTC
 //#define DEBUG_INTC_SOURCES
@@ -444,6 +445,8 @@ int sh_intc_init(MemoryRegion *sysmem,
 {
     unsigned int i, j;
 
+    qdev_warn_deprecated_function_used();
+
     desc->pending = 0;
     desc->nr_sources = nr_sources;
     desc->mask_regs = mask_regs;
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index 443820901d..5b4d383a86 100644
--- a/hw/sh4/r2d.c
+++ b/hw/sh4/r2d.c
@@ -43,6 +43,7 @@
 #include "hw/usb.h"
 #include "hw/block/flash.h"
 #include "exec/address-spaces.h"
+#include "hw/qdev-deprecated.h"
 
 #define FLASH_BASE 0x00000000
 #define FLASH_SIZE (16 * MiB)
@@ -187,6 +188,8 @@ static qemu_irq *r2d_fpga_init(MemoryRegion *sysmem,
 {
     r2d_fpga_t *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(r2d_fpga_t));
 
     s->irl = irl;
diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c
index f8ac3ec6e3..82549139f9 100644
--- a/hw/sh4/sh7750.c
+++ b/hw/sh4/sh7750.c
@@ -33,6 +33,7 @@
 #include "hw/timer/tmu012.h"
 #include "cpu.h"
 #include "exec/exec-all.h"
+#include "hw/qdev-deprecated.h"
 
 #define NB_DEVICES 4
 
@@ -757,6 +758,8 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem)
 {
     SH7750State *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = g_malloc0(sizeof(SH7750State));
     s->cpu = cpu;
     s->periph_freq = 60000000;	/* 60MHz */
@@ -867,6 +870,7 @@ SH7750State *sh7750_init(SuperHCPU *cpu, MemoryRegion *sysmem)
 
 qemu_irq sh7750_irl(SH7750State *s)
 {
+    qdev_warn_deprecated_function_used();
     sh_intc_toggle_source(sh_intc_source(&s->intc, IRL), 1, 0); /* enable */
     return qemu_allocate_irq(sh_intc_set_irl, sh_intc_source(&s->intc, IRL), 0);
 }
diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c
index bb0e1c8ee5..d0740b2ae6 100644
--- a/hw/timer/sh_timer.c
+++ b/hw/timer/sh_timer.c
@@ -15,6 +15,7 @@
 #include "hw/sh4/sh.h"
 #include "hw/timer/tmu012.h"
 #include "hw/ptimer.h"
+#include "hw/qdev-deprecated.h"
 
 //#define DEBUG_TIMER
 
@@ -200,6 +201,8 @@ static void *sh_timer_init(uint32_t freq, int feat, qemu_irq irq)
 {
     sh_timer_state *s;
 
+    qdev_warn_deprecated_function_used();
+
     s = (sh_timer_state *)g_malloc0(sizeof(sh_timer_state));
     s->freq = freq;
     s->feat = feat;
@@ -320,6 +323,8 @@ void tmu012_init(MemoryRegion *sysmem, hwaddr base,
     tmu012_state *s;
     int timer_feat = (feat & TMU012_FEAT_EXTCLK) ? TIMER_FEAT_EXTCLK : 0;
 
+    qdev_warn_deprecated_function_used();
+
     s = (tmu012_state *)g_malloc0(sizeof(tmu012_state));
     s->feat = feat;
     s->timer[0] = sh_timer_init(freq, timer_feat, ch0_irq);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 21/23] hw/riscv: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/riscv/riscv_htif.c  | 4 ++++
 hw/riscv/sifive_uart.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c
index ca87a5cf9f..bd080dbefb 100644
--- a/hw/riscv/riscv_htif.c
+++ b/hw/riscv/riscv_htif.c
@@ -30,6 +30,7 @@
 #include "hw/riscv/riscv_htif.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
+#include "hw/qdev-deprecated.h"
 
 #define RISCV_DEBUG_HTIF 0
 #define HTIF_DEBUG(fmt, ...)                                                   \
@@ -238,6 +239,9 @@ HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
     uint64_t fromhost_offset = fromhost_addr - base;
 
     HTIFState *s = g_malloc0(sizeof(HTIFState));
+
+    qdev_warn_deprecated_function_used();
+
     s->address_space = address_space;
     s->main_mem = main_mem;
     s->main_mem_ram_ptr = memory_region_get_ram_ptr(main_mem);
diff --git a/hw/riscv/sifive_uart.c b/hw/riscv/sifive_uart.c
index 9350482662..1a5890d5f7 100644
--- a/hw/riscv/sifive_uart.c
+++ b/hw/riscv/sifive_uart.c
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "hw/irq.h"
 #include "hw/riscv/sifive_uart.h"
+#include "hw/qdev-deprecated.h"
 
 /*
  * Not yet implemented:
@@ -183,6 +184,9 @@ SiFiveUARTState *sifive_uart_create(MemoryRegion *address_space, hwaddr base,
     Chardev *chr, qemu_irq irq)
 {
     SiFiveUARTState *s = g_malloc0(sizeof(SiFiveUARTState));
+
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     qemu_chr_fe_init(&s->chr, chr, &error_abort);
     qemu_chr_fe_set_handlers(&s->chr, uart_can_rx, uart_rx, uart_event,
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 21/23] hw/riscv: Emit warning when old code is used
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/riscv/riscv_htif.c  | 4 ++++
 hw/riscv/sifive_uart.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c
index ca87a5cf9f..bd080dbefb 100644
--- a/hw/riscv/riscv_htif.c
+++ b/hw/riscv/riscv_htif.c
@@ -30,6 +30,7 @@
 #include "hw/riscv/riscv_htif.h"
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
+#include "hw/qdev-deprecated.h"
 
 #define RISCV_DEBUG_HTIF 0
 #define HTIF_DEBUG(fmt, ...)                                                   \
@@ -238,6 +239,9 @@ HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
     uint64_t fromhost_offset = fromhost_addr - base;
 
     HTIFState *s = g_malloc0(sizeof(HTIFState));
+
+    qdev_warn_deprecated_function_used();
+
     s->address_space = address_space;
     s->main_mem = main_mem;
     s->main_mem_ram_ptr = memory_region_get_ram_ptr(main_mem);
diff --git a/hw/riscv/sifive_uart.c b/hw/riscv/sifive_uart.c
index 9350482662..1a5890d5f7 100644
--- a/hw/riscv/sifive_uart.c
+++ b/hw/riscv/sifive_uart.c
@@ -25,6 +25,7 @@
 #include "hw/hw.h"
 #include "hw/irq.h"
 #include "hw/riscv/sifive_uart.h"
+#include "hw/qdev-deprecated.h"
 
 /*
  * Not yet implemented:
@@ -183,6 +184,9 @@ SiFiveUARTState *sifive_uart_create(MemoryRegion *address_space, hwaddr base,
     Chardev *chr, qemu_irq irq)
 {
     SiFiveUARTState *s = g_malloc0(sizeof(SiFiveUARTState));
+
+    qdev_warn_deprecated_function_used();
+
     s->irq = irq;
     qemu_chr_fe_init(&s->chr, chr, &error_abort);
     qemu_chr_fe_set_handlers(&s->chr, uart_can_rx, uart_rx, uart_event,
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 22/23] hw/usb/hcd-musb: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c
index 85f5ff5bd4..f09464ed5e 100644
--- a/hw/usb/hcd-musb.c
+++ b/hw/usb/hcd-musb.c
@@ -26,6 +26,7 @@
 #include "hw/usb/hcd-musb.h"
 #include "hw/irq.h"
 #include "hw/hw.h"
+#include "hw/qdev-deprecated.h"
 
 /* Common USB registers */
 #define MUSB_HDRC_FADDR		0x00	/* 8-bit */
@@ -378,6 +379,8 @@ struct MUSBState *musb_init(DeviceState *parent_device, int gpio_base)
     MUSBState *s = g_malloc0(sizeof(*s));
     int i;
 
+    qdev_warn_deprecated_function_used();
+
     for (i = 0; i < musb_irq_max; i++) {
         s->irqs[i] = qdev_get_gpio_in(parent_device, gpio_base + i);
     }
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 22/23] hw/usb/hcd-musb: Emit warning when old code is used
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c
index 85f5ff5bd4..f09464ed5e 100644
--- a/hw/usb/hcd-musb.c
+++ b/hw/usb/hcd-musb.c
@@ -26,6 +26,7 @@
 #include "hw/usb/hcd-musb.h"
 #include "hw/irq.h"
 #include "hw/hw.h"
+#include "hw/qdev-deprecated.h"
 
 /* Common USB registers */
 #define MUSB_HDRC_FADDR		0x00	/* 8-bit */
@@ -378,6 +379,8 @@ struct MUSBState *musb_init(DeviceState *parent_device, int gpio_base)
     MUSBState *s = g_malloc0(sizeof(*s));
     int i;
 
+    qdev_warn_deprecated_function_used();
+
     for (i = 0; i < musb_irq_max; i++) {
         s->irqs[i] = qdev_get_gpio_in(parent_device, gpio_base + i);
     }
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 23/23] hw/xtensa/xtfpga: Emit warning when old code is used
  2020-07-04 15:38 ` Philippe Mathieu-Daudé
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, Philippe Mathieu-Daudé,
	qemu-ppc, Paolo Bonzini

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 10de15855a..ddb843e6e8 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -50,6 +50,7 @@
 #include "xtensa_memory.h"
 #include "hw/xtensa/mx_pic.h"
 #include "migration/vmstate.h"
+#include "hw/qdev-deprecated.h"
 
 typedef struct XtfpgaFlashDesc {
     hwaddr base;
@@ -129,6 +130,8 @@ static XtfpgaFpgaState *xtfpga_fpga_init(MemoryRegion *address_space,
 {
     XtfpgaFpgaState *s = g_malloc(sizeof(XtfpgaFpgaState));
 
+    qdev_warn_deprecated_function_used();
+
     memory_region_init_io(&s->iomem, NULL, &xtfpga_fpga_ops, s,
                           "xtfpga.fpga", 0x10000);
     memory_region_add_subregion(address_space, base, &s->iomem);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* [RFC PATCH v2 23/23] hw/xtensa/xtfpga: Emit warning when old code is used
@ 2020-07-04 15:39   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:39 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau,
	Philippe Mathieu-Daudé

This code hasn't been QOM'ified yet. Warn the user.

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

diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 10de15855a..ddb843e6e8 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -50,6 +50,7 @@
 #include "xtensa_memory.h"
 #include "hw/xtensa/mx_pic.h"
 #include "migration/vmstate.h"
+#include "hw/qdev-deprecated.h"
 
 typedef struct XtfpgaFlashDesc {
     hwaddr base;
@@ -129,6 +130,8 @@ static XtfpgaFpgaState *xtfpga_fpga_init(MemoryRegion *address_space,
 {
     XtfpgaFpgaState *s = g_malloc(sizeof(XtfpgaFpgaState));
 
+    qdev_warn_deprecated_function_used();
+
     memory_region_init_io(&s->iomem, NULL, &xtfpga_fpga_ops, s,
                           "xtfpga.fpga", 0x10000);
     memory_region_add_subregion(address_space, base, &s->iomem);
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 18/23] hw/openrisc/cputimer: Emit warning when old code is used
  2020-07-04 15:39   ` Philippe Mathieu-Daudé
@ 2020-07-04 15:47     ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, qemu-ppc, Paolo Bonzini

On 7/4/20 5:39 PM, 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/openrisc/cputimer.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c
> index 93268815d8..60f2c9667f 100644
> --- a/hw/openrisc/cputimer.c
> +++ b/hw/openrisc/cputimer.c
> @@ -22,6 +22,7 @@
>  #include "cpu.h"
>  #include "migration/vmstate.h"
>  #include "qemu/timer.h"
> +#include "hw/qdev-deprecated.h"
>  
>  #define TIMER_PERIOD 50 /* 50 ns period for 20 MHz timer */
>  
> @@ -135,6 +136,8 @@ static const VMStateDescription vmstate_or1k_timer = {
>  
>  void cpu_openrisc_clock_init(OpenRISCCPU *cpu)
>  {
> +    qdev_warn_deprecated_function_used();

Please disregard this patch, I forgot to address Paolo's comment:
https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg02202.html

> +
>      cpu->env.timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &openrisc_timer_cb, cpu);
>      cpu->env.ttmr = 0x00000000;
>  
> 



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 18/23] hw/openrisc/cputimer: Emit warning when old code is used
@ 2020-07-04 15:47     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-04 15:47 UTC (permalink / raw)
  To: qemu-devel
  Cc: Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv, Peter Maydell,
	Alistair Francis, Stafford Horne, Max Filippov, Eduardo Habkost,
	Yoshinori Sato, David Gibson, Michael S. Tsirkin, qemu-ppc,
	Andrzej Zaborowski, Gerd Hoffmann, Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau

On 7/4/20 5:39 PM, 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/openrisc/cputimer.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c
> index 93268815d8..60f2c9667f 100644
> --- a/hw/openrisc/cputimer.c
> +++ b/hw/openrisc/cputimer.c
> @@ -22,6 +22,7 @@
>  #include "cpu.h"
>  #include "migration/vmstate.h"
>  #include "qemu/timer.h"
> +#include "hw/qdev-deprecated.h"
>  
>  #define TIMER_PERIOD 50 /* 50 ns period for 20 MHz timer */
>  
> @@ -135,6 +136,8 @@ static const VMStateDescription vmstate_or1k_timer = {
>  
>  void cpu_openrisc_clock_init(OpenRISCCPU *cpu)
>  {
> +    qdev_warn_deprecated_function_used();

Please disregard this patch, I forgot to address Paolo's comment:
https://lists.gnu.org/archive/html/qemu-devel/2020-06/msg02202.html

> +
>      cpu->env.timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &openrisc_timer_cb, cpu);
>      cpu->env.ttmr = 0x00000000;
>  
> 



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 02/23] hw/core/qdev: Add qdev_warn_deprecated_function_used() helper
  2020-07-04 15:38   ` Philippe Mathieu-Daudé
@ 2020-07-04 16:22     ` BALATON Zoltan
  -1 siblings, 0 replies; 60+ messages in thread
From: BALATON Zoltan @ 2020-07-04 16:22 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin, qemu-devel,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Yoshinori Sato,
	Magnus Damm, Marc-André Lureau, Eduardo Habkost,
	Alistair Francis, qemu-arm, qemu-riscv, Stafford Horne,
	Palmer Dabbelt, David Gibson, Daniel P. Berrangé,
	Thomas Huth, Bastian Koppelmann, qemu-ppc, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 5349 bytes --]

On Sat, 4 Jul 2020, Philippe Mathieu-Daudé wrote:
> When built with --enable-qdev-deprecation-warning, calling
> qdev_warn_deprecated_function_used() will emit a warning such:
>
>  $ qemu-system-arm -M verdex ...
>  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa2xx_lcdc_init()
>  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa2xx_i2s_init()
>  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa27x_keypad_init()
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> I'd rather use --enable-qdev-debug suggested here:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg719802.html
> ---
> configure                    |  8 ++++++++
> include/hw/qdev-deprecated.h | 26 ++++++++++++++++++++++++++
> hw/core/qdev.c               |  8 ++++++++
> 3 files changed, 42 insertions(+)
> create mode 100644 include/hw/qdev-deprecated.h
>
> diff --git a/configure b/configure
> index 8a65240d4a..aac3dc0767 100755
> --- a/configure
> +++ b/configure
> @@ -441,6 +441,7 @@ edk2_blobs="no"
> pkgversion=""
> pie=""
> qom_cast_debug="yes"
> +qdev_deprecation_warning="no"
> trace_backends="log"
> trace_file="trace"
> spice=""
> @@ -1124,6 +1125,8 @@ for opt do
>   ;;
>   --enable-qom-cast-debug) qom_cast_debug="yes"
>   ;;
> +  --enable-qdev-deprecation-warning) qdev_deprecation_warning="yes"
> +  ;;
>   --disable-virtfs) virtfs="no"
>   ;;
>   --enable-virtfs) virtfs="yes"
> @@ -1915,6 +1918,7 @@ disabled with --disable-FEATURE, default is enabled if available:
>   virglrenderer   virgl rendering support
>   xfsctl          xfsctl support
>   qom-cast-debug  cast debugging support
> +  qdev-deprecation-warning display qdev deprecation warnings
>   tools           build qemu-io, qemu-nbd and qemu-img tools
>   vxhs            Veritas HyperScale vDisk backend support
>   bochs           bochs image format support
> @@ -6966,6 +6970,7 @@ echo "gcov enabled      $gcov"
> echo "TPM support       $tpm"
> echo "libssh support    $libssh"
> echo "QOM debugging     $qom_cast_debug"
> +echo "QDEV deprecation warnings $qdev_deprecation_warning"
> echo "Live block migration $live_block_migration"
> echo "lzo support       $lzo"
> echo "snappy support    $snappy"
> @@ -7594,6 +7599,9 @@ fi
> if test "$qom_cast_debug" = "yes" ; then
>   echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
> fi
> +if test "$qdev_deprecation_warning" = "yes" ; then
> +  echo "CONFIG_QDEV_DEPRECATION_WARNING=y" >> $config_host_mak
> +fi
> if test "$rbd" = "yes" ; then
>   echo "CONFIG_RBD=m" >> $config_host_mak
>   echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak
> diff --git a/include/hw/qdev-deprecated.h b/include/hw/qdev-deprecated.h
> new file mode 100644
> index 0000000000..b815f62dae
> --- /dev/null
> +++ b/include/hw/qdev-deprecated.h
> @@ -0,0 +1,26 @@
> +/*
> + * QEMU QOM qdev deprecation helpers
> + *
> + * Copyright (c) 2020 Red Hat, Inc.
> + *
> + * Author:
> + *   Philippe Mathieu-Daudé <philmd@redhat.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#ifndef HW_QDEV_DEPRECATED_H
> +#define HW_QDEV_DEPRECATED_H
> +
> +/**
> + * qdev_warn_deprecated_function_used:
> + *
> + * Display a warning that deprecated code is used.
> + */
> +#define qdev_warn_deprecated_function_used() \
> +    qdev_warn_deprecated_function(__func__)
> +void qdev_warn_deprecated_function(const char *function);
> +
> +#endif
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index 2131c7f951..1134f46631 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -35,6 +35,7 @@
> #include "hw/hotplug.h"
> #include "hw/irq.h"
> #include "hw/qdev-properties.h"
> +#include "hw/qdev-deprecated.h"
> #include "hw/boards.h"
> #include "hw/sysbus.h"
> #include "hw/qdev-clock.h"
> @@ -838,6 +839,13 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)
>     } while (class != object_class_by_name(TYPE_DEVICE));
> }
>
> +void qdev_warn_deprecated_function(const char *function)
> +{
> +#ifdef CONFIG_QDEV_DEPRECATION_WARNING
> +    warn_report("use of deprecated non-qdev/non-qom code in %s()", function);
> +#endif
> +}
> +
> static bool device_get_realized(Object *obj, Error **errp)
> {
>     DeviceState *dev = DEVICE(obj);
>

I haven't noticed this series before so sorry that I only comment now. I 
was first thinking maybe you could use qdev_log_mask with some LOG_* value 
instead of #ifdef and warn_report so it can be enabled during runtime with 
some -d option but then I saw that this does not magically detect the 
sites that should be warned about but has to be added manually everywhere. 
In that case, it's probably easier to just add a FIXME comment to the 
places you'd call this function because that's where developers who could 
convert these will see it and probably more effective than having them to 
enable an option that they may not even know about and then search for 
where the warnings are coming from. So likely they'll just see the call in 
source for which a comment is also suffucient and then you can drop this 
patch but keep the rest and not throw away the work of identifying all the 
places that need to be modernised that you've done.

Regards,
BALATON Zoltan

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 02/23] hw/core/qdev: Add qdev_warn_deprecated_function_used() helper
@ 2020-07-04 16:22     ` BALATON Zoltan
  0 siblings, 0 replies; 60+ messages in thread
From: BALATON Zoltan @ 2020-07-04 16:22 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Yoshinori Sato,
	Magnus Damm, Palmer Dabbelt, Andrzej Zaborowski, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, qemu-ppc, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 5349 bytes --]

On Sat, 4 Jul 2020, Philippe Mathieu-Daudé wrote:
> When built with --enable-qdev-deprecation-warning, calling
> qdev_warn_deprecated_function_used() will emit a warning such:
>
>  $ qemu-system-arm -M verdex ...
>  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa2xx_lcdc_init()
>  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa2xx_i2s_init()
>  qemu-system-arm: warning: use of deprecated non-qdev/non-qom code in pxa27x_keypad_init()
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> I'd rather use --enable-qdev-debug suggested here:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg719802.html
> ---
> configure                    |  8 ++++++++
> include/hw/qdev-deprecated.h | 26 ++++++++++++++++++++++++++
> hw/core/qdev.c               |  8 ++++++++
> 3 files changed, 42 insertions(+)
> create mode 100644 include/hw/qdev-deprecated.h
>
> diff --git a/configure b/configure
> index 8a65240d4a..aac3dc0767 100755
> --- a/configure
> +++ b/configure
> @@ -441,6 +441,7 @@ edk2_blobs="no"
> pkgversion=""
> pie=""
> qom_cast_debug="yes"
> +qdev_deprecation_warning="no"
> trace_backends="log"
> trace_file="trace"
> spice=""
> @@ -1124,6 +1125,8 @@ for opt do
>   ;;
>   --enable-qom-cast-debug) qom_cast_debug="yes"
>   ;;
> +  --enable-qdev-deprecation-warning) qdev_deprecation_warning="yes"
> +  ;;
>   --disable-virtfs) virtfs="no"
>   ;;
>   --enable-virtfs) virtfs="yes"
> @@ -1915,6 +1918,7 @@ disabled with --disable-FEATURE, default is enabled if available:
>   virglrenderer   virgl rendering support
>   xfsctl          xfsctl support
>   qom-cast-debug  cast debugging support
> +  qdev-deprecation-warning display qdev deprecation warnings
>   tools           build qemu-io, qemu-nbd and qemu-img tools
>   vxhs            Veritas HyperScale vDisk backend support
>   bochs           bochs image format support
> @@ -6966,6 +6970,7 @@ echo "gcov enabled      $gcov"
> echo "TPM support       $tpm"
> echo "libssh support    $libssh"
> echo "QOM debugging     $qom_cast_debug"
> +echo "QDEV deprecation warnings $qdev_deprecation_warning"
> echo "Live block migration $live_block_migration"
> echo "lzo support       $lzo"
> echo "snappy support    $snappy"
> @@ -7594,6 +7599,9 @@ fi
> if test "$qom_cast_debug" = "yes" ; then
>   echo "CONFIG_QOM_CAST_DEBUG=y" >> $config_host_mak
> fi
> +if test "$qdev_deprecation_warning" = "yes" ; then
> +  echo "CONFIG_QDEV_DEPRECATION_WARNING=y" >> $config_host_mak
> +fi
> if test "$rbd" = "yes" ; then
>   echo "CONFIG_RBD=m" >> $config_host_mak
>   echo "RBD_CFLAGS=$rbd_cflags" >> $config_host_mak
> diff --git a/include/hw/qdev-deprecated.h b/include/hw/qdev-deprecated.h
> new file mode 100644
> index 0000000000..b815f62dae
> --- /dev/null
> +++ b/include/hw/qdev-deprecated.h
> @@ -0,0 +1,26 @@
> +/*
> + * QEMU QOM qdev deprecation helpers
> + *
> + * Copyright (c) 2020 Red Hat, Inc.
> + *
> + * Author:
> + *   Philippe Mathieu-Daudé <philmd@redhat.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + *
> + * This work is licensed under the terms of the GNU GPL, version 2 or later.
> + * See the COPYING file in the top-level directory.
> + */
> +#ifndef HW_QDEV_DEPRECATED_H
> +#define HW_QDEV_DEPRECATED_H
> +
> +/**
> + * qdev_warn_deprecated_function_used:
> + *
> + * Display a warning that deprecated code is used.
> + */
> +#define qdev_warn_deprecated_function_used() \
> +    qdev_warn_deprecated_function(__func__)
> +void qdev_warn_deprecated_function(const char *function);
> +
> +#endif
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index 2131c7f951..1134f46631 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -35,6 +35,7 @@
> #include "hw/hotplug.h"
> #include "hw/irq.h"
> #include "hw/qdev-properties.h"
> +#include "hw/qdev-deprecated.h"
> #include "hw/boards.h"
> #include "hw/sysbus.h"
> #include "hw/qdev-clock.h"
> @@ -838,6 +839,13 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)
>     } while (class != object_class_by_name(TYPE_DEVICE));
> }
>
> +void qdev_warn_deprecated_function(const char *function)
> +{
> +#ifdef CONFIG_QDEV_DEPRECATION_WARNING
> +    warn_report("use of deprecated non-qdev/non-qom code in %s()", function);
> +#endif
> +}
> +
> static bool device_get_realized(Object *obj, Error **errp)
> {
>     DeviceState *dev = DEVICE(obj);
>

I haven't noticed this series before so sorry that I only comment now. I 
was first thinking maybe you could use qdev_log_mask with some LOG_* value 
instead of #ifdef and warn_report so it can be enabled during runtime with 
some -d option but then I saw that this does not magically detect the 
sites that should be warned about but has to be added manually everywhere. 
In that case, it's probably easier to just add a FIXME comment to the 
places you'd call this function because that's where developers who could 
convert these will see it and probably more effective than having them to 
enable an option that they may not even know about and then search for 
where the warnings are coming from. So likely they'll just see the call in 
source for which a comment is also suffucient and then you can drop this 
patch but keep the rest and not throw away the work of identifying all the 
places that need to be modernised that you've done.

Regards,
BALATON Zoltan

^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 15/23] hw/m68k/mcf520x: Emit warning when old code is used
  2020-07-04 15:39   ` Philippe Mathieu-Daudé
@ 2020-07-05  6:31     ` Thomas Huth
  -1 siblings, 0 replies; 60+ messages in thread
From: Thomas Huth @ 2020-07-05  6:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin, qemu-devel,
	Max Filippov, Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau, qemu-riscv,
	Stafford Horne, David Gibson, Daniel P. Berrangé,
	Bastian Koppelmann, qemu-ppc, Paolo Bonzini

Am Sat,  4 Jul 2020 17:39:00 +0200
schrieb Philippe Mathieu-Daudé <philmd@redhat.com>:

> This code hasn't been QOM'ified yet. Warn the user.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> v2: Add comment (thuth)
> ---
>  hw/m68k/mcf5206.c | 5 +++++
>  hw/m68k/mcf5208.c | 3 +++
>  2 files changed, 8 insertions(+)

Acked-by: Thomas Huth <huth@tuxfamily.org>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 15/23] hw/m68k/mcf520x: Emit warning when old code is used
@ 2020-07-05  6:31     ` Thomas Huth
  0 siblings, 0 replies; 60+ messages in thread
From: Thomas Huth @ 2020-07-05  6:31 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv,
	Peter Maydell, Alistair Francis, Stafford Horne, Max Filippov,
	Eduardo Habkost, Yoshinori Sato, David Gibson,
	Michael S. Tsirkin, qemu-ppc, Andrzej Zaborowski, Gerd Hoffmann,
	Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, qemu-arm, Marc-André Lureau

Am Sat,  4 Jul 2020 17:39:00 +0200
schrieb Philippe Mathieu-Daudé <philmd@redhat.com>:

> This code hasn't been QOM'ified yet. Warn the user.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
> v2: Add comment (thuth)
> ---
>  hw/m68k/mcf5206.c | 5 +++++
>  hw/m68k/mcf5208.c | 3 +++
>  2 files changed, 8 insertions(+)

Acked-by: Thomas Huth <huth@tuxfamily.org>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 08/23] hw/display/ramfb: Emit warning when old code is used
  2020-07-04 15:38   ` Philippe Mathieu-Daudé
@ 2020-07-06 14:15     ` Gerd Hoffmann
  -1 siblings, 0 replies; 60+ messages in thread
From: Gerd Hoffmann @ 2020-07-06 14:15 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin, qemu-devel,
	Max Filippov, Alistair Francis, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, qemu-ppc, Paolo Bonzini

On Sat, Jul 04, 2020 at 05:38:53PM +0200, Philippe Mathieu-Daudé wrote:
> This code hasn't been QOM'ified yet. Warn the user.

False positive IMHO.  This is designed to be integrated into other
devices for boot display.  vfio/display.c uses it that way.  There
also is a standalone version (initially meant to be used for testing
only, but turned out to be useful on arm) in ramfb-standalone.c which
is a proper QOM object too.

take care,
  Gerd



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 08/23] hw/display/ramfb: Emit warning when old code is used
@ 2020-07-06 14:15     ` Gerd Hoffmann
  0 siblings, 0 replies; 60+ messages in thread
From: Gerd Hoffmann @ 2020-07-06 14:15 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv,
	Peter Maydell, Alistair Francis, Stafford Horne, Max Filippov,
	Eduardo Habkost, Yoshinori Sato, David Gibson,
	Michael S. Tsirkin, qemu-ppc, Andrzej Zaborowski,
	Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau

On Sat, Jul 04, 2020 at 05:38:53PM +0200, Philippe Mathieu-Daudé wrote:
> This code hasn't been QOM'ified yet. Warn the user.

False positive IMHO.  This is designed to be integrated into other
devices for boot display.  vfio/display.c uses it that way.  There
also is a standalone version (initially meant to be used for testing
only, but turned out to be useful on arm) in ramfb-standalone.c which
is a proper QOM object too.

take care,
  Gerd



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 08/23] hw/display/ramfb: Emit warning when old code is used
  2020-07-06 14:15     ` Gerd Hoffmann
@ 2020-07-06 14:18       ` Philippe Mathieu-Daudé
  -1 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-06 14:18 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin, qemu-devel,
	Max Filippov, Alistair Francis, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, qemu-riscv, Thomas Huth,
	Bastian Koppelmann, qemu-ppc, Paolo Bonzini

On 7/6/20 4:15 PM, Gerd Hoffmann wrote:
> On Sat, Jul 04, 2020 at 05:38:53PM +0200, Philippe Mathieu-Daudé wrote:
>> This code hasn't been QOM'ified yet. Warn the user.
> 
> False positive IMHO.  This is designed to be integrated into other
> devices for boot display.  vfio/display.c uses it that way.  There
> also is a standalone version (initially meant to be used for testing
> only, but turned out to be useful on arm) in ramfb-standalone.c which
> is a proper QOM object too.

OK, good to know.

I guess I should take the time to comment the false positives too in the
code (Paolo made various other comments too). So next developer won't
have to ask again.



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 08/23] hw/display/ramfb: Emit warning when old code is used
@ 2020-07-06 14:18       ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 60+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-06 14:18 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: qemu-devel, Palmer Dabbelt, Edgar E. Iglesias, qemu-riscv,
	Peter Maydell, Alistair Francis, Stafford Horne, Max Filippov,
	Eduardo Habkost, Yoshinori Sato, David Gibson,
	Michael S. Tsirkin, qemu-ppc, Andrzej Zaborowski,
	Daniel P. Berrangé,
	Alistair Francis, Bastian Koppelmann, Paolo Bonzini, Magnus Damm,
	Sagar Karandikar, Thomas Huth, qemu-arm, Marc-André Lureau

On 7/6/20 4:15 PM, Gerd Hoffmann wrote:
> On Sat, Jul 04, 2020 at 05:38:53PM +0200, Philippe Mathieu-Daudé wrote:
>> This code hasn't been QOM'ified yet. Warn the user.
> 
> False positive IMHO.  This is designed to be integrated into other
> devices for boot display.  vfio/display.c uses it that way.  There
> also is a standalone version (initially meant to be used for testing
> only, but turned out to be useful on arm) in ramfb-standalone.c which
> is a proper QOM object too.

OK, good to know.

I guess I should take the time to comment the false positives too in the
code (Paolo made various other comments too). So next developer won't
have to ask again.



^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 21/23] hw/riscv: Emit warning when old code is used
  2020-07-04 15:39   ` Philippe Mathieu-Daudé
@ 2020-07-06 16:46     ` Alistair Francis
  -1 siblings, 0 replies; 60+ messages in thread
From: Alistair Francis @ 2020-07-06 16:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Sagar Karandikar, Michael S. Tsirkin,
	qemu-devel@nongnu.org Developers, Max Filippov, Alistair Francis,
	Gerd Hoffmann, Edgar E. Iglesias, Yoshinori Sato, Magnus Damm,
	Marc-André Lureau, Eduardo Habkost, Alistair Francis,
	qemu-arm, open list:RISC-V, Stafford Horne, Palmer Dabbelt,
	David Gibson, Daniel P. Berrangé,
	Thomas Huth, Bastian Koppelmann, open list:New World,
	Paolo Bonzini

On Sat, Jul 4, 2020 at 8:48 AM Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>
> This code hasn't been QOM'ified yet. Warn the user.
>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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

Alistair

> ---
>  hw/riscv/riscv_htif.c  | 4 ++++
>  hw/riscv/sifive_uart.c | 4 ++++
>  2 files changed, 8 insertions(+)
>
> diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c
> index ca87a5cf9f..bd080dbefb 100644
> --- a/hw/riscv/riscv_htif.c
> +++ b/hw/riscv/riscv_htif.c
> @@ -30,6 +30,7 @@
>  #include "hw/riscv/riscv_htif.h"
>  #include "qemu/timer.h"
>  #include "qemu/error-report.h"
> +#include "hw/qdev-deprecated.h"
>
>  #define RISCV_DEBUG_HTIF 0
>  #define HTIF_DEBUG(fmt, ...)                                                   \
> @@ -238,6 +239,9 @@ HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
>      uint64_t fromhost_offset = fromhost_addr - base;
>
>      HTIFState *s = g_malloc0(sizeof(HTIFState));
> +
> +    qdev_warn_deprecated_function_used();
> +
>      s->address_space = address_space;
>      s->main_mem = main_mem;
>      s->main_mem_ram_ptr = memory_region_get_ram_ptr(main_mem);
> diff --git a/hw/riscv/sifive_uart.c b/hw/riscv/sifive_uart.c
> index 9350482662..1a5890d5f7 100644
> --- a/hw/riscv/sifive_uart.c
> +++ b/hw/riscv/sifive_uart.c
> @@ -25,6 +25,7 @@
>  #include "hw/hw.h"
>  #include "hw/irq.h"
>  #include "hw/riscv/sifive_uart.h"
> +#include "hw/qdev-deprecated.h"
>
>  /*
>   * Not yet implemented:
> @@ -183,6 +184,9 @@ SiFiveUARTState *sifive_uart_create(MemoryRegion *address_space, hwaddr base,
>      Chardev *chr, qemu_irq irq)
>  {
>      SiFiveUARTState *s = g_malloc0(sizeof(SiFiveUARTState));
> +
> +    qdev_warn_deprecated_function_used();
> +
>      s->irq = irq;
>      qemu_chr_fe_init(&s->chr, chr, &error_abort);
>      qemu_chr_fe_set_handlers(&s->chr, uart_can_rx, uart_rx, uart_event,
> --
> 2.21.3
>
>


^ permalink raw reply	[flat|nested] 60+ messages in thread

* Re: [RFC PATCH v2 21/23] hw/riscv: Emit warning when old code is used
@ 2020-07-06 16:46     ` Alistair Francis
  0 siblings, 0 replies; 60+ messages in thread
From: Alistair Francis @ 2020-07-06 16:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel@nongnu.org Developers, Peter Maydell,
	Sagar Karandikar, Michael S. Tsirkin, Max Filippov,
	Alistair Francis, Gerd Hoffmann, Edgar E. Iglesias,
	Yoshinori Sato, Magnus Damm, Palmer Dabbelt, Eduardo Habkost,
	Alistair Francis, qemu-arm, Marc-André Lureau,
	Daniel P. Berrangé,
	Stafford Horne, David Gibson, open list:RISC-V, Thomas Huth,
	Bastian Koppelmann, open list:New World, Paolo Bonzini

On Sat, Jul 4, 2020 at 8:48 AM Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
>
> This code hasn't been QOM'ified yet. Warn the user.
>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

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

Alistair

> ---
>  hw/riscv/riscv_htif.c  | 4 ++++
>  hw/riscv/sifive_uart.c | 4 ++++
>  2 files changed, 8 insertions(+)
>
> diff --git a/hw/riscv/riscv_htif.c b/hw/riscv/riscv_htif.c
> index ca87a5cf9f..bd080dbefb 100644
> --- a/hw/riscv/riscv_htif.c
> +++ b/hw/riscv/riscv_htif.c
> @@ -30,6 +30,7 @@
>  #include "hw/riscv/riscv_htif.h"
>  #include "qemu/timer.h"
>  #include "qemu/error-report.h"
> +#include "hw/qdev-deprecated.h"
>
>  #define RISCV_DEBUG_HTIF 0
>  #define HTIF_DEBUG(fmt, ...)                                                   \
> @@ -238,6 +239,9 @@ HTIFState *htif_mm_init(MemoryRegion *address_space, MemoryRegion *main_mem,
>      uint64_t fromhost_offset = fromhost_addr - base;
>
>      HTIFState *s = g_malloc0(sizeof(HTIFState));
> +
> +    qdev_warn_deprecated_function_used();
> +
>      s->address_space = address_space;
>      s->main_mem = main_mem;
>      s->main_mem_ram_ptr = memory_region_get_ram_ptr(main_mem);
> diff --git a/hw/riscv/sifive_uart.c b/hw/riscv/sifive_uart.c
> index 9350482662..1a5890d5f7 100644
> --- a/hw/riscv/sifive_uart.c
> +++ b/hw/riscv/sifive_uart.c
> @@ -25,6 +25,7 @@
>  #include "hw/hw.h"
>  #include "hw/irq.h"
>  #include "hw/riscv/sifive_uart.h"
> +#include "hw/qdev-deprecated.h"
>
>  /*
>   * Not yet implemented:
> @@ -183,6 +184,9 @@ SiFiveUARTState *sifive_uart_create(MemoryRegion *address_space, hwaddr base,
>      Chardev *chr, qemu_irq irq)
>  {
>      SiFiveUARTState *s = g_malloc0(sizeof(SiFiveUARTState));
> +
> +    qdev_warn_deprecated_function_used();
> +
>      s->irq = irq;
>      qemu_chr_fe_init(&s->chr, chr, &error_abort);
>      qemu_chr_fe_set_handlers(&s->chr, uart_can_rx, uart_rx, uart_event,
> --
> 2.21.3
>
>


^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2020-07-06 17:22 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-04 15:38 [RFC PATCH v2 00/23] hw/qdev: Warn when using pre-qdev/QOM devices Philippe Mathieu-Daudé
2020-07-04 15:38 ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [PATCH v2 01/23] qom/object: Update documentation Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 02/23] hw/core/qdev: Add qdev_warn_deprecated_function_used() helper Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 16:22   ` BALATON Zoltan
2020-07-04 16:22     ` BALATON Zoltan
2020-07-04 15:38 ` [RFC PATCH v2 03/23] hw/arm/omap: Emit warning when old code is used Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 04/23] hw/arm/pxa2xx: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 05/23] hw/arm/nseries: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 06/23] hw/char/parallel: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 07/23] hw/display/blizzard: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 08/23] hw/display/ramfb: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-06 14:15   ` Gerd Hoffmann
2020-07-06 14:15     ` Gerd Hoffmann
2020-07-06 14:18     ` Philippe Mathieu-Daudé
2020-07-06 14:18       ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 09/23] hw/display/tc6393xb: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 10/23] hw/display/vga-isa-mm: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 11/23] hw/dma/etraxfs_dma: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 12/23] hw/dma/soc_dma: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 13/23] hw/input/lasips2: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:38 ` [RFC PATCH v2 14/23] hw/input/tsc2005: " Philippe Mathieu-Daudé
2020-07-04 15:38   ` Philippe Mathieu-Daudé
2020-07-04 15:39 ` [RFC PATCH v2 15/23] hw/m68k/mcf520x: " Philippe Mathieu-Daudé
2020-07-04 15:39   ` Philippe Mathieu-Daudé
2020-07-05  6:31   ` Thomas Huth
2020-07-05  6:31     ` Thomas Huth
2020-07-04 15:39 ` [RFC PATCH v2 16/23] hw/misc/cbus: " Philippe Mathieu-Daudé
2020-07-04 15:39   ` Philippe Mathieu-Daudé
2020-07-04 15:39 ` [RFC PATCH v2 17/23] hw/nvram/eeprom93xx: " Philippe Mathieu-Daudé
2020-07-04 15:39   ` Philippe Mathieu-Daudé
2020-07-04 15:39 ` [RFC PATCH v2 18/23] hw/openrisc/cputimer: " Philippe Mathieu-Daudé
2020-07-04 15:39   ` Philippe Mathieu-Daudé
2020-07-04 15:47   ` Philippe Mathieu-Daudé
2020-07-04 15:47     ` Philippe Mathieu-Daudé
2020-07-04 15:39 ` [RFC PATCH v2 19/23] hw/ppc/ppc4xx: " Philippe Mathieu-Daudé
2020-07-04 15:39   ` Philippe Mathieu-Daudé
2020-07-04 15:39 ` [RFC PATCH v2 20/23] hw/sh4: " Philippe Mathieu-Daudé
2020-07-04 15:39   ` Philippe Mathieu-Daudé
2020-07-04 15:39 ` [RFC PATCH v2 21/23] hw/riscv: " Philippe Mathieu-Daudé
2020-07-04 15:39   ` Philippe Mathieu-Daudé
2020-07-06 16:46   ` Alistair Francis
2020-07-06 16:46     ` Alistair Francis
2020-07-04 15:39 ` [RFC PATCH v2 22/23] hw/usb/hcd-musb: " Philippe Mathieu-Daudé
2020-07-04 15:39   ` Philippe Mathieu-Daudé
2020-07-04 15:39 ` [RFC PATCH v2 23/23] hw/xtensa/xtfpga: " Philippe Mathieu-Daudé
2020-07-04 15:39   ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.