Skip to content

qom: Get rid of all manual usage of OBJECT_CHECK & friends

Eduardo Habkost kvm qemu-arm qemu-devel qemu-riscv xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12accel: Rename TYPE_ACCEL to TYPE_ACCEL_BASEaccel/accel-common.c accel/accel-softmmu.c accel/accel-user.c +14 more+36 -360 replies
2/12qom: Use DEVICE_*CLASS instead of OBJECT_*CLASShw/pci/pci.c hw/usb/hcd-ehci-pci.c migration/savevm.c +2 more+5 -93 replies
3/12scripts/codeconverter: Update to latest versionscripts/codeconverter/codeconverter/patching.py scripts/codeconverter/codeconverter/qom_macros.py scripts/codeconverter/codeconverter/qom_type_info.py +1 more+405 -500 replies
4/12Add struct names to typedefs used by QOM typeschardev/char-parallel.c hw/m68k/mcf5206.c hw/misc/sbsa_ec.c +3 more+7 -71 reply
5/12Move QOM typedefs and add missing includesaccel/tcg/tcg-all.c chardev/char-parallel.c hw/arm/bcm2836.c +78 more+179 -824 replies
6/12Split QOM "typedef struct T { ... } T" declarationschardev/char-parallel.c hw/i2c/i2c_mux_pca954x.c hw/m68k/mcf5206.c +27 more+123 -821 reply
7/12Use DECLARE_*CHECKER* macros when possiblechardev/char-parallel.c hw/i2c/i2c_mux_pca954x.c hw/m68k/mcf5206.c +51 more+126 -1461 reply
8/12npcm7xx_clk: Use DECLARE_INSTANCE_CHECKERhw/misc/npcm7xx_clk.c+6 -61 reply
9/12npcm7xx_otp: Use DECLARE_CLASS_CHECKERShw/nvram/npcm7xx_otp.c include/hw/nvram/npcm7xx_otp.h+3 -71 reply
10/12Use DECLARE_OBJ_CHECKERS when possibleinclude/hw/nvram/npcm7xx_otp.h+2 -40 replies
11/12Use OBJECT_DECLARE_TYPE when possiblehw/block/fdc-sysbus.c hw/usb/u2f.h include/crypto/tlscreds.h +3 more+6 -241 reply
12/12Use OBJECT_DECLARE_SIMPLE_TYPE when possiblehw/m68k/mcf5206.c hw/mips/boston.c hw/misc/npcm7xx_clk.c +44 more+56 -1542 replies

Reviews trailers per patch

9 of 12 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéCornelia HuckJuan Quintela
1/12
2/12R-b R-b
3/12
4/12R-b
5/12R-b A-b R-b
6/12A-b
7/12A-b
8/12R-b
9/12R-b
10/12
11/12R-b
12/12R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH for-6.2 00/12] qom: Get rid of all manual usage of OBJECT_CHECK & friends

This series gets rid of all manual usage of OBJECT_CHECK, OBJECT_CLASS_CHECK, and OBJECT_GET_CLASS.

All type check macros defined manually are replaced with DEFINE_*CHECKER* or OBJECT_DECLARE* macros.

All manual usage of OBJECT_CHECK/OBJECT_CLASS_CHECK/OBJECT_GET_CLASS is manually replaced with the corresponding type-specific wrappers.

For a git tree containing all dependencies, see:
https://gitlab.com/ehabkost/qemu.git work/qom-automated-declare-type-pass2

This series is based on multiple other series I have submitted recently, including:

Date: Thu, 5 Aug 2021 15:34:25 -0400
Subject: [PATCH for-6.2 0/6] qom: Fix broken OBJECT_CHECK usage
Message-Id: <[email protected]>
https://lore.kernel.org/qemu-devel/[email protected]

Date: Thu, 5 Aug 2021 17:47:39 -0400
Subject: [PATCH] bcm2836: Remove redundant typedef and macros
Message-Id: <[email protected]>
https://lore.kernel.org/qemu-devel/[email protected]

Date: Thu, 5 Aug 2021 22:31:19 -0400
Subject: [PATCH for-6.2] sbsa-ref: Rename SBSA_GWDT enum value
Message-Id: <[email protected]>
https://lore.kernel.org/qemu-devel/[email protected]

Based-on: <[email protected]>
Based-on: <[email protected]>
Based-on: <[email protected]>

Eduardo Habkost (12):
accel: Rename TYPE_ACCEL to TYPE_ACCEL_BASE
qom: Use DEVICE_*CLASS instead of OBJECT_*CLASS scripts/codeconverter: Update to latest version [automated] Add struct names to typedefs used by QOM types [automated] Move QOM typedefs and add missing includes [automated] Split QOM "typedef struct T { ... } T" declarations [automated] Use DECLARE_*CHECKER* macros when possible
npcm7xx_clk: Use DECLARE_INSTANCE_CHECKER
npcm7xx_otp: Use DECLARE_CLASS_CHECKERS
[automated] Use DECLARE_OBJ_CHECKERS when possible [automated] Use OBJECT_DECLARE_TYPE when possible [automated] Use OBJECT_DECLARE_SIMPLE_TYPE when possible

 hw/core/machine.c                             |   2 +-
 hw/nvme/nvme.h                                |  24 +-
 hw/usb/hcd-uhci.h                             |   6 +-
 hw/usb/hcd-xhci-pci.h                         |   8 +-
 hw/usb/hcd-xhci-sysbus.h                      |   8 +-
 hw/usb/u2f.h                                  |  17 +-
 include/crypto/tlscreds.h                     |   5 +-
 include/hw/acpi/acpi_dev_interface.h          |   2 +-
 include/hw/adc/npcm7xx_adc.h                  |   8 +-
 include/hw/arm/linux-boot-if.h                |   2 +-
 include/hw/arm/npcm7xx.h                      |  36 ++-
 include/hw/char/shakti_uart.h                 |   8 +-
 include/hw/core/accel-cpu.h                   |   6 +-
 include/hw/dma/sifive_pdma.h                  |   8 +-
 include/hw/dma/xlnx_csu_dma.h                 |   8 +-
 include/hw/fw-path-provider.h                 |   2 +-
 include/hw/gpio/npcm7xx_gpio.h                |  10 +-
 include/hw/gpio/sifive_gpio.h                 |   4 +-
 include/hw/hotplug.h                          |   2 +-
 include/hw/i2c/npcm7xx_smbus.h                |  10 +-
 include/hw/intc/intc.h                        |   2 +-
 include/hw/intc/m68k_irqc.h                   |   8 +-
 include/hw/intc/sifive_clint.h                |   8 +-
 include/hw/intc/sifive_plic.h                 |   4 +-
 include/hw/ipmi/ipmi.h                        |   2 +-
 include/hw/mem/memory-device.h                |   2 +-
 include/hw/mem/npcm7xx_mc.h                   |   9 +-
 include/hw/misc/aspeed_lpc.h                  |   7 +-
 include/hw/misc/bcm2835_cprman.h              |  21 +-
 include/hw/misc/bcm2835_cprman_internals.h    |  13 +-
 include/hw/misc/led.h                         |   3 +-
 include/hw/misc/mchp_pfsoc_dmc.h              |  17 +-
 include/hw/misc/mchp_pfsoc_ioscb.h            |   8 +-
 include/hw/misc/mchp_pfsoc_sysreg.h           |   9 +-
 include/hw/misc/npcm7xx_clk.h                 |  18 +-
 include/hw/misc/npcm7xx_gcr.h                 |   7 +-
 include/hw/misc/npcm7xx_mft.h                 |   7 +-
 include/hw/misc/npcm7xx_pwm.h                 |   4 +-
 include/hw/misc/npcm7xx_rng.h                 |   9 +-
 include/hw/misc/sifive_e_prci.h               |   4 +-
 include/hw/misc/sifive_test.h                 |   4 +-
 include/hw/misc/sifive_u_otp.h                |   4 +-
 include/hw/misc/sifive_u_prci.h               |   4 +-
 include/hw/misc/xlnx-versal-xramc.h           |   8 +-
 include/hw/net/npcm7xx_emc.h                  |   5 +-
 include/hw/net/xlnx-zynqmp-can.h              |   8 +-
 include/hw/nmi.h                              |   2 +-
 include/hw/nvram/npcm7xx_otp.h                |  12 +-
 include/hw/ppc/spapr_drc.h                    |  23 +-
 include/hw/ppc/spapr_xive.h                   |  15 +-
 include/hw/ppc/vof.h                          |   1 +
 include/hw/rdma/rdma.h                        |   2 +-
 include/hw/register.h                         |   3 +-
 include/hw/riscv/microchip_pfsoc.h            |  18 +-
 include/hw/riscv/shakti_c.h                   |  15 +-
 include/hw/riscv/sifive_e.h                   |  17 +-
 include/hw/riscv/sifive_u.h                   |  17 +-
 include/hw/rtc/m48t59.h                       |   2 +-
 include/hw/sd/cadence_sdhci.h                 |   8 +-
 include/hw/ssi/npcm7xx_fiu.h                  |   4 +-
 include/hw/ssi/sifive_spi.h                   |   7 +-
 include/hw/stream.h                           |   2 +-
 include/hw/timer/npcm7xx_timer.h              |   4 +-
 include/hw/tricore/tricore_testdevice.h       |   8 +-
 include/hw/usb/hcd-dwc3.h                     |   8 +-
 include/hw/usb/msd.h                          |   1 +
 include/hw/usb/xlnx-usb-subsystem.h           |  10 +-
 include/hw/usb/xlnx-versal-usb2-ctrl-regs.h   |   8 +-
 include/hw/vmstate-if.h                       |   2 +-
 include/hw/watchdog/sbsa_gwdt.h               |  10 +-
 include/qemu/accel.h                          |  20 +-
 include/qom/object_interfaces.h               |   2 +-
 include/sysemu/tpm.h                          |   2 +-
 target/arm/idau.h                             |   2 +-
 target/hexagon/cpu.h                          |  19 +-
 accel/accel-common.c                          |   4 +-
 accel/accel-softmmu.c                         |   4 +-
 accel/accel-user.c                            |   2 +-
 accel/hvf/hvf-accel-ops.c                     |   4 +-
 accel/kvm/kvm-all.c                           |   4 +-
 accel/qtest/qtest.c                           |   4 +-
 accel/tcg/tcg-all.c                           |   5 +-
 accel/xen/xen-all.c                           |   4 +-
 bsd-user/main.c                               |   2 +-
 chardev/char-parallel.c                       |  17 +-
 hw/arm/bcm2836.c                              |   1 +
 hw/block/fdc-sysbus.c                         |   5 +-
 hw/i2c/i2c_mux_pca954x.c                      |   9 +-
 hw/m68k/mcf5206.c                             |   7 +-
 hw/mem/sparse-mem.c                           |   9 +-
 hw/mips/boston.c                              |   4 +-
 hw/mips/loongson3_virt.c                      |   1 +
 hw/misc/npcm7xx_clk.c                         |  10 +-
 hw/misc/sbsa_ec.c                             |   9 +-
 hw/net/can/ctucan_pci.c                       |   5 +-
 hw/nvram/npcm7xx_otp.c                        |   6 +-
 hw/pci/pci.c                                  |   3 +-
 hw/s390x/vhost-user-fs-ccw.c                  |   8 +-
 hw/sensor/adm1272.c                           |   7 +-
 hw/sensor/max34451.c                          |   7 +-
 hw/usb/hcd-ehci-pci.c                         |   2 +-
 hw/usb/u2f-emulated.c                         |   5 +-
 hw/usb/u2f-passthru.c                         |   5 +-
 hw/virtio/vhost-user-i2c-pci.c                |   1 +
 linux-user/main.c                             |   2 +-
 migration/savevm.c                            |   3 +-
 monitor/misc.c                                |   3 +-
 .../codeconverter/codeconverter/patching.py   |  18 +-
 .../codeconverter/codeconverter/qom_macros.py | 187 +++++++++++--
 .../codeconverter/qom_type_info.py            | 247 +++++++++++++++++-
 .../codeconverter/codeconverter/regexps.py    |   3 +-
 softmmu/memory.c                              |   2 +-
 softmmu/qdev-monitor.c                        |   3 +-
 softmmu/vl.c                                  |   6 +-
 target/i386/hax/hax-all.c                     |   4 +-
 target/i386/nvmm/nvmm-all.c                   |   4 +-
 target/i386/whpx/whpx-all.c                   |   4 +-
 tests/qtest/pnv-xscom-test.c                  |   5 +-
 tests/unit/check-qom-interface.c              |   2 +-
 ui/vdagent.c                                  |   1 +
 120 files changed, 805 insertions(+), 458 deletions(-)
Signature · 1 line
2.31.1