Skip to contentSkip to conversation

QOM boilerplate cleanup (v3)

GIT PULL Eduardo Habkost 2 participants 38 messages Sep 8, 2020 – Sep 9, 2020 Page 1 of 2

Subsystems (14)
lore
Share & tools
lore
#0 lore raw

Changes v2 -> v3:
* Fix build errors: dropped all changes in include/hw/riscv/sifive* and include/accel/accel.h

The following changes since commit 6779038537360e957dbded830f76b08ef5070161:

Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-09-08' int=
o staging (2020-09-08 17:23:31 +0100)

are available in the Git repository at:

git://github.com/ehabkost/qemu.git tags/machine-next-pull-request

for you to fetch changes up to 7661577c45301bf37a56988eeb084e01bd119de7:

virtio-vga: Use typedef name for instance_size (2020-09-08 17:32:01 -0400)

----------------------------------------------------------------
QOM boilerplate cleanup

Documentation build fix:
* memory: Remove kernel-doc comment marker (Eduardo Habkost)

QOM cleanups:
* Rename QOM macros for consistency between TYPE_* and type checking constants (Eduardo Habkost)

QOM new macros:
* OBJECT_DECLARE_* and OBJECT_DEFINE_* macros (Daniel P. Berrang=C3=A9)
* DECLARE_*_CHECKER macros (Eduardo Habkost)

Automated QOM boilerplate changes:
* Automated changes to use DECLARE_*_CHECKER (Eduardo Habkost
* Automated changes to use OBJECT_DECLARE* (Eduardo Habkost)

----------------------------------------------------------------

Daniel P. Berrang=C3=A9 (2):
qom: make object_ref/unref use a void * instead of Object *.
qom: provide convenient macros for declaring and defining types

Eduardo Habkost (32):
memory: Remove kernel-doc comment marker
qom: Allow class type name to be specified in OBJECT_DECLARE*
qom: DECLARE_*_CHECKERS macros
qom: Make type checker functions accept const pointers
codeconverter: script for automating QOM code cleanups Delete duplicate QOM typedefs
Move QOM typedefs and add missing includes
Use DECLARE_*CHECKER* macros
Use DECLARE_*CHECKER* when possible (--force mode) Use OBJECT_DECLARE_TYPE where possible
Use OBJECT_DECLARE_SIMPLE_TYPE when possible
gpex: Fix type checking function name
chardev: Rename TYPE_CHARDEV_* to TYPE_*_CHARDEV
ap-device: Rename AP_DEVICE_TYPE to TYPE_AP_DEVICE
dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV
vfio: Rename VFIO_AP_DEVICE_TYPE to TYPE_VFIO_AP_DEVICE
vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID
ahci: Rename ICH_AHCI to ICH9_AHCI
esp: Rename ESP_STATE to ESP
filter-rewriter: Rename FILTER_COLO_REWRITER to FILTER_REWRITER
rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC
sabre: Rename SABRE_DEVICE to SABRE
usb: Rename USB_SERIAL_DEV to USB_SERIAL
vfio: Rename PCI_VFIO to VFIO_PCI
pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312
tusb6010: Rename TUSB to TUSB6010
xilinx_axidma: Use typedef name for instance_size
omap_intc: Use typedef name for instance_size
lpc_ich9: Use typedef name for instance_size
xilinx_axienet: Use typedef name for instance_size
vhost-user-vga: Use typedef name for instance_size
virtio-vga: Use typedef name for instance_size

 .../codeconverter/codeconverter/__init__.py   |   0
 .../codeconverter/codeconverter/patching.py   | 397 +++++++++++
 .../codeconverter/codeconverter/qom_macros.py | 652 ++++++++++++++++++
 .../codeconverter/qom_type_info.py            | 434 ++++++++++++
 .../codeconverter/codeconverter/regexps.py    | 118 ++++
 .../codeconverter/test_patching.py            | 105 +++
 .../codeconverter/test_regexps.py             | 282 ++++++++
 scripts/codeconverter/codeconverter/utils.py  |  72 ++
 scripts/codeconverter/converter.py            | 123 ++++
 chardev/chardev-internal.h                    |  10 +-
 hw/9pfs/virtio-9p.h                           |  11 +-
 hw/audio/intel-hda.h                          |  20 +-
 hw/avr/atmega.h                               |   9 +-
 hw/display/ati_int.h                          |   9 +-
 hw/display/qxl.h                              |   9 +-
 hw/display/virtio-vga.h                       |  17 +-
 hw/i386/amd_iommu.h                           |  10 +-
 hw/misc/tmp105.h                              |   9 +-
 hw/net/fsl_etsec/etsec.h                      |  10 +-
 hw/net/rocker/rocker.h                        |   5 +-
 hw/net/tulip.h                                |   4 +-
 hw/net/vmxnet3_defs.h                         |   9 +-
 hw/ppc/e500-ccsr.h                            |   9 +-
 hw/ppc/e500.h                                 |  19 +-
 hw/ppc/mac.h                                  |  19 +-
 hw/rdma/vmw/pvrdma.h                          |   9 +-
 hw/s390x/ccw-device.h                         |  17 +-
 hw/s390x/ipl.h                                |   6 +-
 hw/s390x/s390-pci-bus.h                       |  34 +-
 hw/s390x/virtio-ccw.h                         | 141 ++--
 hw/scsi/mptsas.h                              |   5 +-
 hw/usb/ccid.h                                 |  14 +-
 hw/usb/hcd-dwc2.h                             |   9 +-
 hw/usb/hcd-ehci.h                             |  36 +-
 hw/usb/hcd-ohci.h                             |   9 +-
 hw/usb/hcd-xhci.h                             |   7 +-
 hw/vfio/pci.h                                 |   9 +-
 hw/virtio/virtio-mem-pci.h                    |   5 +-
 hw/virtio/virtio-pci.h                        |  24 +-
 hw/virtio/virtio-pmem-pci.h                   |   5 +-
 hw/xen/xen_pt.h                               |   5 +-
 include/authz/base.h                          |  15 +-
 include/authz/list.h                          |  17 +-
 include/authz/listfile.h                      |  17 +-
 include/authz/pamacct.h                       |  17 +-
 include/authz/simple.h                        |  17 +-
 include/block/throttle-groups.h               |   4 +-
 include/chardev/char-fd.h                     |  11 +-
 include/chardev/char-win-stdio.h              |   2 +-
 include/chardev/char-win.h                    |  11 +-
 include/chardev/char.h                        |  44 +-
 include/chardev/spice.h                       |  15 +-
 include/crypto/secret.h                       |   6 +-
 include/crypto/secret_common.h                |  12 +-
 include/crypto/secret_keyring.h               |  24 +-
 include/crypto/tls-cipher-suites.h            |   9 +-
 include/crypto/tlscreds.h                     |   6 +-
 include/crypto/tlscredsanon.h                 |   7 +-
 include/crypto/tlscredspsk.h                  |   7 +-
 include/crypto/tlscredsx509.h                 |   7 +-
 include/exec/memory.h                         |  21 +-
 include/hw/acpi/acpi_dev_interface.h          |  13 +-
 include/hw/acpi/generic_event_device.h        |  10 +-
 include/hw/acpi/vmgenid.h                     |  13 +-
 include/hw/adc/stm32f2xx_adc.h                |  10 +-
 include/hw/arm/allwinner-a10.h                |   9 +-
 include/hw/arm/allwinner-h3.h                 |   8 +-
 include/hw/arm/armsse.h                       |  16 +-
 include/hw/arm/armv7m.h                       |  17 +-
 include/hw/arm/aspeed.h                       |  14 +-
 include/hw/arm/aspeed_soc.h                   |  18 +-
 include/hw/arm/bcm2835_peripherals.h          |  10 +-
 include/hw/arm/bcm2836.h                      |  18 +-
 include/hw/arm/digic.h                        |   9 +-
 include/hw/arm/exynos4210.h                   |  10 +-
 include/hw/arm/fsl-imx25.h                    |   9 +-
 include/hw/arm/fsl-imx31.h                    |   9 +-
 include/hw/arm/fsl-imx6.h                     |   9 +-
 include/hw/arm/fsl-imx6ul.h                   |   9 +-
 include/hw/arm/fsl-imx7.h                     |   9 +-
 include/hw/arm/linux-boot-if.h                |  11 +-
 include/hw/arm/msf2-soc.h                     |   9 +-
 include/hw/arm/nrf51_soc.h                    |  10 +-
 include/hw/arm/omap.h                         |  20 +-
 include/hw/arm/pxa.h                          |  15 +-
 include/hw/arm/smmu-common.h                  |  18 +-
 include/hw/arm/smmuv3.h                       |  18 +-
 include/hw/arm/stm32f205_soc.h                |  10 +-
 include/hw/arm/stm32f405_soc.h                |  10 +-
 include/hw/arm/virt.h                         |  19 +-
 include/hw/arm/xlnx-versal.h                  |   9 +-
 include/hw/arm/xlnx-zynqmp.h                  |  10 +-
 include/hw/block/flash.h                      |  13 +-
 include/hw/block/swim.h                       |  15 +-
 include/hw/boards.h                           |   8 +-
 include/hw/char/avr_usart.h                   |  10 +-
 include/hw/char/bcm2835_aux.h                 |   9 +-
 include/hw/char/cadence_uart.h                |  10 +-
 include/hw/char/cmsdk-apb-uart.h              |  10 +-
 include/hw/char/digic-uart.h                  |  10 +-
 include/hw/char/escc.h                        |   9 +-
 include/hw/char/ibex_uart.h                   |  10 +-
 include/hw/char/imx_serial.h                  |   9 +-
 include/hw/char/nrf51_uart.h                  |   9 +-
 include/hw/char/pl011.h                       |   9 +-
 include/hw/char/renesas_sci.h                 |   9 +-
 include/hw/char/serial.h                      |  25 +-
 include/hw/char/stm32f2xx_usart.h             |  10 +-
 include/hw/clock.h                            |   5 +-
 include/hw/core/cpu.h                         |  10 +-
 include/hw/core/generic-loader.h              |  10 +-
 include/hw/core/split-irq.h                   |   3 +-
 include/hw/cpu/a15mpcore.h                    |  10 +-
 include/hw/cpu/a9mpcore.h                     |  10 +-
 include/hw/cpu/arm11mpcore.h                  |  10 +-
 include/hw/cpu/cluster.h                      |  10 +-
 include/hw/cpu/core.h                         |  10 +-
 include/hw/display/bcm2835_fb.h               |   9 +-
 include/hw/display/dpcd.h                     |   4 +-
 include/hw/display/i2c-ddc.h                  |   4 +-
 include/hw/display/macfb.h                    |  30 +-
 include/hw/display/xlnx_dp.h                  |   9 +-
 include/hw/dma/bcm2835_dma.h                  |  10 +-
 include/hw/dma/i8257.h                        |  10 +-
 include/hw/dma/pl080.h                        |   9 +-
 include/hw/dma/xlnx-zdma.h                    |  10 +-
 include/hw/dma/xlnx-zynq-devcfg.h             |  10 +-
 include/hw/dma/xlnx_dpdma.h                   |   4 +-
 include/hw/fw-path-provider.h                 |  11 +-
 include/hw/gpio/aspeed_gpio.h                 |  18 +-
 include/hw/gpio/bcm2835_gpio.h                |  10 +-
 include/hw/gpio/imx_gpio.h                    |   9 +-
 include/hw/gpio/nrf51_gpio.h                  |   9 +-
 include/hw/hotplug.h                          |  11 +-
 include/hw/hyperv/vmbus-bridge.h              |   9 +-
 include/hw/hyperv/vmbus.h                     |  17 +-
 include/hw/i2c/arm_sbcon_i2c.h                |  10 +-
 include/hw/i2c/aspeed_i2c.h                   |  19 +-
 include/hw/i2c/i2c.h                          |  19 +-
 include/hw/i2c/imx_i2c.h                      |   9 +-
 include/hw/i2c/microbit_i2c.h                 |  10 +-
 include/hw/i2c/ppc4xx_i2c.h                   |   9 +-
 include/hw/i2c/smbus_slave.h                  |  15 +-
 include/hw/i386/apic_internal.h               |  17 +-
 include/hw/i386/ich9.h                        |  10 +-
 include/hw/i386/intel_iommu.h                 |   7 +-
 include/hw/i386/ioapic_internal.h             |  16 +-
 include/hw/i386/microvm.h                     |  19 +-
 include/hw/i386/pc.h                          |  14 +-
 include/hw/i386/x86-iommu.h                   |  13 +-
 include/hw/i386/x86.h                         |  19 +-
 include/hw/ide/ahci.h                         |  22 +-
 include/hw/ide/internal.h                     |  19 +-
 include/hw/ide/pci.h                          |   9 +-
 include/hw/input/adb.h                        |  16 +-
 include/hw/input/i8042.h                      |   6 +-
 include/hw/intc/allwinner-a10-pic.h           |   9 +-
 include/hw/intc/arm_gic.h                     |  15 +-
 include/hw/intc/arm_gic_common.h              |  21 +-
 include/hw/intc/arm_gicv3.h                   |  14 +-
 include/hw/intc/arm_gicv3_common.h            |  16 +-
 include/hw/intc/arm_gicv3_its_common.h        |  11 +-
 include/hw/intc/armv7m_nvic.h                 |  10 +-
 include/hw/intc/aspeed_vic.h                  |   9 +-
 include/hw/intc/bcm2835_ic.h                  |   9 +-
 include/hw/intc/bcm2836_control.h             |  10 +-
 include/hw/intc/heathrow_pic.h                |   9 +-
 include/hw/intc/ibex_plic.h                   |  10 +-
 include/hw/intc/imx_avic.h                    |   9 +-
 include/hw/intc/imx_gpcv2.h                   |   9 +-
 include/hw/intc/intc.h                        |  11 +-
 include/hw/intc/mips_gic.h                    |   6 +-
 include/hw/intc/realview_gic.h                |  10 +-
 include/hw/intc/rx_icu.h                      |   4 +-
 include/hw/intc/xlnx-pmu-iomod-intc.h         |  10 +-
 include/hw/intc/xlnx-zynqmp-ipi.h             |  10 +-
 include/hw/ipack/ipack.h                      |  14 +-
 include/hw/ipmi/ipmi.h                        |  36 +-
 include/hw/isa/i8259_internal.h               |  15 +-
 include/hw/isa/isa.h                          |  28 +-
 include/hw/isa/pc87312.h                      |  11 +-
 include/hw/isa/superio.h                      |  19 +-
 include/hw/m68k/mcf_fec.h                     |   4 +-
 include/hw/mem/memory-device.h                |  11 +-
 include/hw/mem/nvdimm.h                       |  11 +-
 include/hw/mem/pc-dimm.h                      |  17 +-
 include/hw/mips/cps.h                         |   9 +-
 include/hw/misc/a9scu.h                       |   9 +-
 include/hw/misc/allwinner-cpucfg.h            |   9 +-
 include/hw/misc/allwinner-h3-ccu.h            |   9 +-
 include/hw/misc/allwinner-h3-dramc.h          |   9 +-
 include/hw/misc/allwinner-h3-sysctrl.h        |   9 +-
 include/hw/misc/allwinner-sid.h               |   9 +-
 include/hw/misc/arm11scu.h                    |   9 +-
 include/hw/misc/armsse-cpuid.h                |   9 +-
 include/hw/misc/armsse-mhu.h                  |   9 +-
 include/hw/misc/aspeed_scu.h                  |  18 +-
 include/hw/misc/aspeed_sdmc.h                 |  18 +-
 include/hw/misc/aspeed_xdma.h                 |   9 +-
 include/hw/misc/auxbus.h                      |  11 +-
 include/hw/misc/avr_power.h                   |   9 +-
 include/hw/misc/bcm2835_mbox.h                |  10 +-
 include/hw/misc/bcm2835_mphi.h                |   5 +-
 include/hw/misc/bcm2835_property.h            |  10 +-
 include/hw/misc/bcm2835_rng.h                 |  10 +-
 include/hw/misc/bcm2835_thermal.h             |  10 +-
 include/hw/misc/grlib_ahb_apb_pnp.h           |   9 +-
 include/hw/misc/imx25_ccm.h                   |   9 +-
 include/hw/misc/imx31_ccm.h                   |   9 +-
 include/hw/misc/imx6_ccm.h                    |   9 +-
 include/hw/misc/imx6_src.h                    |   9 +-
 include/hw/misc/imx6ul_ccm.h                  |   9 +-
 include/hw/misc/imx7_ccm.h                    |  17 +-
 include/hw/misc/imx7_gpr.h                    |   9 +-
 include/hw/misc/imx7_snvs.h                   |   9 +-
 include/hw/misc/imx_ccm.h                     |  19 +-
 include/hw/misc/imx_rngc.h                    |   9 +-
 include/hw/misc/iotkit-secctl.h               |   6 +-
 include/hw/misc/iotkit-sysctl.h               |  10 +-
 include/hw/misc/iotkit-sysinfo.h              |  10 +-
 include/hw/misc/mac_via.h                     |  27 +-
 include/hw/misc/macio/cuda.h                  |  18 +-
 include/hw/misc/macio/gpio.h                  |   9 +-
 include/hw/misc/macio/macio.h                 |  43 +-
 include/hw/misc/macio/pmu.h                   |  18 +-
 include/hw/misc/max111x.h                     |  10 +-
 include/hw/misc/mips_cmgcr.h                  |   6 +-
 include/hw/misc/mips_cpc.h                    |   9 +-
 include/hw/misc/mips_itu.h                    |   9 +-
 include/hw/misc/mos6522.h                     |  18 +-
 include/hw/misc/mps2-fpgaio.h                 |   9 +-
 include/hw/misc/mps2-scc.h                    |   9 +-
 include/hw/misc/msf2-sysreg.h                 |   9 +-
 include/hw/misc/nrf51_rng.h                   |   9 +-
 include/hw/misc/pca9552.h                     |   9 +-
 include/hw/misc/stm32f2xx_syscfg.h            |  10 +-
 include/hw/misc/stm32f4xx_exti.h              |  10 +-
 include/hw/misc/stm32f4xx_syscfg.h            |  10 +-
 include/hw/misc/tz-mpc.h                      |   6 +-
 include/hw/misc/tz-msc.h                      |   9 +-
 include/hw/misc/tz-ppc.h                      |   6 +-
 include/hw/misc/unimp.h                       |  10 +-
 include/hw/misc/vmcoreinfo.h                  |   9 +-
 include/hw/misc/zynq-xadc.h                   |  10 +-
 include/hw/net/allwinner-sun8i-emac.h         |   9 +-
 include/hw/net/allwinner_emac.h               |   9 +-
 include/hw/net/cadence_gem.h                  |   9 +-
 include/hw/net/ftgmac100.h                    |  17 +-
 include/hw/net/imx_fec.h                      |   9 +-
 include/hw/net/lance.h                        |  10 +-
 include/hw/net/lasi_82596.h                   |  10 +-
 include/hw/net/msf2-emac.h                    |  10 +-
 include/hw/nmi.h                              |  11 +-
 include/hw/nubus/mac-nubus-bridge.h           |  10 +-
 include/hw/nubus/nubus.h                      |  18 +-
 include/hw/nvram/fw_cfg.h                     |  21 +-
 include/hw/nvram/nrf51_nvm.h                  |   9 +-
 include/hw/or-irq.h                           |   3 +-
 include/hw/pci-bridge/simba.h                 |  10 +-
 include/hw/pci-host/designware.h              |  16 +-
 include/hw/pci-host/gpex.h                    |  19 +-
 include/hw/pci-host/i440fx.h                  |  10 +-
 include/hw/pci-host/pnv_phb3.h                |  20 +-
 include/hw/pci-host/pnv_phb4.h                |  21 +-
 include/hw/pci-host/q35.h                     |  19 +-
 include/hw/pci-host/sabre.h                   |  19 +-
 include/hw/pci-host/spapr.h                   |   7 +-
 include/hw/pci-host/uninorth.h                |  31 +-
 include/hw/pci-host/xilinx-pcie.h             |  19 +-
 include/hw/pci/pci.h                          |  19 +-
 include/hw/pci/pci_bridge.h                   |   4 +-
 include/hw/pci/pci_host.h                     |  14 +-
 include/hw/pci/pcie_host.h                    |   5 +-
 include/hw/pci/pcie_port.h                    |  18 +-
 include/hw/pcmcia.h                           |  19 +-
 include/hw/platform-bus.h                     |   5 +-
 include/hw/ppc/mac_dbdma.h                    |   9 +-
 include/hw/ppc/openpic.h                      |   9 +-
 include/hw/ppc/pnv.h                          |  75 +-
 include/hw/ppc/pnv_core.h                     |  26 +-
 include/hw/ppc/pnv_homer.h                    |  22 +-
 include/hw/ppc/pnv_lpc.h                      |  28 +-
 include/hw/ppc/pnv_occ.h                      |  22 +-
 include/hw/ppc/pnv_pnor.h                     |   9 +-
 include/hw/ppc/pnv_psi.h                      |  35 +-
 include/hw/ppc/pnv_xive.h                     |  16 +-
 include/hw/ppc/pnv_xscom.h                    |  10 +-
 include/hw/ppc/spapr.h                        |  23 +-
 include/hw/ppc/spapr_cpu_core.h               |  17 +-
 include/hw/ppc/spapr_irq.h                    |  12 +-
 include/hw/ppc/spapr_tpm_proxy.h              |   9 +-
 include/hw/ppc/spapr_vio.h                    |  19 +-
 include/hw/ppc/xics.h                         |  31 +-
 include/hw/ppc/xics_spapr.h                   |   5 +-
 include/hw/ppc/xive.h                         |  77 +--
 include/hw/qdev-core.h                        |  15 +-
 include/hw/rdma/rdma.h                        |  11 +-
 include/hw/register.h                         |   4 +-
 include/hw/resettable.h                       |  11 +-
 include/hw/riscv/opentitan.h                  |  10 +-
 include/hw/riscv/riscv_hart.h                 |  10 +-
 include/hw/riscv/spike.h                      |  10 +-
 include/hw/riscv/virt.h                       |  10 +-
 include/hw/rtc/allwinner-rtc.h                |  18 +-
 include/hw/rtc/aspeed_rtc.h                   |   9 +-
 include/hw/rtc/goldfish_rtc.h                 |  10 +-
 include/hw/rtc/m48t59.h                       |  11 +-
 include/hw/rtc/mc146818rtc.h                  |   9 +-
 include/hw/rtc/pl031.h                        |   9 +-
 include/hw/rtc/xlnx-zynqmp-rtc.h              |  10 +-
 include/hw/rx/rx62n.h                         |   9 +-
 include/hw/s390x/3270-ccw.h                   |  19 +-
 include/hw/s390x/ap-device.h                  |  12 +-
 include/hw/s390x/css-bridge.h                 |  18 +-
 include/hw/s390x/event-facility.h             |  34 +-
 include/hw/s390x/s390-ccw.h                   |  19 +-
 include/hw/s390x/s390-virtio-ccw.h            |  17 +-
 include/hw/s390x/s390_flic.h                  |  30 +-
 include/hw/s390x/sclp.h                       |  14 +-
 include/hw/s390x/storage-attributes.h         |  37 +-
 include/hw/s390x/storage-keys.h               |  28 +-
 include/hw/s390x/tod.h                        |  18 +-
 include/hw/s390x/vfio-ccw.h                   |   7 +-
 include/hw/scsi/esp.h                         |   9 +-
 include/hw/scsi/scsi.h                        |  19 +-
 include/hw/sd/allwinner-sdhost.h              |  18 +-
 include/hw/sd/aspeed_sdhci.h                  |  10 +-
 include/hw/sd/bcm2835_sdhost.h                |  10 +-
 include/hw/sd/sd.h                            |  23 +-
 include/hw/sd/sdhci.h                         |  13 +-
 include/hw/southbridge/piix.h                 |  10 +-
 include/hw/sparc/sparc32_dma.h                |  34 +-
 include/hw/sparc/sun4m_iommu.h                |   9 +-
 include/hw/sparc/sun4u_iommu.h                |   9 +-
 include/hw/ssi/aspeed_smc.h                   |  18 +-
 include/hw/ssi/imx_spi.h                      |   9 +-
 include/hw/ssi/mss-spi.h                      |   9 +-
 include/hw/ssi/pl022.h                        |   9 +-
 include/hw/ssi/ssi.h                          |  11 +-
 include/hw/ssi/stm32f2xx_spi.h                |  10 +-
 include/hw/ssi/xilinx_spips.h                 |  32 +-
 include/hw/stream.h                           |  11 +-
 include/hw/sysbus.h                           |  17 +-
 include/hw/timer/a9gtimer.h                   |   6 +-
 include/hw/timer/allwinner-a10-pit.h          |   6 +-
 include/hw/timer/arm_mptimer.h                |  10 +-
 include/hw/timer/armv7m_systick.h             |   9 +-
 include/hw/timer/aspeed_timer.h               |  19 +-
 include/hw/timer/avr_timer16.h                |  10 +-
 include/hw/timer/bcm2835_systmr.h             |  10 +-
 include/hw/timer/cmsdk-apb-dualtimer.h        |   7 +-
 include/hw/timer/cmsdk-apb-timer.h            |  10 +-
 include/hw/timer/digic-timer.h                |   9 +-
 include/hw/timer/i8254.h                      |   9 +-
 include/hw/timer/imx_epit.h                   |   9 +-
 include/hw/timer/imx_gpt.h                    |   9 +-
 include/hw/timer/mss-timer.h                  |  10 +-
 include/hw/timer/nrf51_timer.h                |   9 +-
 include/hw/timer/renesas_cmt.h                |   9 +-
 include/hw/timer/renesas_tmr.h                |   9 +-
 include/hw/timer/stm32f2xx_timer.h            |  10 +-
 include/hw/usb.h                              |  17 +-
 include/hw/usb/chipidea.h                     |   9 +-
 include/hw/usb/imx-usb-phy.h                  |   9 +-
 include/hw/vfio/vfio-amd-xgbe.h               |  11 +-
 include/hw/vfio/vfio-calxeda-xgmac.h          |  21 +-
 include/hw/vfio/vfio-platform.h               |  19 +-
 include/hw/virtio/vhost-scsi-common.h         |  10 +-
 include/hw/virtio/vhost-scsi.h                |  10 +-
 include/hw/virtio/vhost-user-blk.h            |  10 +-
 include/hw/virtio/vhost-user-fs.h             |  10 +-
 include/hw/virtio/vhost-user-scsi.h           |  10 +-
 include/hw/virtio/vhost-user-vsock.h          |  10 +-
 include/hw/virtio/vhost-vsock-common.h        |  10 +-
 include/hw/virtio/vhost-vsock.h               |  10 +-
 include/hw/virtio/virtio-balloon.h            |  10 +-
 include/hw/virtio/virtio-blk.h                |  10 +-
 include/hw/virtio/virtio-bus.h                |  15 +-
 include/hw/virtio/virtio-crypto.h             |  10 +-
 include/hw/virtio/virtio-gpu-pci.h            |   5 +-
 include/hw/virtio/virtio-gpu.h                |  35 +-
 include/hw/virtio/virtio-input.h              |  29 +-
 include/hw/virtio/virtio-iommu.h              |  10 +-
 include/hw/virtio/virtio-mem.h                |  17 +-
 include/hw/virtio/virtio-mmio.h               |  19 +-
 include/hw/virtio/virtio-net.h                |   7 +-
 include/hw/virtio/virtio-pmem.h               |  17 +-
 include/hw/virtio/virtio-rng.h                |  10 +-
 include/hw/virtio/virtio-scsi.h               |  19 +-
 include/hw/virtio/virtio-serial.h             |  22 +-
 include/hw/virtio/virtio.h                    |  14 +-
 include/hw/vmstate-if.h                       |  11 +-
 include/hw/watchdog/cmsdk-apb-watchdog.h      |  10 +-
 include/hw/watchdog/wdt_aspeed.h              |  19 +-
 include/hw/watchdog/wdt_diag288.h             |  19 +-
 include/hw/watchdog/wdt_imx2.h                |   9 +-
 include/hw/xen/xen-block.h                    |  39 +-
 include/hw/xen/xen-bus.h                      |  37 +-
 include/hw/xen/xen-legacy-backend.h           |   5 +-
 include/io/channel-buffer.h                   |   7 +-
 include/io/channel-command.h                  |   7 +-
 include/io/channel-file.h                     |   7 +-
 include/io/channel-socket.h                   |   7 +-
 include/io/channel-tls.h                      |   7 +-
 include/io/channel-websock.h                  |   7 +-
 include/io/channel.h                          |  12 +-
 include/io/dns-resolver.h                     |  13 +-
 include/io/net-listener.h                     |  14 +-
 include/net/can_emu.h                         |   4 +-
 include/net/can_host.h                        |  21 +-
 include/net/filter.h                          |  13 +-
 include/qom/object.h                          | 327 ++++++++-
 include/qom/object_interfaces.h               |  13 +-
 include/scsi/pr-manager.h                     |  16 +-
 include/sysemu/cryptodev.h                    |  16 +-
 include/sysemu/hostmem.h                      |  10 +-
 include/sysemu/hvf.h                          |   5 +-
 include/sysemu/iothread.h                     |   9 +-
 include/sysemu/kvm.h                          |   5 +-
 include/sysemu/rng-random.h                   |   5 +-
 include/sysemu/rng.h                          |  10 +-
 include/sysemu/tpm.h                          |  11 +-
 include/sysemu/tpm_backend.h                  |  12 +-
 include/sysemu/vhost-user-backend.h           |  17 +-
 include/ui/console.h                          |  10 +-
 migration/migration.h                         |  14 +-
 target/alpha/cpu-qom.h                        |  14 +-
 target/arm/cpu-qom.h                          |  25 +-
 target/arm/idau.h                             |  11 +-
 target/avr/cpu-qom.h                          |  14 +-
 target/cris/cpu-qom.h                         |  14 +-
 target/hppa/cpu-qom.h                         |  14 +-
 target/i386/cpu-qom.h                         |  14 +-
 target/lm32/cpu-qom.h                         |  14 +-
 target/m68k/cpu-qom.h                         |  14 +-
 target/microblaze/cpu-qom.h                   |  14 +-
 target/mips/cpu-qom.h                         |  14 +-
 target/moxie/cpu.h                            |  17 +-
 target/nios2/cpu.h                            |  17 +-
 target/openrisc/cpu.h                         |  17 +-
 target/ppc/cpu-qom.h                          |  14 +-
 target/ppc/cpu.h                              |  11 +-
 target/riscv/cpu.h                            |  17 +-
 target/rx/cpu-qom.h                           |  14 +-
 target/s390x/cpu-qom.h                        |  14 +-
 target/sh4/cpu-qom.h                          |  14 +-
 target/sparc/cpu-qom.h                        |  14 +-
 target/tilegx/cpu.h                           |  17 +-
 target/tricore/cpu-qom.h                      |  14 +-
 target/unicore32/cpu-qom.h                    |  14 +-
 target/xtensa/cpu-qom.h                       |  14 +-
 accel/tcg/tcg-all.c                           |   9 +-
 backends/cryptodev-builtin.c                  |   8 +-
 backends/cryptodev-vhost-user.c               |  11 +-
 backends/dbus-vmstate.c                       |  16 +-
 backends/hostmem-file.c                       |   7 +-
 backends/hostmem-memfd.c                      |   7 +-
 backends/rng-builtin.c                        |   9 +-
 backends/rng-egd.c                            |  10 +-
 backends/tpm/tpm_emulator.c                   |  10 +-
 backends/tpm/tpm_passthrough.c                |   7 +-
 chardev/baum.c                                |  13 +-
 chardev/char-console.c                        |   4 +-
 chardev/char-fd.c                             |   2 +-
 chardev/char-file.c                           |   6 +-
 chardev/char-mux.c                            |   2 +-
 chardev/char-null.c                           |   2 +-
 chardev/char-parallel.c                       |  19 +-
 chardev/char-pipe.c                           |   6 +-
 chardev/char-pty.c                            |  11 +-
 chardev/char-ringbuf.c                        |  16 +-
 chardev/char-serial.c                         |   6 +-
 chardev/char-socket.c                         |  12 +-
 chardev/char-stdio.c                          |   6 +-
 chardev/char-udp.c                            |  11 +-
 chardev/char-win-stdio.c                      |  12 +-
 chardev/char-win.c                            |   2 +-
 chardev/char.c                                |   2 +-
 chardev/msmouse.c                             |  14 +-
 chardev/spice.c                               |  10 +-
 chardev/testdev.c                             |  14 +-
 chardev/wctablet.c                            |  14 +-
 gdbstub.c                                     |   6 +-
 hw/acpi/piix4.c                               |  10 +-
 hw/acpi/vmgenid.c                             |   6 +-
 hw/alpha/typhoon.c                            |  10 +-
 hw/arm/collie.c                               |  10 +-
 hw/arm/highbank.c                             |  10 +-
 hw/arm/integratorcp.c                         |  28 +-
 hw/arm/microbit.c                             |  10 +-
 hw/arm/mps2-tz.c                              |  19 +-
 hw/arm/mps2.c                                 |  19 +-
 hw/arm/musca.c                                |  19 +-
 hw/arm/musicpal.c                             |  73 +-
 hw/arm/palm.c                                 |  10 +-
 hw/arm/pxa2xx.c                               |  28 +-
 hw/arm/pxa2xx_gpio.c                          |   7 +-
 hw/arm/pxa2xx_pic.c                           |  10 +-
 hw/arm/raspi.c                                |  19 +-
 hw/arm/sbsa-ref.c                             |  10 +-
 hw/arm/spitz.c                                |  61 +-
 hw/arm/stellaris.c                            |  28 +-
 hw/arm/strongarm.c                            |  49 +-
 hw/arm/tosa.c                                 |  18 +-
 hw/arm/versatilepb.c                          |  10 +-
 hw/arm/vexpress.c                             |  19 +-
 hw/arm/xilinx_zynq.c                          |  10 +-
 hw/arm/xlnx-versal-virt.c                     |  10 +-
 hw/arm/xlnx-zcu102.c                          |  10 +-
 hw/arm/z2.c                                   |  17 +-
 hw/audio/ac97.c                               |  10 +-
 hw/audio/adlib.c                              |   9 +-
 hw/audio/cs4231.c                             |  10 +-
 hw/audio/cs4231a.c                            |   9 +-
 hw/audio/es1370.c                             |  10 +-
 hw/audio/gus.c                                |   9 +-
 hw/audio/hda-codec.c                          |   4 +-
 hw/audio/intel-hda.c                          |   5 +-
 hw/audio/marvell_88w8618.c                    |  10 +-
 hw/audio/milkymist-ac97.c                     |   7 +-
 hw/audio/pcspk.c                              |   9 +-
 hw/audio/pl041.c                              |   9 +-
 hw/audio/sb16.c                               |   9 +-
 hw/audio/wm8750.c                             |   9 +-
 hw/avr/arduino.c                              |  19 +-
 hw/avr/atmega.c                               |  12 +-
 hw/block/fdc.c                                |  34 +-
 hw/block/m25p80.c                             |  19 +-
 hw/block/nand.c                               |   5 +-
 hw/block/onenand.c                            |   9 +-
 hw/char/debugcon.c                            |  10 +-
 hw/char/etraxfs_ser.c                         |  10 +-
 hw/char/exynos4210_uart.c                     |  10 +-
 hw/char/grlib_apbuart.c                       |  10 +-
 hw/char/ipoctal232.c                          |   5 +-
 hw/char/lm32_juart.c                          |   6 +-
 hw/char/lm32_uart.c                           |   6 +-
 hw/char/mcf_uart.c                            |   9 +-
 hw/char/milkymist-uart.c                      |   7 +-
 hw/char/parallel.c                            |  10 +-
 hw/char/sclpconsole-lm.c                      |  10 +-
 hw/char/sclpconsole.c                         |  10 +-
 hw/char/serial-isa.c                          |   9 +-
 hw/char/serial-pci.c                          |   9 +-
 hw/char/spapr_vty.c                           |  10 +-
 hw/char/terminal3270.c                        |  10 +-
 hw/char/virtio-console.c                      |  10 +-
 hw/char/xilinx_uartlite.c                     |  10 +-
 hw/core/irq.c                                 |   3 +-
 hw/cpu/realview_mpcore.c                      |  10 +-
 hw/display/ads7846.c                          |   9 +-
 hw/display/artist.c                           |   9 +-
 hw/display/bochs-display.c                    |  10 +-
 hw/display/cg3.c                              |   9 +-
 hw/display/cirrus_vga.c                       |  10 +-
 hw/display/cirrus_vga_isa.c                   |  10 +-
 hw/display/exynos4210_fimd.c                  |  10 +-
 hw/display/g364fb.c                           |   9 +-
 hw/display/jazz_led.c                         |   9 +-
 hw/display/milkymist-tmu2.c                   |   7 +-
 hw/display/milkymist-vgafb.c                  |   7 +-
 hw/display/next-fb.c                          |   6 +-
 hw/display/pl110.c                            |   9 +-
 hw/display/ramfb-standalone.c                 |   9 +-
 hw/display/sii9022.c                          |   9 +-
 hw/display/sm501.c                            |  18 +-
 hw/display/ssd0303.c                          |   9 +-
 hw/display/ssd0323.c                          |   9 +-
 hw/display/tcx.c                              |   9 +-
 hw/display/vga-isa.c                          |   9 +-
 hw/display/vga-pci.c                          |   9 +-
 hw/display/vhost-user-gpu-pci.c               |  10 +-
 hw/display/vhost-user-gpu.c                   |   2 +-
 hw/display/vhost-user-vga.c                   |  12 +-
 hw/display/virtio-gpu-pci.c                   |  10 +-
 hw/display/virtio-vga.c                       |  16 +-
 hw/display/vmware_vga.c                       |   5 +-
 hw/dma/i82374.c                               |   9 +-
 hw/dma/pl330.c                                |   4 +-
 hw/dma/puv3_dma.c                             |   9 +-
 hw/dma/pxa2xx_dma.c                           |   9 +-
 hw/dma/rc4030.c                               |  10 +-
 hw/dma/sparc32_dma.c                          |   2 +-
 hw/dma/xilinx_axidma.c                        |  23 +-
 hw/gpio/gpio_key.c                            |   9 +-
 hw/gpio/max7310.c                             |   9 +-
 hw/gpio/mpc8xxx.c                             |   9 +-
 hw/gpio/pl061.c                               |   9 +-
 hw/gpio/puv3_gpio.c                           |   9 +-
 hw/gpio/zaurus.c                              |   6 +-
 hw/hppa/dino.c                                |  10 +-
 hw/hppa/lasi.c                                |  10 +-
 hw/hyperv/hyperv.c                            |   9 +-
 hw/hyperv/hyperv_testdev.c                    |   5 +-
 hw/i2c/bitbang_i2c.c                          |   9 +-
 hw/i2c/exynos4210_i2c.c                       |  10 +-
 hw/i2c/mpc_i2c.c                              |  10 +-
 hw/i2c/smbus_eeprom.c                         |  10 +-
 hw/i2c/smbus_ich9.c                           |  10 +-
 hw/i2c/versatile_i2c.c                        |   7 +-
 hw/i386/kvm/clock.c                           |   9 +-
 hw/i386/kvm/i8254.c                           |  18 +-
 hw/i386/kvm/i8259.c                           |  12 +-
 hw/i386/kvmvapic.c                            |   9 +-
 hw/i386/port92.c                              |   9 +-
 hw/i386/vmmouse.c                             |  10 +-
 hw/i386/vmport.c                              |   9 +-
 hw/i386/xen/xen_platform.c                    |  10 +-
 hw/i386/xen/xen_pvdevice.c                    |  10 +-
 hw/ide/ahci.c                                 |   4 +-
 hw/ide/ich.c                                  |   8 +-
 hw/ide/isa.c                                  |   9 +-
 hw/ide/microdrive.c                           |   9 +-
 hw/ide/mmio.c                                 |   9 +-
 hw/ide/sii3112.c                              |   8 +-
 hw/input/adb-kbd.c                            |  18 +-
 hw/input/adb-mouse.c                          |  18 +-
 hw/input/lm832x.c                             |   9 +-
 hw/input/milkymist-softusb.c                  |   7 +-
 hw/input/pl050.c                              |   9 +-
 hw/intc/apic.c                                |   6 +-
 hw/intc/arm_gic_kvm.c                         |  17 +-
 hw/intc/arm_gicv2m.c                          |   9 +-
 hw/intc/arm_gicv3_its_kvm.c                   |  14 +-
 hw/intc/arm_gicv3_kvm.c                       |  15 +-
 hw/intc/etraxfs_pic.c                         |   5 +-
 hw/intc/exynos4210_combiner.c                 |  10 +-
 hw/intc/exynos4210_gic.c                      |  19 +-
 hw/intc/grlib_irqmp.c                         |   9 +-
 hw/intc/i8259.c                               |  10 +-
 hw/intc/lm32_pic.c                            |   6 +-
 hw/intc/loongson_liointc.c                    |   5 +-
 hw/intc/nios2_iic.c                           |  10 +-
 hw/intc/omap_intc.c                           |   2 +-
 hw/intc/ompic.c                               |   6 +-
 hw/intc/openpic_kvm.c                         |  10 +-
 hw/intc/pl190.c                               |   9 +-
 hw/intc/puv3_intc.c                           |   9 +-
 hw/intc/s390_flic_kvm.c                       |  12 +-
 hw/intc/slavio_intctl.c                       |  10 +-
 hw/intc/xilinx_intc.c                         |   4 +-
 hw/ipack/tpci200.c                            |  10 +-
 hw/ipmi/ipmi_bmc_extern.c                     |  10 +-
 hw/ipmi/isa_ipmi_bt.c                         |  10 +-
 hw/ipmi/isa_ipmi_kcs.c                        |  10 +-
 hw/ipmi/pci_ipmi_bt.c                         |  10 +-
 hw/ipmi/pci_ipmi_kcs.c                        |  10 +-
 hw/ipmi/smbus_ipmi.c                          |   9 +-
 hw/isa/i82378.c                               |  10 +-
 hw/isa/lpc_ich9.c                             |   2 +-
 hw/isa/pc87312.c                              |   2 +-
 hw/isa/piix4.c                                |  10 +-
 hw/isa/vt82c686.c                             |  37 +-
 hw/m68k/mcf_intc.c                            |   9 +-
 hw/m68k/next-cube.c                           |   9 +-
 hw/m68k/next-kbd.c                            |   9 +-
 hw/m68k/q800.c                                |   2 +-
 hw/microblaze/xlnx-zynqmp-pmu.c               |  10 +-
 hw/mips/boston.c                              |   9 +-
 hw/mips/gt64xxx_pci.c                         |  10 +-
 hw/mips/jazz.c                                |   2 +-
 hw/mips/malta.c                               |   9 +-
 hw/misc/applesmc.c                            |   6 +-
 hw/misc/arm_integrator_debug.c                |  10 +-
 hw/misc/arm_l2x0.c                            |   9 +-
 hw/misc/arm_sysctl.c                          |  10 +-
 hw/misc/debugexit.c                           |  10 +-
 hw/misc/eccmemctl.c                           |   9 +-
 hw/misc/edu.c                                 |   9 +-
 hw/misc/empty_slot.c                          |   9 +-
 hw/misc/exynos4210_clk.c                      |  10 +-
 hw/misc/exynos4210_pmu.c                      |  10 +-
 hw/misc/exynos4210_rng.c                      |  10 +-
 hw/misc/ivshmem.c                             |  22 +-
 hw/misc/milkymist-hpdmc.c                     |   7 +-
 hw/misc/milkymist-pfpu.c                      |   7 +-
 hw/misc/mst_fpga.c                            |  10 +-
 hw/misc/pc-testdev.c                          |  10 +-
 hw/misc/pca9552.c                             |  12 +-
 hw/misc/pci-testdev.c                         |  10 +-
 hw/misc/puv3_pm.c                             |   9 +-
 hw/misc/pvpanic.c                             |  10 +-
 hw/misc/sga.c                                 |   9 +-
 hw/misc/slavio_misc.c                         |  17 +-
 hw/misc/tmp421.c                              |  18 +-
 hw/misc/zynq_slcr.c                           |   9 +-
 hw/net/can/can_kvaser_pci.c                   |  10 +-
 hw/net/can/can_mioe3680_pci.c                 |  10 +-
 hw/net/can/can_pcm3680_pci.c                  |  10 +-
 hw/net/dp8393x.c                              |   9 +-
 hw/net/e1000.c                                |  19 +-
 hw/net/e1000e.c                               |   9 +-
 hw/net/etraxfs_eth.c                          |  11 +-
 hw/net/lan9118.c                              |   9 +-
 hw/net/milkymist-minimac2.c                   |   7 +-
 hw/net/mipsnet.c                              |   9 +-
 hw/net/ne2000-isa.c                           |   9 +-
 hw/net/opencores_eth.c                        |   9 +-
 hw/net/pcnet-pci.c                            |  10 +-
 hw/net/rtl8139.c                              |  10 +-
 hw/net/smc91c111.c                            |   9 +-
 hw/net/spapr_llan.c                           |  10 +-
 hw/net/stellaris_enet.c                       |  10 +-
 hw/net/sungem.c                               |   9 +-
 hw/net/sunhme.c                               |   9 +-
 hw/net/vmxnet3.c                              |  12 +-
 hw/net/xgmac.c                                |   9 +-
 hw/net/xilinx_axienet.c                       |  23 +-
 hw/net/xilinx_ethlite.c                       |   5 +-
 hw/nvram/ds1225y.c                            |   9 +-
 hw/nvram/eeprom_at24c.c                       |   9 +-
 hw/nvram/spapr_nvram.c                        |  10 +-
 hw/pci-bridge/dec.c                           |   9 +-
 hw/pci-bridge/gen_pcie_root_port.c            |  10 +-
 hw/pci-bridge/pci_bridge_dev.c                |   7 +-
 hw/pci-bridge/pci_expander_bridge.c           |  23 +-
 hw/pci-bridge/pcie_pci_bridge.c               |  10 +-
 hw/pci-host/bonito.c                          |  14 +-
 hw/pci-host/grackle.c                         |  10 +-
 hw/pci-host/i440fx.c                          |  10 +-
 hw/pci-host/pnv_phb3.c                        |   5 +-
 hw/pci-host/pnv_phb4.c                        |   5 +-
 hw/pci-host/ppce500.c                         |  13 +-
 hw/pci-host/prep.c                            |  19 +-
 hw/pci-host/sabre.c                           |   8 +-
 hw/pci-host/versatile.c                       |  14 +-
 hw/ppc/mpc8544_guts.c                         |   6 +-
 hw/ppc/ppc440_pcix.c                          |  10 +-
 hw/ppc/ppc440_uc.c                            |  10 +-
 hw/ppc/ppc4xx_pci.c                           |   7 +-
 hw/ppc/ppce500_spin.c                         |   9 +-
 hw/ppc/prep_systemio.c                        |  10 +-
 hw/ppc/rs6000_mc.c                            |  12 +-
 hw/ppc/spapr_rng.c                            |   7 +-
 hw/rtc/ds1338.c                               |   9 +-
 hw/rtc/exynos4210_rtc.c                       |  10 +-
 hw/rtc/m41t80.c                               |   9 +-
 hw/rtc/m48t59-isa.c                           |  21 +-
 hw/rtc/m48t59.c                               |  19 +-
 hw/rtc/sun4v-rtc.c                            |   9 +-
 hw/rtc/twl92230.c                             |   9 +-
 hw/rx/rx-gdbsim.c                             |  19 +-
 hw/rx/rx62n.c                                 |  12 +-
 hw/s390x/ap-device.c                          |   2 +-
 hw/scsi/esp-pci.c                             |  19 +-
 hw/scsi/esp.c                                 |   6 +-
 hw/scsi/lsi53c895a.c                          |  10 +-
 hw/scsi/megasas.c                             |  19 +-
 hw/scsi/scsi-disk.c                           |  20 +-
 hw/scsi/spapr_vscsi.c                         |  10 +-
 hw/scsi/vmw_pvscsi.c                          |  18 +-
 hw/sd/allwinner-sdhost.c                      |   6 +-
 hw/sd/bcm2835_sdhost.c                        |   6 +-
 hw/sd/milkymist-memcard.c                     |   7 +-
 hw/sd/pl181.c                                 |   9 +-
 hw/sd/pxa2xx_mmci.c                           |   5 +-
 hw/sd/sdhci.c                                 |   5 +-
 hw/sd/ssi-sd.c                                |   9 +-
 hw/sh4/sh_pci.c                               |  10 +-
 hw/sparc/sun4m.c                              |  36 +-
 hw/sparc64/sun4u.c                            |  35 +-
 hw/ssi/ssi.c                                  |   4 +-
 hw/ssi/xilinx_spi.c                           |   9 +-
 hw/timer/altera_timer.c                       |  10 +-
 hw/timer/arm_timer.c                          |  18 +-
 hw/timer/cadence_ttc.c                        |  10 +-
 hw/timer/etraxfs_timer.c                      |  10 +-
 hw/timer/exynos4210_mct.c                     |  10 +-
 hw/timer/exynos4210_pwm.c                     |  10 +-
 hw/timer/grlib_gptimer.c                      |   7 +-
 hw/timer/hpet.c                               |   9 +-
 hw/timer/i8254.c                              |  10 +-
 hw/timer/lm32_timer.c                         |   6 +-
 hw/timer/milkymist-sysctl.c                   |   7 +-
 hw/timer/puv3_ost.c                           |   9 +-
 hw/timer/pxa2xx_timer.c                       |   7 +-
 hw/timer/slavio_timer.c                       |  10 +-
 hw/timer/xilinx_timer.c                       |   5 +-
 hw/tpm/tpm_crb.c                              |   9 +-
 hw/tpm/tpm_spapr.c                            |  10 +-
 hw/tpm/tpm_tis_isa.c                          |   9 +-
 hw/tpm/tpm_tis_sysbus.c                       |   9 +-
 hw/usb/ccid-card-emulated.c                   |   7 +-
 hw/usb/ccid-card-passthru.c                   |   5 +-
 hw/usb/dev-audio.c                            |   9 +-
 hw/usb/dev-hid.c                              |   9 +-
 hw/usb/dev-hub.c                              |   9 +-
 hw/usb/dev-mtp.c                              |   4 +-
 hw/usb/dev-network.c                          |   9 +-
 hw/usb/dev-serial.c                           |  11 +-
 hw/usb/dev-smartcard-reader.c                 |  23 +-
 hw/usb/dev-storage.c                          |   9 +-
 hw/usb/dev-uas.c                              |   4 +-
 hw/usb/dev-wacom.c                            |   9 +-
 hw/usb/hcd-ohci-pci.c                         |   9 +-
 hw/usb/hcd-uhci.c                             |   4 +-
 hw/usb/host-libusb.c                          |   7 +-
 hw/usb/redirect.c                             |   4 +-
 hw/usb/tusb6010.c                             |  13 +-
 hw/vfio/ap.c                                  |  18 +-
 hw/vfio/pci.c                                 |  22 +-
 hw/virtio/vhost-scsi-pci.c                    |   5 +-
 hw/virtio/vhost-user-blk-pci.c                |   5 +-
 hw/virtio/vhost-user-fs-pci.c                 |   5 +-
 hw/virtio/vhost-user-input-pci.c              |   5 +-
 hw/virtio/vhost-user-scsi-pci.c               |   5 +-
 hw/virtio/vhost-user-vsock-pci.c              |   5 +-
 hw/virtio/vhost-vsock-pci.c                   |   5 +-
 hw/virtio/virtio-9p-pci.c                     |  10 +-
 hw/virtio/virtio-balloon-pci.c                |   5 +-
 hw/virtio/virtio-blk-pci.c                    |   5 +-
 hw/virtio/virtio-crypto-pci.c                 |   5 +-
 hw/virtio/virtio-input-host-pci.c             |   5 +-
 hw/virtio/virtio-input-pci.c                  |   9 +-
 hw/virtio/virtio-iommu-pci.c                  |   5 +-
 hw/virtio/virtio-net-pci.c                    |   5 +-
 hw/virtio/virtio-rng-pci.c                    |   5 +-
 hw/virtio/virtio-scsi-pci.c                   |   5 +-
 hw/virtio/virtio-serial-pci.c                 |   5 +-
 hw/watchdog/wdt_i6300esb.c                    |   5 +-
 hw/watchdog/wdt_ib700.c                       |   9 +-
 iothread.c                                    |   6 +-
 migration/rdma.c                              |   7 +-
 net/can/can_socketcan.c                       |  10 +-
 net/colo-compare.c                            |   9 +-
 net/dump.c                                    |   7 +-
 net/filter-buffer.c                           |   9 +-
 net/filter-mirror.c                           |  17 +-
 net/filter-replay.c                           |   7 +-
 net/filter-rewriter.c                         |  27 +-
 qom/object.c                                  |   6 +-
 scsi/pr-manager-helper.c                      |  11 +-
 target/i386/sev.c                             |   7 +-
 tests/check-qom-interface.c                   |  11 +-
 tests/check-qom-proplist.c                    |  16 +-
 tests/test-char.c                             |   4 +-
 tests/test-qdev-global-props.c                |  13 +-
 ui/console.c                                  |  15 +-
 ui/gtk.c                                      |  12 +-
 ui/input-barrier.c                            |  14 +-
 ui/input-linux.c                              |  14 +-
 ui/spice-app.c                                |  17 +-
 MAINTAINERS                                   |   5 +
 843 files changed, 7960 insertions(+), 4514 deletions(-)
 create mode 100644 scripts/codeconverter/codeconverter/__init__.py
 create mode 100644 scripts/codeconverter/codeconverter/patching.py
 create mode 100644 scripts/codeconverter/codeconverter/qom_macros.py
 create mode 100644 scripts/codeconverter/codeconverter/qom_type_info.py
 create mode 100644 scripts/codeconverter/codeconverter/regexps.py
 create mode 100644 scripts/codeconverter/codeconverter/test_patching.py
 create mode 100644 scripts/codeconverter/codeconverter/test_regexps.py
 create mode 100644 scripts/codeconverter/codeconverter/utils.py
 create mode 100755 scripts/codeconverter/converter.py

--=20
2.26.2

#1 lore raw

[PULL 01/34] memory: Remove kernel-doc comment marker

The IOMMUMemoryRegionClass struct documentation was never in the kernel-doc format. Stop pretending it is, by removing the "/**" comment marker.

This fixes a documentation build error introduced when we split the IOMMUMemoryRegionClass typedef from the struct declaration.

Message-Id: <[email protected]>

---
 include/exec/memory.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/exec/memory.h +1 -1
index 0cfe987ab4..90e2470054 100644
@@ -216,7 +216,7 @@ enum IOMMUMemoryRegionAttr {
     IOMMU_ATTR_SPAPR_TCE_FD
 };
 
-/**
+/*
  * IOMMUMemoryRegionClass:
  *
  * All IOMMU implementations need to subclass TYPE_IOMMU_MEMORY_REGION
Signature · 1 line
2.26.2
#2 lore raw

[PULL 02/34] qom: make object_ref/unref use a void * instead of Object *.

In reply to Eduardo Habkost

From: Daniel P. Berrangé <[email protected]>

The object_ref/unref methods are intended for use with any subclass of the base Object. Using "Object *" in the signature is not adding any meaningful level of type safety, since callers simply use "OBJECT(ptr)" and this expands to an unchecked cast "(Object *)".

By using "void *" we enable the object_unref() method to be used to provide support for g_autoptr() with any subclass.

Message-Id: <[email protected]>
Message-Id: <[email protected]>

---
 include/qom/object.h | 4 ++--
 qom/object.c         | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)
include/qom/object.h +2 -2
index 0f3a60617c..1f8aa2d48e 100644
@@ -1035,7 +1035,7 @@ GSList *object_class_get_list_sorted(const char *implements_type,
  * as its reference count is greater than zero.
  * Returns: @obj
  */
-Object *object_ref(Object *obj);
+Object *object_ref(void *obj);
 
 /**
  * object_unref:
@@ -1044,7 +1044,7 @@ Object *object_ref(Object *obj);
  * Decrease the reference count of a object.  A object cannot be freed as long
  * as its reference count is greater than zero.
  */
-void object_unref(Object *obj);
+void object_unref(void *obj);
 
 /**
  * object_property_try_add:
qom/object.c +4 -2
index 00fdf89b3b..b1822a2ef4 100644
@@ -1124,8 +1124,9 @@ GSList *object_class_get_list_sorted(const char *implements_type,
                         object_class_cmp);
 }
 
-Object *object_ref(Object *obj)
+Object *object_ref(void *objptr)
 {
+    Object *obj = OBJECT(objptr);
     if (!obj) {
         return NULL;
     }
@@ -1133,8 +1134,9 @@ Object *object_ref(Object *obj)
     return obj;
 }
 
-void object_unref(Object *obj)
+void object_unref(void *objptr)
 {
+    Object *obj = OBJECT(objptr);
     if (!obj) {
         return;
     }
Signature · 1 line
2.26.2
#3 lore raw

[PULL 04/34] qom: Allow class type name to be specified in OBJECT_DECLARE*

In reply to Eduardo Habkost

Many QOM types don't follow the Type/TypeClass pattern on the instance/struct names. Let the class struct name be specified in the OBJECT_DECLARE* macros.

Message-Id: <[email protected]>

---
 include/qom/object.h | 35 ++++++++++++++++++-----------------
 1 file changed, 18 insertions(+), 17 deletions(-)
include/qom/object.h +18 -17
index f515230f61..500e7dfa99 100644
@@ -555,7 +555,8 @@ struct Object
 
 /**
  * OBJECT_DECLARE_TYPE:
- * @ModuleObjName: the object name with initial capitalization
+ * @InstanceType: instance struct name
+ * @ClassType: class struct name
  * @module_obj_name: the object name in lowercase with underscore separators
  * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
  *
@@ -567,33 +568,33 @@ struct Object
  *
  * The object struct and class struct need to be declared manually.
  */
-#define OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \
-    typedef struct ModuleObjName ModuleObjName; \
-    typedef struct ModuleObjName##Class ModuleObjName##Class; \
+#define OBJECT_DECLARE_TYPE(InstanceType, ClassType, module_obj_name, MODULE_OBJ_NAME) \
+    typedef struct InstanceType InstanceType; \
+    typedef struct ClassType ClassType; \
     \
-    G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, object_unref) \
+    G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \
     \
-    static inline G_GNUC_UNUSED ModuleObjName##Class * \
+    static inline G_GNUC_UNUSED ClassType * \
     MODULE_OBJ_NAME##_GET_CLASS(void *obj) \
-    { return OBJECT_GET_CLASS(ModuleObjName##Class, obj, \
+    { return OBJECT_GET_CLASS(ClassType, obj, \
                               TYPE_##MODULE_OBJ_NAME); } \
     \
-    static inline G_GNUC_UNUSED ModuleObjName##Class * \
+    static inline G_GNUC_UNUSED ClassType * \
     MODULE_OBJ_NAME##_CLASS(void *klass) \
-    { return OBJECT_CLASS_CHECK(ModuleObjName##Class, klass, \
+    { return OBJECT_CLASS_CHECK(ClassType, klass, \
                                 TYPE_##MODULE_OBJ_NAME); } \
     \
-    static inline G_GNUC_UNUSED ModuleObjName * \
+    static inline G_GNUC_UNUSED InstanceType * \
     MODULE_OBJ_NAME(void *obj) \
-    { return OBJECT_CHECK(ModuleObjName, obj, \
+    { return OBJECT_CHECK(InstanceType, obj, \
                           TYPE_##MODULE_OBJ_NAME); }
 
 /**
  * OBJECT_DECLARE_SIMPLE_TYPE:
- * @ModuleObjName: the object name with initial caps
+ * @InstanceType: instance struct name
  * @module_obj_name: the object name in lowercase with underscore separators
  * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
- * @ParentModuleObjName: the parent object name with initial caps
+ * @ParentClassType: class struct name of parent type
  *
  * This does the same as OBJECT_DECLARE_TYPE(), but also declares
  * the class struct, thus only the object struct needs to be declare
@@ -602,10 +603,10 @@ struct Object
  * This macro should be used unless the class struct needs to have
  * virtual methods declared.
  */
-#define OBJECT_DECLARE_SIMPLE_TYPE(ModuleObjName, module_obj_name, \
-                                   MODULE_OBJ_NAME, ParentModuleObjName) \
-    OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \
-    struct ModuleObjName##Class { ParentModuleObjName##Class parent_class; };
+#define OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, module_obj_name, \
+                                   MODULE_OBJ_NAME, ParentClassType) \
+    OBJECT_DECLARE_TYPE(InstanceType, InstanceType##Class, module_obj_name, MODULE_OBJ_NAME) \
+    struct InstanceType##Class { ParentClassType parent_class; };
 
 
 /**
Signature · 1 line
2.26.2
#4 lore raw

[PULL 05/34] qom: DECLARE_*_CHECKERS macros

In reply to Eduardo Habkost

Sometimes the typedefs are buried inside another header, but we want to benefit from the automatic definition of type cast functions. Introduce macros that will let type checkers be defined when typedefs are already available.

Message-Id: <[email protected]>

---
 include/qom/object.h | 72 +++++++++++++++++++++++++++++++++++---------
 1 file changed, 58 insertions(+), 14 deletions(-)
include/qom/object.h +58 -14
index 500e7dfa99..4cd84998c2 100644
@@ -553,6 +553,62 @@ struct Object
     Object *parent;
 };
 
+/**
+ * DECLARE_INSTANCE_CHECKER:
+ * @InstanceType: instance struct name
+ * @OBJ_NAME: the object name in uppercase with underscore separators
+ * @TYPENAME: type name
+ *
+ * Direct usage of this macro should be avoided, and the complete
+ * OBJECT_DECLARE_TYPE macro is recommended instead.
+ *
+ * This macro will provide the three standard type cast functions for a
+ * QOM type.
+ */
+#define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
+    static inline G_GNUC_UNUSED InstanceType * \
+    OBJ_NAME(void *obj) \
+    { return OBJECT_CHECK(InstanceType, obj, TYPENAME); }
+
+/**
+ * DECLARE_CLASS_CHECKERS:
+ * @ClassType: class struct name
+ * @OBJ_NAME: the object name in uppercase with underscore separators
+ * @TYPENAME: type name
+ *
+ * Direct usage of this macro should be avoided, and the complete
+ * OBJECT_DECLARE_TYPE macro is recommended instead.
+ *
+ * This macro will provide the three standard type cast functions for a
+ * QOM type.
+ */
+#define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \
+    static inline G_GNUC_UNUSED ClassType * \
+    OBJ_NAME##_GET_CLASS(void *obj) \
+    { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \
+    \
+    static inline G_GNUC_UNUSED ClassType * \
+    OBJ_NAME##_CLASS(void *klass) \
+    { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); }
+
+/**
+ * DECLARE_OBJ_CHECKERS:
+ * @InstanceType: instance struct name
+ * @ClassType: class struct name
+ * @OBJ_NAME: the object name in uppercase with underscore separators
+ * @TYPENAME: type name
+ *
+ * Direct usage of this macro should be avoided, and the complete
+ * OBJECT_DECLARE_TYPE macro is recommended instead.
+ *
+ * This macro will provide the three standard type cast functions for a
+ * QOM type.
+ */
+#define DECLARE_OBJ_CHECKERS(InstanceType, ClassType, OBJ_NAME, TYPENAME) \
+    DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
+    \
+    DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME)
+
 /**
  * OBJECT_DECLARE_TYPE:
  * @InstanceType: instance struct name
@@ -574,20 +630,8 @@ struct Object
     \
     G_DEFINE_AUTOPTR_CLEANUP_FUNC(InstanceType, object_unref) \
     \
-    static inline G_GNUC_UNUSED ClassType * \
-    MODULE_OBJ_NAME##_GET_CLASS(void *obj) \
-    { return OBJECT_GET_CLASS(ClassType, obj, \
-                              TYPE_##MODULE_OBJ_NAME); } \
-    \
-    static inline G_GNUC_UNUSED ClassType * \
-    MODULE_OBJ_NAME##_CLASS(void *klass) \
-    { return OBJECT_CLASS_CHECK(ClassType, klass, \
-                                TYPE_##MODULE_OBJ_NAME); } \
-    \
-    static inline G_GNUC_UNUSED InstanceType * \
-    MODULE_OBJ_NAME(void *obj) \
-    { return OBJECT_CHECK(InstanceType, obj, \
-                          TYPE_##MODULE_OBJ_NAME); }
+    DECLARE_OBJ_CHECKERS(InstanceType, ClassType, \
+                         MODULE_OBJ_NAME, TYPE_##MODULE_OBJ_NAME)
 
 /**
  * OBJECT_DECLARE_SIMPLE_TYPE:
Signature · 1 line
2.26.2
#5 lore raw

[PULL 11/34] Use DECLARE_*CHECKER* when possible (--force mode)

In reply to Eduardo Habkost

Separate run of the TypeCheckMacro converter using the --force flag, for the cases where typedefs weren't found in the same header nor in typedefs.h.

Generated initially using:

 $ ./scripts/codeconverter/converter.py --force -i \
   --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]')

Then each case was manually reviewed, and a comment was added indicating what's unusual about those type checking macros/functions. Despite not following the usual pattern, the changes in this patch were found to be safe.

Message-Id: <[email protected]>

---
 include/hw/intc/arm_gic.h       | 9 +++------
 include/hw/intc/arm_gicv3.h     | 8 +++-----
 include/hw/ppc/xics_spapr.h     | 4 +++-
 include/hw/virtio/virtio-mmio.h | 9 +++------
 hw/intc/apic.c                  | 5 +++--
 hw/intc/arm_gic_kvm.c           | 9 +++------
 hw/intc/arm_gicv3_its_kvm.c     | 8 +++-----
 hw/intc/arm_gicv3_kvm.c         | 9 +++------
 hw/sd/allwinner-sdhost.c        | 5 +++--
 hw/sd/bcm2835_sdhost.c          | 5 +++--
 hw/sd/pxa2xx_mmci.c             | 4 +++-
 hw/sd/sdhci.c                   | 4 +++-
 12 files changed, 36 insertions(+), 43 deletions(-)
include/hw/intc/arm_gic.h +3 -6
index 704ef2b751..116ccbb5a9 100644
@@ -74,12 +74,9 @@
 
 #define TYPE_ARM_GIC "arm_gic"
 typedef struct ARMGICClass ARMGICClass;
-#define ARM_GIC(obj) \
-     OBJECT_CHECK(GICState, (obj), TYPE_ARM_GIC)
-#define ARM_GIC_CLASS(klass) \
-     OBJECT_CLASS_CHECK(ARMGICClass, (klass), TYPE_ARM_GIC)
-#define ARM_GIC_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(ARMGICClass, (obj), TYPE_ARM_GIC)
+/* This is reusing the GICState typedef from TYPE_ARM_GIC_COMMON */
+DECLARE_OBJ_CHECKERS(GICState, ARMGICClass,
+                     ARM_GIC, TYPE_ARM_GIC)
 
 struct ARMGICClass {
     /*< private >*/
include/hw/intc/arm_gicv3.h +3 -5
index 58e9131a33..a81a6ae7ec 100644
@@ -17,11 +17,9 @@
 
 #define TYPE_ARM_GICV3 "arm-gicv3"
 typedef struct ARMGICv3Class ARMGICv3Class;
-#define ARM_GICV3(obj) OBJECT_CHECK(GICv3State, (obj), TYPE_ARM_GICV3)
-#define ARM_GICV3_CLASS(klass) \
-     OBJECT_CLASS_CHECK(ARMGICv3Class, (klass), TYPE_ARM_GICV3)
-#define ARM_GICV3_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(ARMGICv3Class, (obj), TYPE_ARM_GICV3)
+/* This is reusing the GICState typedef from TYPE_ARM_GICV3_COMMON */
+DECLARE_OBJ_CHECKERS(GICv3State, ARMGICv3Class,
+                     ARM_GICV3, TYPE_ARM_GICV3)
 
 struct ARMGICv3Class {
     /*< private >*/
include/hw/ppc/xics_spapr.h +3 -1
index 09e428de4e..0b8182e40b 100644
@@ -31,7 +31,9 @@
 #include "qom/object.h"
 
 #define TYPE_ICS_SPAPR "ics-spapr"
-#define ICS_SPAPR(obj) OBJECT_CHECK(ICSState, (obj), TYPE_ICS_SPAPR)
+/* This is reusing the ICSState typedef from TYPE_ICS */
+DECLARE_INSTANCE_CHECKER(ICSState, ICS_SPAPR,
+                         TYPE_ICS_SPAPR)
 
 int xics_kvm_connect(SpaprInterruptController *intc, uint32_t nr_servers,
                      Error **errp);
include/hw/virtio/virtio-mmio.h +3 -6
index dca651fd14..6a1c2c20d4 100644
@@ -28,12 +28,9 @@
 /* QOM macros */
 /* virtio-mmio-bus */
 #define TYPE_VIRTIO_MMIO_BUS "virtio-mmio-bus"
-#define VIRTIO_MMIO_BUS(obj) \
-        OBJECT_CHECK(VirtioBusState, (obj), TYPE_VIRTIO_MMIO_BUS)
-#define VIRTIO_MMIO_BUS_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(VirtioBusClass, (obj), TYPE_VIRTIO_MMIO_BUS)
-#define VIRTIO_MMIO_BUS_CLASS(klass) \
-        OBJECT_CLASS_CHECK(VirtioBusClass, (klass), TYPE_VIRTIO_MMIO_BUS)
+/* This is reusing the VirtioBusState typedef from TYPE_VIRTIO_BUS */
+DECLARE_OBJ_CHECKERS(VirtioBusState, VirtioBusClass,
+                     VIRTIO_MMIO_BUS, TYPE_VIRTIO_MMIO_BUS)
 
 /* virtio-mmio */
 #define TYPE_VIRTIO_MMIO "virtio-mmio"
hw/intc/apic.c +3 -2
index e055bb3af2..b6a05e5439 100644
@@ -40,8 +40,9 @@
 static APICCommonState *local_apics[MAX_APICS + 1];
 
 #define TYPE_APIC "apic"
-#define APIC(obj) \
-    OBJECT_CHECK(APICCommonState, (obj), TYPE_APIC)
+/*This is reusing the APICCommonState typedef from APIC_COMMON */
+DECLARE_INSTANCE_CHECKER(APICCommonState, APIC,
+                         TYPE_APIC)
 
 static void apic_set_irq(APICCommonState *s, int vector_num, int trigger_mode);
 static void apic_update_irq(APICCommonState *s);
hw/intc/arm_gic_kvm.c +3 -6
index 6e5a2b8fe0..9494185cf4 100644
@@ -33,12 +33,9 @@
 
 #define TYPE_KVM_ARM_GIC "kvm-arm-gic"
 typedef struct KVMARMGICClass KVMARMGICClass;
-#define KVM_ARM_GIC(obj) \
-     OBJECT_CHECK(GICState, (obj), TYPE_KVM_ARM_GIC)
-#define KVM_ARM_GIC_CLASS(klass) \
-     OBJECT_CLASS_CHECK(KVMARMGICClass, (klass), TYPE_KVM_ARM_GIC)
-#define KVM_ARM_GIC_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(KVMARMGICClass, (obj), TYPE_KVM_ARM_GIC)
+/* This is reusing the GICState typedef from ARM_GIC_COMMON */
+DECLARE_OBJ_CHECKERS(GICState, KVMARMGICClass,
+                     KVM_ARM_GIC, TYPE_KVM_ARM_GIC)
 
 struct KVMARMGICClass {
     ARMGICCommonClass parent_class;
hw/intc/arm_gicv3_its_kvm.c +3 -5
index 631adc34b6..4ee9875ecc 100644
@@ -31,11 +31,9 @@
 
 #define TYPE_KVM_ARM_ITS "arm-its-kvm"
 typedef struct KVMARMITSClass KVMARMITSClass;
-#define KVM_ARM_ITS(obj) OBJECT_CHECK(GICv3ITSState, (obj), TYPE_KVM_ARM_ITS)
-#define KVM_ARM_ITS_CLASS(klass) \
-     OBJECT_CLASS_CHECK(KVMARMITSClass, (klass), TYPE_KVM_ARM_ITS)
-#define KVM_ARM_ITS_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(KVMARMITSClass, (obj), TYPE_KVM_ARM_ITS)
+/* This is reusing the GICv3ITSState typedef from ARM_GICV3_ITS_COMMON */
+DECLARE_OBJ_CHECKERS(GICv3ITSState, KVMARMITSClass,
+                     KVM_ARM_ITS, TYPE_KVM_ARM_ITS)
 
 struct KVMARMITSClass {
     GICv3ITSCommonClass parent_class;
hw/intc/arm_gicv3_kvm.c +3 -6
index 5733936334..187eb054e0 100644
@@ -43,12 +43,9 @@
 
 #define TYPE_KVM_ARM_GICV3 "kvm-arm-gicv3"
 typedef struct KVMARMGICv3Class KVMARMGICv3Class;
-#define KVM_ARM_GICV3(obj) \
-     OBJECT_CHECK(GICv3State, (obj), TYPE_KVM_ARM_GICV3)
-#define KVM_ARM_GICV3_CLASS(klass) \
-     OBJECT_CLASS_CHECK(KVMARMGICv3Class, (klass), TYPE_KVM_ARM_GICV3)
-#define KVM_ARM_GICV3_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(KVMARMGICv3Class, (obj), TYPE_KVM_ARM_GICV3)
+/* This is reusing the GICv3State typedef from ARM_GICV3_ITS_COMMON */
+DECLARE_OBJ_CHECKERS(GICv3State, KVMARMGICv3Class,
+                     KVM_ARM_GICV3, TYPE_KVM_ARM_GICV3)
 
 #define   KVM_DEV_ARM_VGIC_SYSREG(op0, op1, crn, crm, op2)         \
                              (ARM64_SYS_REG_SHIFT_MASK(op0, OP0) | \
hw/sd/allwinner-sdhost.c +3 -2
index e0cc5847f3..bea6d97ef8 100644
@@ -32,8 +32,9 @@
 #include "qom/object.h"
 
 #define TYPE_AW_SDHOST_BUS "allwinner-sdhost-bus"
-#define AW_SDHOST_BUS(obj) \
-    OBJECT_CHECK(SDBus, (obj), TYPE_AW_SDHOST_BUS)
+/* This is reusing the SDBus typedef from SD_BUS */
+DECLARE_INSTANCE_CHECKER(SDBus, AW_SDHOST_BUS,
+                         TYPE_AW_SDHOST_BUS)
 
 /* SD Host register offsets */
 enum {
hw/sd/bcm2835_sdhost.c +3 -2
index 743abccbae..50f5fdb88b 100644
@@ -22,8 +22,9 @@
 #include "qom/object.h"
 
 #define TYPE_BCM2835_SDHOST_BUS "bcm2835-sdhost-bus"
-#define BCM2835_SDHOST_BUS(obj) \
-    OBJECT_CHECK(SDBus, (obj), TYPE_BCM2835_SDHOST_BUS)
+/* This is reusing the SDBus typedef from SD_BUS */
+DECLARE_INSTANCE_CHECKER(SDBus, BCM2835_SDHOST_BUS,
+                         TYPE_BCM2835_SDHOST_BUS)
 
 #define SDCMD  0x00 /* Command to SD card              - 16 R/W */
 #define SDARG  0x04 /* Argument to SD card             - 32 R/W */
hw/sd/pxa2xx_mmci.c +3 -1
index 757a6a3c63..3dd2fc7a83 100644
@@ -24,7 +24,9 @@
 #include "qom/object.h"
 
 #define TYPE_PXA2XX_MMCI_BUS "pxa2xx-mmci-bus"
-#define PXA2XX_MMCI_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_PXA2XX_MMCI_BUS)
+/* This is reusing the SDBus typedef from SD_BUS */
+DECLARE_INSTANCE_CHECKER(SDBus, PXA2XX_MMCI_BUS,
+                         TYPE_PXA2XX_MMCI_BUS)
 
 struct PXA2xxMMCIState {
     SysBusDevice parent_obj;
hw/sd/sdhci.c +3 -1
index 63772bfab6..6900213083 100644
@@ -40,7 +40,9 @@
 #include "qom/object.h"
 
 #define TYPE_SDHCI_BUS "sdhci-bus"
-#define SDHCI_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_SDHCI_BUS)
+/* This is reusing the SDBus typedef from SD_BUS */
+DECLARE_INSTANCE_CHECKER(SDBus, SDHCI_BUS,
+                         TYPE_SDHCI_BUS)
 
 #define MASKED_WRITE(reg, mask, val)  (reg = (reg & (mask)) | (val))
 
Signature · 1 line
2.26.2
#6 lore raw

[PULL 07/34] codeconverter: script for automating QOM code cleanups

In reply to Eduardo Habkost

This started as a simple script that scanned for regular expressions, but became more and more complex when exceptions to the rules were found.

I don't know if this should be maintained in the QEMU source tree long term (maybe it can be reused for other code transformations that Coccinelle can't handle). In either case, this is included as part of the patch series to document how exactly the automated code transformations in the next patches were done.

Message-Id: <[email protected]>

---
 .../codeconverter/codeconverter/__init__.py   |   0
 .../codeconverter/codeconverter/patching.py   | 397 +++++++++++
 .../codeconverter/codeconverter/qom_macros.py | 652 ++++++++++++++++++
 .../codeconverter/qom_type_info.py            | 434 ++++++++++++
 .../codeconverter/codeconverter/regexps.py    | 118 ++++
 .../codeconverter/test_patching.py            | 105 +++
 .../codeconverter/test_regexps.py             | 282 ++++++++
 scripts/codeconverter/codeconverter/utils.py  |  72 ++
 scripts/codeconverter/converter.py            | 123 ++++
 MAINTAINERS                                   |   5 +
 10 files changed, 2188 insertions(+)
 create mode 100644 scripts/codeconverter/codeconverter/__init__.py
 create mode 100644 scripts/codeconverter/codeconverter/patching.py
 create mode 100644 scripts/codeconverter/codeconverter/qom_macros.py
 create mode 100644 scripts/codeconverter/codeconverter/qom_type_info.py
 create mode 100644 scripts/codeconverter/codeconverter/regexps.py
 create mode 100644 scripts/codeconverter/codeconverter/test_patching.py
 create mode 100644 scripts/codeconverter/codeconverter/test_regexps.py
 create mode 100644 scripts/codeconverter/codeconverter/utils.py
 create mode 100755 scripts/codeconverter/converter.py
scripts/codeconverter/codeconverter/__init__.py new file +0 -0
new file mode 100644
index 0000000000..e69de29bb2
scripts/codeconverter/codeconverter/patching.py new file +397 -0

398 lines not on this page · raw message

scripts/codeconverter/codeconverter/qom_macros.py new file +652 -0

652 lines not on this page · raw message

scripts/codeconverter/codeconverter/qom_type_info.py new file +434 -0

434 lines not on this page · raw message

scripts/codeconverter/codeconverter/regexps.py new file +118 -0

118 lines not on this page · raw message

scripts/codeconverter/codeconverter/test_patching.py new file +105 -0

105 lines not on this page · raw message

scripts/codeconverter/codeconverter/test_regexps.py new file +282 -0

282 lines not on this page · raw message

scripts/codeconverter/codeconverter/utils.py new file +72 -0

73 lines not on this page · raw message

scripts/codeconverter/converter.py new file +123 -0

124 lines not on this page · raw message

MAINTAINERS +5 -0
index 7d0a5e91e4..cf96fa8379 100644
@@ -2423,6 +2423,11 @@ F: tests/check-qom-interface.c
 F: tests/check-qom-proplist.c
 F: tests/test-qdev-global-props.c
 
+QOM boilerplate conversion script
+M: Eduardo Habkost <[email protected]>
+S: Maintained
+F: scripts/codeconverter/
+
 QMP
 M: Markus Armbruster <[email protected]>
 S: Supported
Signature · 1 line
2.26.2
#7 lore raw

[PULL 15/34] chardev: Rename TYPE_CHARDEV_* to TYPE_*_CHARDEV

In reply to Eduardo Habkost

This will make the TYPE_* constants consistent with the name of most type checking macros we have today.

Message-Id: <[email protected]>

---
 chardev/chardev-internal.h       |  4 ++--
 include/chardev/char-fd.h        |  4 ++--
 include/chardev/char-win-stdio.h |  2 +-
 include/chardev/char-win.h       |  4 ++--
 include/chardev/char.h           | 30 +++++++++++++++---------------
 include/chardev/spice.h          |  8 ++++----
 chardev/baum.c                   |  6 +++---
 chardev/char-console.c           |  4 ++--
 chardev/char-fd.c                |  2 +-
 chardev/char-file.c              |  6 +++---
 chardev/char-mux.c               |  2 +-
 chardev/char-null.c              |  2 +-
 chardev/char-parallel.c          |  4 ++--
 chardev/char-pipe.c              |  6 +++---
 chardev/char-pty.c               |  4 ++--
 chardev/char-ringbuf.c           |  8 ++++----
 chardev/char-serial.c            |  6 +++---
 chardev/char-socket.c            |  4 ++--
 chardev/char-stdio.c             |  6 +++---
 chardev/char-udp.c               |  4 ++--
 chardev/char-win-stdio.c         |  4 ++--
 chardev/char-win.c               |  2 +-
 chardev/char.c                   |  2 +-
 chardev/msmouse.c                |  6 +++---
 chardev/spice.c                  | 10 +++++-----
 chardev/testdev.c                |  6 +++---
 chardev/wctablet.c               |  6 +++---
 gdbstub.c                        |  6 +++---
 hw/display/vhost-user-gpu.c      |  2 +-
 tests/test-char.c                |  4 ++--
 ui/console.c                     |  8 ++++----
 ui/gtk.c                         |  6 +++---
 ui/spice-app.c                   | 10 +++++-----
 33 files changed, 94 insertions(+), 94 deletions(-)
chardev/chardev-internal.h +2 -2
index aba0240759..832dc10a95 100644
@@ -55,9 +55,9 @@ struct MuxChardev {
 typedef struct MuxChardev MuxChardev;
 
 DECLARE_INSTANCE_CHECKER(MuxChardev, MUX_CHARDEV,
-                         TYPE_CHARDEV_MUX)
+                         TYPE_MUX_CHARDEV)
 #define CHARDEV_IS_MUX(chr)                             \
-    object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX)
+    object_dynamic_cast(OBJECT(chr), TYPE_MUX_CHARDEV)
 
 void mux_set_focus(Chardev *chr, int focus);
 void mux_chr_send_all_event(Chardev *chr, QEMUChrEvent event);
include/chardev/char-fd.h +2 -2
index 9de0e440de..14c664fc83 100644
@@ -36,10 +36,10 @@ struct FDChardev {
 };
 typedef struct FDChardev FDChardev;
 
-#define TYPE_CHARDEV_FD "chardev-fd"
+#define TYPE_FD_CHARDEV "chardev-fd"
 
 DECLARE_INSTANCE_CHECKER(FDChardev, FD_CHARDEV,
-                         TYPE_CHARDEV_FD)
+                         TYPE_FD_CHARDEV)
 
 void qemu_chr_open_fd(Chardev *chr, int fd_in, int fd_out);
 int qmp_chardev_open_file_source(char *src, int flags, Error **errp);
include/chardev/char-win-stdio.h +1 -1
index d7314f734d..139dfbe92f 100644
@@ -24,6 +24,6 @@
 #ifndef CHAR_WIN_STDIO_H
 #define CHAR_WIN_STDIO_H
 
-#define TYPE_CHARDEV_WIN_STDIO "chardev-win-stdio"
+#define TYPE_WIN_STDIO_CHARDEV "chardev-win-stdio"
 
 #endif /* CHAR_WIN_STDIO_H */
include/chardev/char-win.h +2 -2
index 485521469c..a1745ba267 100644
@@ -43,9 +43,9 @@ typedef struct WinChardev WinChardev;
 #define NSENDBUF 2048
 #define NRECVBUF 2048
 
-#define TYPE_CHARDEV_WIN "chardev-win"
+#define TYPE_WIN_CHARDEV "chardev-win"
 DECLARE_INSTANCE_CHECKER(WinChardev, WIN_CHARDEV,
-                         TYPE_CHARDEV_WIN)
+                         TYPE_WIN_CHARDEV)
 
 void win_chr_set_file(Chardev *chr, HANDLE file, bool keep_open);
 int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp);
include/chardev/char.h +15 -15
index 5874de57ea..0f358a4eee 100644
@@ -230,24 +230,24 @@ typedef struct ChardevClass ChardevClass;
 DECLARE_OBJ_CHECKERS(Chardev, ChardevClass,
                      CHARDEV, TYPE_CHARDEV)
 
-#define TYPE_CHARDEV_NULL "chardev-null"
-#define TYPE_CHARDEV_MUX "chardev-mux"
-#define TYPE_CHARDEV_RINGBUF "chardev-ringbuf"
-#define TYPE_CHARDEV_PTY "chardev-pty"
-#define TYPE_CHARDEV_CONSOLE "chardev-console"
-#define TYPE_CHARDEV_STDIO "chardev-stdio"
-#define TYPE_CHARDEV_PIPE "chardev-pipe"
-#define TYPE_CHARDEV_MEMORY "chardev-memory"
-#define TYPE_CHARDEV_PARALLEL "chardev-parallel"
-#define TYPE_CHARDEV_FILE "chardev-file"
-#define TYPE_CHARDEV_SERIAL "chardev-serial"
-#define TYPE_CHARDEV_SOCKET "chardev-socket"
-#define TYPE_CHARDEV_UDP "chardev-udp"
+#define TYPE_NULL_CHARDEV "chardev-null"
+#define TYPE_MUX_CHARDEV "chardev-mux"
+#define TYPE_RINGBUF_CHARDEV "chardev-ringbuf"
+#define TYPE_PTY_CHARDEV "chardev-pty"
+#define TYPE_CONSOLE_CHARDEV "chardev-console"
+#define TYPE_STDIO_CHARDEV "chardev-stdio"
+#define TYPE_PIPE_CHARDEV "chardev-pipe"
+#define TYPE_MEMORY_CHARDEV "chardev-memory"
+#define TYPE_PARALLEL_CHARDEV "chardev-parallel"
+#define TYPE_FILE_CHARDEV "chardev-file"
+#define TYPE_SERIAL_CHARDEV "chardev-serial"
+#define TYPE_SOCKET_CHARDEV "chardev-socket"
+#define TYPE_UDP_CHARDEV "chardev-udp"
 
 #define CHARDEV_IS_RINGBUF(chr) \
-    object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_RINGBUF)
+    object_dynamic_cast(OBJECT(chr), TYPE_RINGBUF_CHARDEV)
 #define CHARDEV_IS_PTY(chr) \
-    object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_PTY)
+    object_dynamic_cast(OBJECT(chr), TYPE_PTY_CHARDEV)
 
 struct ChardevClass {
     ObjectClass parent_class;
include/chardev/spice.h +4 -4
index 99f26aedde..302573b582 100644
@@ -17,12 +17,12 @@ struct SpiceChardev {
 };
 typedef struct SpiceChardev SpiceChardev;
 
-#define TYPE_CHARDEV_SPICE "chardev-spice"
-#define TYPE_CHARDEV_SPICEVMC "chardev-spicevmc"
-#define TYPE_CHARDEV_SPICEPORT "chardev-spiceport"
+#define TYPE_SPICE_CHARDEV "chardev-spice"
+#define TYPE_SPICEVMC_CHARDEV "chardev-spicevmc"
+#define TYPE_SPICEPORT_CHARDEV "chardev-spiceport"
 
 DECLARE_INSTANCE_CHECKER(SpiceChardev, SPICE_CHARDEV,
-                         TYPE_CHARDEV_SPICE)
+                         TYPE_SPICE_CHARDEV)
 
 void qemu_chr_open_spice_port(Chardev *chr, ChardevBackend *backend,
                               bool *be_opened, Error **errp);
chardev/baum.c +3 -3
index 5deca778bc..d6c9f698c1 100644
@@ -104,9 +104,9 @@ struct BaumChardev {
 };
 typedef struct BaumChardev BaumChardev;
 
-#define TYPE_CHARDEV_BRAILLE "chardev-braille"
+#define TYPE_BRAILLE_CHARDEV "chardev-braille"
 DECLARE_INSTANCE_CHECKER(BaumChardev, BAUM_CHARDEV,
-                         TYPE_CHARDEV_BRAILLE)
+                         TYPE_BRAILLE_CHARDEV)
 
 /* Let's assume NABCC by default */
 enum way {
@@ -674,7 +674,7 @@ static void char_braille_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_braille_type_info = {
-    .name = TYPE_CHARDEV_BRAILLE,
+    .name = TYPE_BRAILLE_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(BaumChardev),
     .instance_finalize = char_braille_finalize,
chardev/char-console.c +2 -2
index 6c4ce5dbce..5d175389fd 100644
@@ -42,8 +42,8 @@ static void char_console_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_console_type_info = {
-    .name = TYPE_CHARDEV_CONSOLE,
-    .parent = TYPE_CHARDEV_WIN,
+    .name = TYPE_CONSOLE_CHARDEV,
+    .parent = TYPE_WIN_CHARDEV,
     .class_init = char_console_class_init,
 };
 
chardev/char-fd.c +1 -1
index c2d8101106..031fe2a2d6 100644
@@ -154,7 +154,7 @@ static void char_fd_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_fd_type_info = {
-    .name = TYPE_CHARDEV_FD,
+    .name = TYPE_FD_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(FDChardev),
     .instance_finalize = char_fd_finalize,
chardev/char-file.c +3 -3
index 2fd80707e5..fc53bdb4aa 100644
@@ -124,11 +124,11 @@ static void char_file_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_file_type_info = {
-    .name = TYPE_CHARDEV_FILE,
+    .name = TYPE_FILE_CHARDEV,
 #ifdef _WIN32
-    .parent = TYPE_CHARDEV_WIN,
+    .parent = TYPE_WIN_CHARDEV,
 #else
-    .parent = TYPE_CHARDEV_FD,
+    .parent = TYPE_FD_CHARDEV,
 #endif
     .class_init = char_file_class_init,
 };
chardev/char-mux.c +1 -1
index 6f980bb836..8930b4d5e8 100644
@@ -388,7 +388,7 @@ static void char_mux_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_mux_type_info = {
-    .name = TYPE_CHARDEV_MUX,
+    .name = TYPE_MUX_CHARDEV,
     .parent = TYPE_CHARDEV,
     .class_init = char_mux_class_init,
     .instance_size = sizeof(MuxChardev),
chardev/char-null.c +1 -1
index 1c6a2900f9..fcddd33452 100644
@@ -42,7 +42,7 @@ static void char_null_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_null_type_info = {
-    .name = TYPE_CHARDEV_NULL,
+    .name = TYPE_NULL_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(Chardev),
     .class_init = char_null_class_init,
chardev/char-parallel.c +2 -2
index 66e4589b2b..289c1b002c 100644
@@ -58,7 +58,7 @@ struct ParallelChardev {
 typedef struct ParallelChardev ParallelChardev;
 
 DECLARE_INSTANCE_CHECKER(ParallelChardev, PARALLEL_CHARDEV,
-                         TYPE_CHARDEV_PARALLEL)
+                         TYPE_PARALLEL_CHARDEV)
 
 static int pp_hw_mode(ParallelChardev *s, uint16_t mode)
 {
@@ -303,7 +303,7 @@ static void char_parallel_finalize(Object *obj)
 }
 
 static const TypeInfo char_parallel_type_info = {
-    .name = TYPE_CHARDEV_PARALLEL,
+    .name = TYPE_PARALLEL_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(ParallelChardev),
     .instance_finalize = char_parallel_finalize,
chardev/char-pipe.c +3 -3
index fd12c9e63b..7458433256 100644
@@ -179,11 +179,11 @@ static void char_pipe_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_pipe_type_info = {
-    .name = TYPE_CHARDEV_PIPE,
+    .name = TYPE_PIPE_CHARDEV,
 #ifdef _WIN32
-    .parent = TYPE_CHARDEV_WIN,
+    .parent = TYPE_WIN_CHARDEV,
 #else
-    .parent = TYPE_CHARDEV_FD,
+    .parent = TYPE_FD_CHARDEV,
 #endif
     .class_init = char_pipe_class_init,
 };
chardev/char-pty.c +2 -2
index a2d1e7c985..9cf77596d2 100644
@@ -46,7 +46,7 @@ struct PtyChardev {
 typedef struct PtyChardev PtyChardev;
 
 DECLARE_INSTANCE_CHECKER(PtyChardev, PTY_CHARDEV,
-                         TYPE_CHARDEV_PTY)
+                         TYPE_PTY_CHARDEV)
 
 static void pty_chr_state(Chardev *chr, int connected);
 
@@ -240,7 +240,7 @@ static void char_pty_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_pty_type_info = {
-    .name = TYPE_CHARDEV_PTY,
+    .name = TYPE_PTY_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(PtyChardev),
     .instance_finalize = char_pty_finalize,
chardev/char-ringbuf.c +4 -4
index d40d21d3cf..edeb7daeae 100644
@@ -43,7 +43,7 @@ struct RingBufChardev {
 typedef struct RingBufChardev RingBufChardev;
 
 DECLARE_INSTANCE_CHECKER(RingBufChardev, RINGBUF_CHARDEV,
-                         TYPE_CHARDEV_RINGBUF)
+                         TYPE_RINGBUF_CHARDEV)
 
 static size_t ringbuf_count(const Chardev *chr)
 {
@@ -233,7 +233,7 @@ static void char_ringbuf_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_ringbuf_type_info = {
-    .name = TYPE_CHARDEV_RINGBUF,
+    .name = TYPE_RINGBUF_CHARDEV,
     .parent = TYPE_CHARDEV,
     .class_init = char_ringbuf_class_init,
     .instance_size = sizeof(RingBufChardev),
@@ -242,8 +242,8 @@ static const TypeInfo char_ringbuf_type_info = {
 
 /* Bug-compatibility: */
 static const TypeInfo char_memory_type_info = {
-    .name = TYPE_CHARDEV_MEMORY,
-    .parent = TYPE_CHARDEV_RINGBUF,
+    .name = TYPE_MEMORY_CHARDEV,
+    .parent = TYPE_RINGBUF_CHARDEV,
 };
 
 static void register_types(void)
chardev/char-serial.c +3 -3
index 7c3d84ae24..381107bd89 100644
@@ -308,11 +308,11 @@ static void char_serial_class_init(ObjectClass *oc, void *data)
 
 
 static const TypeInfo char_serial_type_info = {
-    .name = TYPE_CHARDEV_SERIAL,
+    .name = TYPE_SERIAL_CHARDEV,
 #ifdef _WIN32
-    .parent = TYPE_CHARDEV_WIN,
+    .parent = TYPE_WIN_CHARDEV,
 #else
-    .parent = TYPE_CHARDEV_FD,
+    .parent = TYPE_FD_CHARDEV,
 #endif
     .class_init = char_serial_class_init,
 };
chardev/char-socket.c +2 -2
index 95e45812d5..bb5ddc586c 100644
@@ -89,7 +89,7 @@ struct SocketChardev {
 typedef struct SocketChardev SocketChardev;
 
 DECLARE_INSTANCE_CHECKER(SocketChardev, SOCKET_CHARDEV,
-                         TYPE_CHARDEV_SOCKET)
+                         TYPE_SOCKET_CHARDEV)
 
 static gboolean socket_reconnect_timeout(gpointer opaque);
 static void tcp_chr_telnet_init(Chardev *chr);
@@ -1506,7 +1506,7 @@ static void char_socket_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_socket_type_info = {
-    .name = TYPE_CHARDEV_SOCKET,
+    .name = TYPE_SOCKET_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(SocketChardev),
     .instance_finalize = char_socket_finalize,
chardev/char-stdio.c +3 -3
index 82eaebc1db..fb28eaeb87 100644
@@ -150,11 +150,11 @@ static void char_stdio_finalize(Object *obj)
 }
 
 static const TypeInfo char_stdio_type_info = {
-    .name = TYPE_CHARDEV_STDIO,
+    .name = TYPE_STDIO_CHARDEV,
 #ifdef _WIN32
-    .parent = TYPE_CHARDEV_WIN_STDIO,
+    .parent = TYPE_WIN_STDIO_CHARDEV,
 #else
-    .parent = TYPE_CHARDEV_FD,
+    .parent = TYPE_FD_CHARDEV,
 #endif
     .instance_finalize = char_stdio_finalize,
     .class_init = char_stdio_class_init,
chardev/char-udp.c +2 -2
index 16b5dbce58..6d7b9d2805 100644
@@ -46,7 +46,7 @@ struct UdpChardev {
 typedef struct UdpChardev UdpChardev;
 
 DECLARE_INSTANCE_CHECKER(UdpChardev, UDP_CHARDEV,
-                         TYPE_CHARDEV_UDP)
+                         TYPE_UDP_CHARDEV)
 
 /* Called with chr_write_lock held.  */
 static int udp_chr_write(Chardev *chr, const uint8_t *buf, int len)
@@ -231,7 +231,7 @@ static void char_udp_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_udp_type_info = {
-    .name = TYPE_CHARDEV_UDP,
+    .name = TYPE_UDP_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(UdpChardev),
     .instance_finalize = char_udp_finalize,
chardev/char-win-stdio.c +2 -2
index a4771ab82e..f333b8cedc 100644
@@ -41,7 +41,7 @@ struct WinStdioChardev {
 typedef struct WinStdioChardev WinStdioChardev;
 
 DECLARE_INSTANCE_CHECKER(WinStdioChardev, WIN_STDIO_CHARDEV,
-                         TYPE_CHARDEV_WIN_STDIO)
+                         TYPE_WIN_STDIO_CHARDEV)
 
 static void win_stdio_wait_func(void *opaque)
 {
@@ -255,7 +255,7 @@ static void char_win_stdio_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_win_stdio_type_info = {
-    .name = TYPE_CHARDEV_WIN_STDIO,
+    .name = TYPE_WIN_STDIO_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(WinStdioChardev),
     .instance_finalize = char_win_stdio_finalize,
chardev/char-win.c +1 -1
index d4fb44c4dc..69dcf48873 100644
@@ -228,7 +228,7 @@ static void char_win_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_win_type_info = {
-    .name = TYPE_CHARDEV_WIN,
+    .name = TYPE_WIN_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(WinChardev),
     .instance_finalize = char_win_finalize,
chardev/char.c +1 -1
index 77e7ec814f..afebdc345e 100644
@@ -674,7 +674,7 @@ Chardev *qemu_chr_new_from_opts(QemuOpts *opts, GMainContext *context,
         backend->type = CHARDEV_BACKEND_KIND_MUX;
         backend->u.mux.data = g_new0(ChardevMux, 1);
         backend->u.mux.data->chardev = g_strdup(bid);
-        mux = qemu_chardev_new(id, TYPE_CHARDEV_MUX, backend, context, errp);
+        mux = qemu_chardev_new(id, TYPE_MUX_CHARDEV, backend, context, errp);
         if (mux == NULL) {
             object_unparent(OBJECT(chr));
             chr = NULL;
chardev/msmouse.c +3 -3
index eb9231dcdb..4033ca714d 100644
@@ -44,9 +44,9 @@ struct MouseChardev {
 };
 typedef struct MouseChardev MouseChardev;
 
-#define TYPE_CHARDEV_MSMOUSE "chardev-msmouse"
+#define TYPE_MSMOUSE_CHARDEV "chardev-msmouse"
 DECLARE_INSTANCE_CHECKER(MouseChardev, MOUSE_CHARDEV,
-                         TYPE_CHARDEV_MSMOUSE)
+                         TYPE_MSMOUSE_CHARDEV)
 
 static void msmouse_chr_accept_input(Chardev *chr)
 {
@@ -178,7 +178,7 @@ static void char_msmouse_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_msmouse_type_info = {
-    .name = TYPE_CHARDEV_MSMOUSE,
+    .name = TYPE_MSMOUSE_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(MouseChardev),
     .instance_finalize = char_msmouse_finalize,
chardev/spice.c +5 -5
index bf7ea1e294..7423001b71 100644
@@ -376,7 +376,7 @@ static void char_spice_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_spice_type_info = {
-    .name = TYPE_CHARDEV_SPICE,
+    .name = TYPE_SPICE_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(SpiceChardev),
     .instance_finalize = char_spice_finalize,
@@ -394,8 +394,8 @@ static void char_spicevmc_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_spicevmc_type_info = {
-    .name = TYPE_CHARDEV_SPICEVMC,
-    .parent = TYPE_CHARDEV_SPICE,
+    .name = TYPE_SPICEVMC_CHARDEV,
+    .parent = TYPE_SPICE_CHARDEV,
     .class_init = char_spicevmc_class_init,
 };
 
@@ -409,8 +409,8 @@ static void char_spiceport_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_spiceport_type_info = {
-    .name = TYPE_CHARDEV_SPICEPORT,
-    .parent = TYPE_CHARDEV_SPICE,
+    .name = TYPE_SPICEPORT_CHARDEV,
+    .parent = TYPE_SPICE_CHARDEV,
     .class_init = char_spiceport_class_init,
 };
 
chardev/testdev.c +3 -3
index a92caca3c3..5ef9a59817 100644
@@ -39,9 +39,9 @@ struct TestdevChardev {
 };
 typedef struct TestdevChardev TestdevChardev;
 
-#define TYPE_CHARDEV_TESTDEV "chardev-testdev"
+#define TYPE_TESTDEV_CHARDEV "chardev-testdev"
 DECLARE_INSTANCE_CHECKER(TestdevChardev, TESTDEV_CHARDEV,
-                         TYPE_CHARDEV_TESTDEV)
+                         TYPE_TESTDEV_CHARDEV)
 
 /* Try to interpret a whole incoming packet */
 static int testdev_eat_packet(TestdevChardev *testdev)
@@ -118,7 +118,7 @@ static void char_testdev_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_testdev_type_info = {
-    .name = TYPE_CHARDEV_TESTDEV,
+    .name = TYPE_TESTDEV_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(TestdevChardev),
     .class_init = char_testdev_class_init,
chardev/wctablet.c +3 -3
index 95e005f5a5..2cc018efb3 100644
@@ -85,9 +85,9 @@ struct TabletChardev {
 };
 typedef struct TabletChardev TabletChardev;
 
-#define TYPE_CHARDEV_WCTABLET "chardev-wctablet"
+#define TYPE_WCTABLET_CHARDEV "chardev-wctablet"
 DECLARE_INSTANCE_CHECKER(TabletChardev, WCTABLET_CHARDEV,
-                         TYPE_CHARDEV_WCTABLET)
+                         TYPE_WCTABLET_CHARDEV)
 
 
 static void wctablet_chr_accept_input(Chardev *chr);
@@ -352,7 +352,7 @@ static void wctablet_chr_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo wctablet_type_info = {
-    .name = TYPE_CHARDEV_WCTABLET,
+    .name = TYPE_WCTABLET_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(TabletChardev),
     .instance_finalize = wctablet_chr_finalize,
gdbstub.c +3 -3
index 9dfb6e4142..7afdcf0f37 100644
@@ -3301,10 +3301,10 @@ static void char_gdb_class_init(ObjectClass *oc, void *data)
     cc->chr_write = gdb_monitor_write;
 }
 
-#define TYPE_CHARDEV_GDB "chardev-gdb"
+#define TYPE_GDB_CHARDEV "chardev-gdb"
 
 static const TypeInfo char_gdb_type_info = {
-    .name = TYPE_CHARDEV_GDB,
+    .name = TYPE_GDB_CHARDEV,
     .parent = TYPE_CHARDEV,
     .class_init = char_gdb_class_init,
 };
@@ -3409,7 +3409,7 @@ int gdbserver_start(const char *device)
         qemu_add_vm_change_state_handler(gdb_vm_state_change, NULL);
 
         /* Initialize a monitor terminal for gdb */
-        mon_chr = qemu_chardev_new(NULL, TYPE_CHARDEV_GDB,
+        mon_chr = qemu_chardev_new(NULL, TYPE_GDB_CHARDEV,
                                    NULL, NULL, &error_abort);
         monitor_init_hmp(mon_chr, false, &error_abort);
     } else {
hw/display/vhost-user-gpu.c +1 -1
index 51f1747c4a..f656fb38a7 100644
@@ -388,7 +388,7 @@ vhost_user_gpu_do_set_socket(VhostUserGPU *g, Error **errp)
         return false;
     }
 
-    chr = CHARDEV(object_new(TYPE_CHARDEV_SOCKET));
+    chr = CHARDEV(object_new(TYPE_SOCKET_CHARDEV));
     if (!chr || qemu_chr_add_client(chr, sv[0]) == -1) {
         error_setg(errp, "Failed to make socket chardev");
         goto err;
tests/test-char.c +2 -2
index d35cc839bc..2b2135ec77 100644
@@ -1232,7 +1232,7 @@ static void char_file_fifo_test(void)
     ret = write(fd, "fifo-in", 8);
     g_assert_cmpint(ret, ==, 8);
 
-    chr = qemu_chardev_new("label-file", TYPE_CHARDEV_FILE, &backend,
+    chr = qemu_chardev_new("label-file", TYPE_FILE_CHARDEV, &backend,
                            NULL, &error_abort);
 
     qemu_chr_fe_init(&be, chr, &error_abort);
@@ -1286,7 +1286,7 @@ static void char_file_test_internal(Chardev *ext_chr, const char *filepath)
     } else {
         out = g_build_filename(tmp_path, "out", NULL);
         file.out = out;
-        chr = qemu_chardev_new(NULL, TYPE_CHARDEV_FILE, &backend,
+        chr = qemu_chardev_new(NULL, TYPE_FILE_CHARDEV, &backend,
                                NULL, &error_abort);
     }
     ret = qemu_chr_write_all(chr, (uint8_t *)"hello!", 6);
ui/console.c +4 -4
index f8d7643fe4..965f01e804 100644
@@ -1089,9 +1089,9 @@ struct VCChardev {
 };
 typedef struct VCChardev VCChardev;
 
-#define TYPE_CHARDEV_VC "chardev-vc"
+#define TYPE_VC_CHARDEV "chardev-vc"
 DECLARE_INSTANCE_CHECKER(VCChardev, VC_CHARDEV,
-                         TYPE_CHARDEV_VC)
+                         TYPE_VC_CHARDEV)
 
 static int vc_chr_write(Chardev *chr, const uint8_t *buf, int len)
 {
@@ -2403,7 +2403,7 @@ static void char_vc_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_vc_type_info = {
-    .name = TYPE_CHARDEV_VC,
+    .name = TYPE_VC_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(VCChardev),
     .class_init = char_vc_class_init,
@@ -2412,7 +2412,7 @@ static const TypeInfo char_vc_type_info = {
 void qemu_console_early_init(void)
 {
     /* set the default vc driver */
-    if (!object_class_by_name(TYPE_CHARDEV_VC)) {
+    if (!object_class_by_name(TYPE_VC_CHARDEV)) {
         type_register(&char_vc_type_info);
     }
 }
ui/gtk.c +3 -3
index 1c59de2af4..2734f88e78 100644
@@ -178,9 +178,9 @@ struct VCChardev {
 };
 typedef struct VCChardev VCChardev;
 
-#define TYPE_CHARDEV_VC "chardev-vc"
+#define TYPE_VC_CHARDEV "chardev-vc"
 DECLARE_INSTANCE_CHECKER(VCChardev, VC_CHARDEV,
-                         TYPE_CHARDEV_VC)
+                         TYPE_VC_CHARDEV)
 
 bool gtk_use_gl_area;
 
@@ -1743,7 +1743,7 @@ static void char_gd_vc_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_gd_vc_type_info = {
-    .name = TYPE_CHARDEV_VC,
+    .name = TYPE_VC_CHARDEV,
     .parent = TYPE_CHARDEV,
     .instance_size = sizeof(VCChardev),
     .class_init = char_gd_vc_class_init,
ui/spice-app.c +5 -5
index 93e105c6ee..e69dc21c78 100644
@@ -46,9 +46,9 @@ struct VCChardev {
 };
 typedef struct VCChardev VCChardev;
 
-#define TYPE_CHARDEV_VC "chardev-vc"
+#define TYPE_VC_CHARDEV "chardev-vc"
 DECLARE_INSTANCE_CHECKER(VCChardev, VC_CHARDEV,
-                         TYPE_CHARDEV_VC)
+                         TYPE_VC_CHARDEV)
 
 static ChardevBackend *
 chr_spice_backend_new(void)
@@ -99,8 +99,8 @@ static void char_vc_class_init(ObjectClass *oc, void *data)
 }
 
 static const TypeInfo char_vc_type_info = {
-    .name = TYPE_CHARDEV_VC,
-    .parent = TYPE_CHARDEV_SPICEPORT,
+    .name = TYPE_VC_CHARDEV,
+    .parent = TYPE_SPICEPORT_CHARDEV,
     .instance_size = sizeof(VCChardev),
     .class_init = char_vc_class_init,
 };
@@ -166,7 +166,7 @@ static void spice_app_display_early_init(DisplayOptions *opts)
     display_opengl = opts->has_gl;
 #endif
     be->u.spiceport.data->fqdn = g_strdup("org.qemu.monitor.qmp.0");
-    qemu_chardev_new("org.qemu.monitor.qmp", TYPE_CHARDEV_SPICEPORT,
+    qemu_chardev_new("org.qemu.monitor.qmp", TYPE_SPICEPORT_CHARDEV,
                      be, NULL, &error_abort);
     qopts = qemu_opts_create(qemu_find_opts("mon"),
                              NULL, 0, &error_fatal);
Signature · 1 line
2.26.2
#8 lore raw

[PULL 17/34] dev-smartcard-reader: Rename CCID_DEV_NAME to TYPE_USB_CCID_DEV

In reply to Eduardo Habkost

This will make the type name constant consistent with the name of the type checking macro.

Message-Id: <[email protected]>

---
 hw/usb/dev-smartcard-reader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/usb/dev-smartcard-reader.c +4 -4
index 432508c478..59b2248f34 100644
@@ -60,10 +60,10 @@ do { \
 #define D_MORE_INFO 3
 #define D_VERBOSE 4
 
-#define CCID_DEV_NAME "usb-ccid"
+#define TYPE_USB_CCID_DEV "usb-ccid"
 typedef struct USBCCIDState USBCCIDState;
 DECLARE_INSTANCE_CHECKER(USBCCIDState, USB_CCID_DEV,
-                         CCID_DEV_NAME)
+                         TYPE_USB_CCID_DEV)
 /*
  * The two options for variable sized buffers:
  * make them constant size, for large enough constant,
@@ -1462,7 +1462,7 @@ static void ccid_class_initfn(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo ccid_info = {
-    .name          = CCID_DEV_NAME,
+    .name          = TYPE_USB_CCID_DEV,
     .parent        = TYPE_USB_DEVICE,
     .instance_size = sizeof(USBCCIDState),
     .class_init    = ccid_class_initfn,
@@ -1495,7 +1495,7 @@ static void ccid_register_types(void)
     type_register_static(&ccid_bus_info);
     type_register_static(&ccid_card_type_info);
     type_register_static(&ccid_info);
-    usb_legacy_register(CCID_DEV_NAME, "ccid", NULL);
+    usb_legacy_register(TYPE_USB_CCID_DEV, "ccid", NULL);
 }
 
 type_init(ccid_register_types)
Signature · 1 line
2.26.2
#9 lore raw

[PULL 06/34] qom: Make type checker functions accept const pointers

In reply to Eduardo Habkost

The existing type check macros all unconditionally drop const qualifiers from their arguments. Keep this behavior in the macros generated by DECLARE_*CHECKER* by now.

Message-Id: <[email protected]>

---
 include/qom/object.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
include/qom/object.h +3 -3
index 4cd84998c2..3626ae3c65 100644
@@ -567,7 +567,7 @@ struct Object
  */
 #define DECLARE_INSTANCE_CHECKER(InstanceType, OBJ_NAME, TYPENAME) \
     static inline G_GNUC_UNUSED InstanceType * \
-    OBJ_NAME(void *obj) \
+    OBJ_NAME(const void *obj) \
     { return OBJECT_CHECK(InstanceType, obj, TYPENAME); }
 
 /**
@@ -584,11 +584,11 @@ struct Object
  */
 #define DECLARE_CLASS_CHECKERS(ClassType, OBJ_NAME, TYPENAME) \
     static inline G_GNUC_UNUSED ClassType * \
-    OBJ_NAME##_GET_CLASS(void *obj) \
+    OBJ_NAME##_GET_CLASS(const void *obj) \
     { return OBJECT_GET_CLASS(ClassType, obj, TYPENAME); } \
     \
     static inline G_GNUC_UNUSED ClassType * \
-    OBJ_NAME##_CLASS(void *klass) \
+    OBJ_NAME##_CLASS(const void *klass) \
     { return OBJECT_CLASS_CHECK(ClassType, klass, TYPENAME); }
 
 /**
Signature · 1 line
2.26.2
#10 lore raw

[PULL 16/34] ap-device: Rename AP_DEVICE_TYPE to TYPE_AP_DEVICE

In reply to Eduardo Habkost

This will make the type name constant consistent with the name of the type checking macro.

Message-Id: <[email protected]>

---
 include/hw/s390x/ap-device.h | 4 ++--
 hw/s390x/ap-device.c         | 2 +-
 hw/vfio/ap.c                 | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
include/hw/s390x/ap-device.h +2 -2
index fb250a20f3..e502745de5 100644
@@ -14,7 +14,7 @@
 #include "hw/qdev-core.h"
 #include "qom/object.h"
 
-#define AP_DEVICE_TYPE       "ap-device"
+#define TYPE_AP_DEVICE       "ap-device"
 
 struct APDevice {
     DeviceState parent_obj;
@@ -22,6 +22,6 @@ struct APDevice {
 typedef struct APDevice APDevice;
 
 DECLARE_INSTANCE_CHECKER(APDevice, AP_DEVICE,
-                         AP_DEVICE_TYPE)
+                         TYPE_AP_DEVICE)
 
 #endif /* HW_S390X_AP_DEVICE_H */
hw/s390x/ap-device.c +1 -1
index fc0b41e937..237d1f19c5 100644
@@ -21,7 +21,7 @@ static void ap_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo ap_device_info = {
-    .name = AP_DEVICE_TYPE,
+    .name = TYPE_AP_DEVICE,
     .parent = TYPE_DEVICE,
     .instance_size = sizeof(APDevice),
     .class_size = sizeof(DeviceClass),
hw/vfio/ap.c +1 -1
index f399ec0a31..68ed059b39 100644
@@ -177,7 +177,7 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
 
 static const TypeInfo vfio_ap_info = {
     .name = VFIO_AP_DEVICE_TYPE,
-    .parent = AP_DEVICE_TYPE,
+    .parent = TYPE_AP_DEVICE,
     .instance_size = sizeof(VFIOAPDevice),
     .class_init = vfio_ap_class_init,
 };
Signature · 1 line
2.26.2
#11 lore raw

[PULL 20/34] ahci: Rename ICH_AHCI to ICH9_AHCI

In reply to Eduardo Habkost

Make the type checking macro name consistent with the TYPE_* constant.

Message-Id: <[email protected]>

---
 include/hw/ide/ahci.h | 2 +-
 hw/ide/ahci.c         | 4 ++--
 hw/ide/ich.c          | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)
include/hw/ide/ahci.h +1 -1
index 4cf6813d80..da3cddcc65 100644
@@ -54,7 +54,7 @@ typedef struct AHCIState {
 typedef struct AHCIPCIState AHCIPCIState;
 
 #define TYPE_ICH9_AHCI "ich9-ahci"
-DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH_AHCI,
+DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH9_AHCI,
                          TYPE_ICH9_AHCI)
 
 int32_t ahci_get_num_ports(PCIDevice *dev);
hw/ide/ahci.c +2 -2
index b696c6291a..ee1d47ff75 100644
@@ -1819,7 +1819,7 @@ type_init(sysbus_ahci_register_types)
 
 int32_t ahci_get_num_ports(PCIDevice *dev)
 {
-    AHCIPCIState *d = ICH_AHCI(dev);
+    AHCIPCIState *d = ICH9_AHCI(dev);
     AHCIState *ahci = &d->ahci;
 
     return ahci->ports;
@@ -1827,7 +1827,7 @@ int32_t ahci_get_num_ports(PCIDevice *dev)
 
 void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd)
 {
-    AHCIPCIState *d = ICH_AHCI(dev);
+    AHCIPCIState *d = ICH9_AHCI(dev);
     AHCIState *ahci = &d->ahci;
     int i;
 
hw/ide/ich.c +4 -4
index eff3188fff..51cd2f38b7 100644
@@ -91,14 +91,14 @@ static const VMStateDescription vmstate_ich9_ahci = {
 
 static void pci_ich9_reset(DeviceState *dev)
 {
-    AHCIPCIState *d = ICH_AHCI(dev);
+    AHCIPCIState *d = ICH9_AHCI(dev);
 
     ahci_reset(&d->ahci);
 }
 
 static void pci_ich9_ahci_init(Object *obj)
 {
-    struct AHCIPCIState *d = ICH_AHCI(obj);
+    struct AHCIPCIState *d = ICH9_AHCI(obj);
 
     ahci_init(&d->ahci, DEVICE(obj));
 }
@@ -108,7 +108,7 @@ static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp)
     struct AHCIPCIState *d;
     int sata_cap_offset;
     uint8_t *sata_cap;
-    d = ICH_AHCI(dev);
+    d = ICH9_AHCI(dev);
     int ret;
 
     ahci_realize(&d->ahci, DEVICE(dev), pci_get_address_space(dev), 6);
@@ -154,7 +154,7 @@ static void pci_ich9_ahci_realize(PCIDevice *dev, Error **errp)
 static void pci_ich9_uninit(PCIDevice *dev)
 {
     struct AHCIPCIState *d;
-    d = ICH_AHCI(dev);
+    d = ICH9_AHCI(dev);
 
     msi_uninit(dev);
     ahci_uninit(&d->ahci);
Signature · 1 line
2.26.2
#12 lore raw

[PULL 08/34] Delete duplicate QOM typedefs

In reply to Eduardo Habkost

Generated using:

 $ ./scripts/codeconverter/converter.py -i \
   --pattern=QOMDuplicatedTypedefs $(git grep -l '' -- '*.[ch]')

Message-Id: <[email protected]>

---
 include/crypto/secret_keyring.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
include/crypto/secret_keyring.h +4 -4
index 9f371ad251..4345eb048e 100644
@@ -39,14 +39,14 @@
 typedef struct QCryptoSecretKeyring QCryptoSecretKeyring;
 typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass;
 
-typedef struct QCryptoSecretKeyring {
+struct QCryptoSecretKeyring {
     QCryptoSecretCommon parent;
     int32_t serial;
-} QCryptoSecretKeyring;
+};
 
 
-typedef struct QCryptoSecretKeyringClass {
+struct QCryptoSecretKeyringClass {
     QCryptoSecretCommonClass parent;
-} QCryptoSecretKeyringClass;
+};
 
 #endif /* QCRYPTO_SECRET_KEYRING_H */
Signature · 1 line
2.26.2
#13 lore raw

[PULL 21/34] esp: Rename ESP_STATE to ESP

In reply to Eduardo Habkost

Make the type checking macro name consistent with the TYPE_* constant.

Message-Id: <[email protected]>

---
 include/hw/scsi/esp.h | 2 +-
 hw/dma/sparc32_dma.c  | 2 +-
 hw/m68k/q800.c        | 2 +-
 hw/mips/jazz.c        | 2 +-
 hw/scsi/esp.c         | 6 +++---
 hw/sparc/sun4m.c      | 2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
include/hw/scsi/esp.h +1 -1
index f281625dd5..20800dbf5b 100644
@@ -67,7 +67,7 @@ struct ESPState {
 
 #define TYPE_ESP "esp"
 typedef struct SysBusESPState SysBusESPState;
-DECLARE_INSTANCE_CHECKER(SysBusESPState, ESP_STATE,
+DECLARE_INSTANCE_CHECKER(SysBusESPState, ESP,
                          TYPE_ESP)
 
 struct SysBusESPState {
hw/dma/sparc32_dma.c +1 -1
index bcd1626fbd..d20a5bc065 100644
@@ -303,7 +303,7 @@ static void sparc32_espdma_device_realize(DeviceState *dev, Error **errp)
 
     d = qdev_new(TYPE_ESP);
     object_property_add_child(OBJECT(dev), "esp", OBJECT(d));
-    sysbus = ESP_STATE(d);
+    sysbus = ESP(d);
     esp = &sysbus->esp;
     esp->dma_memory_read = espdma_memory_read;
     esp->dma_memory_write = espdma_memory_write;
hw/m68k/q800.c +1 -1
index 1ca482ad81..ce4b47c3e3 100644
@@ -290,7 +290,7 @@ static void q800_init(MachineState *machine)
     /* SCSI */
 
     dev = qdev_new(TYPE_ESP);
-    sysbus_esp = ESP_STATE(dev);
+    sysbus_esp = ESP(dev);
     esp = &sysbus_esp->esp;
     esp->dma_memory_read = NULL;
     esp->dma_memory_write = NULL;
hw/mips/jazz.c +1 -1
index 82a6e3220e..47723093b6 100644
@@ -309,7 +309,7 @@ static void mips_jazz_init(MachineState *machine,
 
     /* SCSI adapter */
     dev = qdev_new(TYPE_ESP);
-    sysbus_esp = ESP_STATE(dev);
+    sysbus_esp = ESP(dev);
     esp = &sysbus_esp->esp;
     esp->dma_memory_read = rc4030_dma_read;
     esp->dma_memory_write = rc4030_dma_write;
hw/scsi/esp.c +3 -3
index 405f8b7cbc..b84e0fe33e 100644
@@ -929,7 +929,7 @@ static const struct SCSIBusInfo esp_scsi_info = {
 
 static void sysbus_esp_gpio_demux(void *opaque, int irq, int level)
 {
-    SysBusESPState *sysbus = ESP_STATE(opaque);
+    SysBusESPState *sysbus = ESP(opaque);
     ESPState *s = &sysbus->esp;
 
     switch (irq) {
@@ -945,7 +945,7 @@ static void sysbus_esp_gpio_demux(void *opaque, int irq, int level)
 static void sysbus_esp_realize(DeviceState *dev, Error **errp)
 {
     SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
-    SysBusESPState *sysbus = ESP_STATE(dev);
+    SysBusESPState *sysbus = ESP(dev);
     ESPState *s = &sysbus->esp;
 
     sysbus_init_irq(sbd, &s->irq);
@@ -967,7 +967,7 @@ static void sysbus_esp_realize(DeviceState *dev, Error **errp)
 
 static void sysbus_esp_hard_reset(DeviceState *dev)
 {
-    SysBusESPState *sysbus = ESP_STATE(dev);
+    SysBusESPState *sysbus = ESP(dev);
     esp_hard_reset(&sysbus->esp);
 }
 
hw/sparc/sun4m.c +1 -1
index 256033b9a0..947b69d159 100644
@@ -335,7 +335,7 @@ static void *sparc32_dma_init(hwaddr dma_base,
                                    OBJECT(dma), "espdma"));
     sysbus_connect_irq(SYS_BUS_DEVICE(espdma), 0, espdma_irq);
 
-    esp = ESP_STATE(object_resolve_path_component(OBJECT(espdma), "esp"));
+    esp = ESP(object_resolve_path_component(OBJECT(espdma), "esp"));
     sysbus_mmio_map(SYS_BUS_DEVICE(esp), 0, esp_base);
     scsi_bus_legacy_handle_cmdline(&esp->esp.bus);
 
Signature · 1 line
2.26.2
#14 lore raw

[PULL 26/34] vfio: Rename PCI_VFIO to VFIO_PCI

In reply to Eduardo Habkost

Make the type checking macro name consistent with the TYPE_* constant.

Message-Id: <[email protected]>

---
 hw/vfio/pci.h |  2 +-
 hw/vfio/pci.c | 22 +++++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)
hw/vfio/pci.h +1 -1
index 846d60e56c..5e53d5b863 100644
@@ -116,7 +116,7 @@ typedef struct VFIOMSIXInfo {
 
 #define TYPE_VFIO_PCI "vfio-pci"
 typedef struct VFIOPCIDevice VFIOPCIDevice;
-DECLARE_INSTANCE_CHECKER(VFIOPCIDevice, PCI_VFIO,
+DECLARE_INSTANCE_CHECKER(VFIOPCIDevice, VFIO_PCI,
                          TYPE_VFIO_PCI)
 
 struct VFIOPCIDevice {
hw/vfio/pci.c +11 -11
index 3611dcd38b..0d83eb0e47 100644
@@ -230,7 +230,7 @@ static void vfio_intx_update(VFIOPCIDevice *vdev, PCIINTxRoute *route)
 
 static void vfio_intx_routing_notifier(PCIDevice *pdev)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(pdev);
+    VFIOPCIDevice *vdev = VFIO_PCI(pdev);
     PCIINTxRoute route;
 
     if (vdev->interrupt != VFIO_INT_INTx) {
@@ -456,7 +456,7 @@ static void vfio_update_kvm_msi_virq(VFIOMSIVector *vector, MSIMessage msg,
 static int vfio_msix_vector_do_use(PCIDevice *pdev, unsigned int nr,
                                    MSIMessage *msg, IOHandler *handler)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(pdev);
+    VFIOPCIDevice *vdev = VFIO_PCI(pdev);
     VFIOMSIVector *vector;
     int ret;
 
@@ -541,7 +541,7 @@ static int vfio_msix_vector_use(PCIDevice *pdev,
 
 static void vfio_msix_vector_release(PCIDevice *pdev, unsigned int nr)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(pdev);
+    VFIOPCIDevice *vdev = VFIO_PCI(pdev);
     VFIOMSIVector *vector = &vdev->msi_vectors[nr];
 
     trace_vfio_msix_vector_release(vdev->vbasedev.name, nr);
@@ -1048,7 +1048,7 @@ static const MemoryRegionOps vfio_vga_ops = {
  */
 static void vfio_sub_page_bar_update_mapping(PCIDevice *pdev, int bar)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(pdev);
+    VFIOPCIDevice *vdev = VFIO_PCI(pdev);
     VFIORegion *region = &vdev->bars[bar].region;
     MemoryRegion *mmap_mr, *region_mr, *base_mr;
     PCIIORegion *r;
@@ -1094,7 +1094,7 @@ static void vfio_sub_page_bar_update_mapping(PCIDevice *pdev, int bar)
  */
 uint32_t vfio_pci_read_config(PCIDevice *pdev, uint32_t addr, int len)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(pdev);
+    VFIOPCIDevice *vdev = VFIO_PCI(pdev);
     uint32_t emu_bits = 0, emu_val = 0, phys_val = 0, val;
 
     memcpy(&emu_bits, vdev->emulated_config_bits + addr, len);
@@ -1127,7 +1127,7 @@ uint32_t vfio_pci_read_config(PCIDevice *pdev, uint32_t addr, int len)
 void vfio_pci_write_config(PCIDevice *pdev,
                            uint32_t addr, uint32_t val, int len)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(pdev);
+    VFIOPCIDevice *vdev = VFIO_PCI(pdev);
     uint32_t val_le = cpu_to_le32(val);
 
     trace_vfio_pci_write_config(vdev->vbasedev.name, addr, val, len);
@@ -2701,7 +2701,7 @@ static void vfio_unregister_req_notifier(VFIOPCIDevice *vdev)
 
 static void vfio_realize(PCIDevice *pdev, Error **errp)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(pdev);
+    VFIOPCIDevice *vdev = VFIO_PCI(pdev);
     VFIODevice *vbasedev_iter;
     VFIOGroup *group;
     char *tmp, *subsys, group_path[PATH_MAX], *group_name;
@@ -3033,7 +3033,7 @@ error:
 
 static void vfio_instance_finalize(Object *obj)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(obj);
+    VFIOPCIDevice *vdev = VFIO_PCI(obj);
     VFIOGroup *group = vdev->vbasedev.group;
 
     vfio_display_finalize(vdev);
@@ -3057,7 +3057,7 @@ static void vfio_instance_finalize(Object *obj)
 
 static void vfio_exitfn(PCIDevice *pdev)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(pdev);
+    VFIOPCIDevice *vdev = VFIO_PCI(pdev);
 
     vfio_unregister_req_notifier(vdev);
     vfio_unregister_err_notifier(vdev);
@@ -3075,7 +3075,7 @@ static void vfio_exitfn(PCIDevice *pdev)
 
 static void vfio_pci_reset(DeviceState *dev)
 {
-    VFIOPCIDevice *vdev = PCI_VFIO(dev);
+    VFIOPCIDevice *vdev = VFIO_PCI(dev);
 
     trace_vfio_pci_reset(vdev->vbasedev.name);
 
@@ -3115,7 +3115,7 @@ post_reset:
 static void vfio_instance_init(Object *obj)
 {
     PCIDevice *pci_dev = PCI_DEVICE(obj);
-    VFIOPCIDevice *vdev = PCI_VFIO(obj);
+    VFIOPCIDevice *vdev = VFIO_PCI(obj);
 
     device_add_bootindex_property(obj, &vdev->bootindex,
                                   "bootindex", NULL,
Signature · 1 line
2.26.2
#15 lore raw

[PULL 22/34] filter-rewriter: Rename FILTER_COLO_REWRITER to FILTER_REWRITER

In reply to Eduardo Habkost

Make the type checking macro name consistent with the TYPE_* constant.

Message-Id: <[email protected]>

---
 net/filter-rewriter.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
net/filter-rewriter.c +9 -9
index 113e293207..44f6021dd8 100644
@@ -25,7 +25,7 @@
 
 #define TYPE_FILTER_REWRITER "filter-rewriter"
 typedef struct RewriterState RewriterState;
-DECLARE_INSTANCE_CHECKER(RewriterState, FILTER_COLO_REWRITER,
+DECLARE_INSTANCE_CHECKER(RewriterState, FILTER_REWRITER,
                          TYPE_FILTER_REWRITER)
 
 #define FAILOVER_MODE_ON  true
@@ -47,7 +47,7 @@ static void filter_rewriter_failover_mode(RewriterState *s)
 
 static void filter_rewriter_flush(NetFilterState *nf)
 {
-    RewriterState *s = FILTER_COLO_REWRITER(nf);
+    RewriterState *s = FILTER_REWRITER(nf);
 
     if (!qemu_net_queue_flush(s->incoming_queue)) {
         /* Unable to empty the queue, purge remaining packets */
@@ -252,7 +252,7 @@ static ssize_t colo_rewriter_receive_iov(NetFilterState *nf,
                                          int iovcnt,
                                          NetPacketSent *sent_cb)
 {
-    RewriterState *s = FILTER_COLO_REWRITER(nf);
+    RewriterState *s = FILTER_REWRITER(nf);
     Connection *conn;
     ConnectionKey key;
     Packet *pkt;
@@ -350,7 +350,7 @@ static gboolean offset_is_nonzero(gpointer key,
 static void colo_rewriter_handle_event(NetFilterState *nf, int event,
                                        Error **errp)
 {
-    RewriterState *rs = FILTER_COLO_REWRITER(nf);
+    RewriterState *rs = FILTER_REWRITER(nf);
 
     switch (event) {
     case COLO_EVENT_CHECKPOINT:
@@ -370,7 +370,7 @@ static void colo_rewriter_handle_event(NetFilterState *nf, int event,
 
 static void colo_rewriter_cleanup(NetFilterState *nf)
 {
-    RewriterState *s = FILTER_COLO_REWRITER(nf);
+    RewriterState *s = FILTER_REWRITER(nf);
 
     /* flush packets */
     if (s->incoming_queue) {
@@ -381,7 +381,7 @@ static void colo_rewriter_cleanup(NetFilterState *nf)
 
 static void colo_rewriter_setup(NetFilterState *nf, Error **errp)
 {
-    RewriterState *s = FILTER_COLO_REWRITER(nf);
+    RewriterState *s = FILTER_REWRITER(nf);
 
     s->connection_track_table = g_hash_table_new_full(connection_key_hash,
                                                       connection_key_equal,
@@ -392,7 +392,7 @@ static void colo_rewriter_setup(NetFilterState *nf, Error **errp)
 
 static bool filter_rewriter_get_vnet_hdr(Object *obj, Error **errp)
 {
-    RewriterState *s = FILTER_COLO_REWRITER(obj);
+    RewriterState *s = FILTER_REWRITER(obj);
 
     return s->vnet_hdr;
 }
@@ -401,14 +401,14 @@ static void filter_rewriter_set_vnet_hdr(Object *obj,
                                          bool value,
                                          Error **errp)
 {
-    RewriterState *s = FILTER_COLO_REWRITER(obj);
+    RewriterState *s = FILTER_REWRITER(obj);
 
     s->vnet_hdr = value;
 }
 
 static void filter_rewriter_init(Object *obj)
 {
-    RewriterState *s = FILTER_COLO_REWRITER(obj);
+    RewriterState *s = FILTER_REWRITER(obj);
 
     s->vnet_hdr = false;
     s->failover_mode = FAILOVER_MODE_OFF;
Signature · 1 line
2.26.2
#16 lore raw

[PULL 03/34] qom: provide convenient macros for declaring and defining types

In reply to Eduardo Habkost

From: Daniel P. Berrangé <[email protected]>

When creating new QOM types, there is a lot of boilerplate code that must be repeated using a standard pattern. This is tedious to write and liable to suffer from subtle inconsistencies. Thus it would benefit from some simple automation.

QOM was loosely inspired by GLib's GObject, and indeed GObject suffers from the same burden of boilerplate code, but has long provided a set of macros to eliminate this burden in the source implementation. More recently it has also provided a set of macros to eliminate this burden in the header declaration.

In GLib there are the G_DECLARE_* and G_DEFINE_* family of macros for the header declaration and source implementation respectively:

https://developer.gnome.org/gobject/stable/chapter-gobject.html
https://developer.gnome.org/gobject/stable/howto-gobject.html

This patch takes inspiration from GObject to provide the equivalent functionality for QOM.

In the header file, instead of:

    typedef struct MyDevice MyDevice;
    typedef struct MyDeviceClass MyDeviceClass;

    G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref)

    #define MY_DEVICE_GET_CLASS(void *obj) \
            OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE)
    #define MY_DEVICE_CLASS(void *klass) \
            OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE)
    #define MY_DEVICE(void *obj)
            OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE)

    struct MyDeviceClass {
        DeviceClass parent_class;
    };

We now have

OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)

In cases where the class needs some virtual methods, it can be left to be implemented manually using

OBJECT_DECLARE_TYPE(MyDevice, my_device, MY_DEVICE)

Note that these macros are including support for g_autoptr() for the object types, which is something previously only supported for variables declared as the base Object * type.

Meanwhile in the source file, instead of:

    static void my_device_finalize(Object *obj);
    static void my_device_class_init(ObjectClass *oc, void *data);
    static void my_device_init(Object *obj);

    static const TypeInfo my_device_info = {
        .parent = TYPE_DEVICE,
        .name = TYPE_MY_DEVICE,
        .instance_size = sizeof(MyDevice),
        .instance_init = my_device_init,
        .instance_finalize = my_device_finalize,
        .class_size = sizeof(MyDeviceClass),
        .class_init = my_device_class_init,
    };

    static void
    my_device_register_types(void)
    {
        type_register_static(&my_device_info);
    }
    type_init(my_device_register_types);

We now have

OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)

Or, if a class needs to implement interfaces:

OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device, MY_DEVICE, DEVICE,
{ TYPE_USER_CREATABLE }, { NULL })

Or, if a class needs to be abstract

OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)

IOW, in both cases the maintainer now only has to think about the interesting part of the code which implements useful functionality and avoids much of the boilerplate.

Message-Id: <[email protected]>

[ehabkost: Fix G_DEFINE_AUTOPTR_CLEANUP_FUNC usage]

Message-Id: <[email protected]>

---
 include/qom/object.h | 277 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 277 insertions(+)
include/qom/object.h +277 -0
index 1f8aa2d48e..f515230f61 100644
@@ -304,6 +304,119 @@ typedef struct InterfaceInfo InterfaceInfo;
  *
  * The first example of such a QOM method was #CPUClass.reset,
  * another example is #DeviceClass.realize.
+ *
+ * # Standard type declaration and definition macros #
+ *
+ * A lot of the code outlined above follows a standard pattern and naming
+ * convention. To reduce the amount of boilerplate code that needs to be
+ * written for a new type there are two sets of macros to generate the
+ * common parts in a standard format.
+ *
+ * A type is declared using the OBJECT_DECLARE macro family. In types
+ * which do not require any virtual functions in the class, the
+ * OBJECT_DECLARE_SIMPLE_TYPE macro is suitable, and is commonly placed
+ * in the header file:
+ *
+ * <example>
+ *   <title>Declaring a simple type</title>
+ *   <programlisting>
+ *     OBJECT_DECLARE_SIMPLE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+ *   </programlisting>
+ * </example>
+ *
+ * This is equivalent to the following:
+ *
+ * <example>
+ *   <title>Expansion from declaring a simple type</title>
+ *   <programlisting>
+ *     typedef struct MyDevice MyDevice;
+ *     typedef struct MyDeviceClass MyDeviceClass;
+ *
+ *     G_DEFINE_AUTOPTR_CLEANUP_FUNC(MyDeviceClass, object_unref)
+ *
+ *     #define MY_DEVICE_GET_CLASS(void *obj) \
+ *             OBJECT_GET_CLASS(MyDeviceClass, obj, TYPE_MY_DEVICE)
+ *     #define MY_DEVICE_CLASS(void *klass) \
+ *             OBJECT_CLASS_CHECK(MyDeviceClass, klass, TYPE_MY_DEVICE)
+ *     #define MY_DEVICE(void *obj)
+ *             OBJECT_CHECK(MyDevice, obj, TYPE_MY_DEVICE)
+ *
+ *     struct MyDeviceClass {
+ *         DeviceClass parent_class;
+ *     };
+ *   </programlisting>
+ * </example>
+ *
+ * The 'struct MyDevice' needs to be declared separately.
+ * If the type requires virtual functions to be declared in the class
+ * struct, then the alternative OBJECT_DECLARE_TYPE() macro can be
+ * used. This does the same as OBJECT_DECLARE_SIMPLE_TYPE(), but without
+ * the 'struct MyDeviceClass' definition.
+ *
+ * To implement the type, the OBJECT_DEFINE macro family is available.
+ * In the simple case the OBJECT_DEFINE_TYPE macro is suitable:
+ *
+ * <example>
+ *   <title>Defining a simple type</title>
+ *   <programlisting>
+ *     OBJECT_DEFINE_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+ *   </programlisting>
+ * </example>
+ *
+ * This is equivalent to the following:
+ *
+ * <example>
+ *   <title>Expansion from defining a simple type</title>
+ *   <programlisting>
+ *     static void my_device_finalize(Object *obj);
+ *     static void my_device_class_init(ObjectClass *oc, void *data);
+ *     static void my_device_init(Object *obj);
+ *
+ *     static const TypeInfo my_device_info = {
+ *         .parent = TYPE_DEVICE,
+ *         .name = TYPE_MY_DEVICE,
+ *         .instance_size = sizeof(MyDevice),
+ *         .instance_init = my_device_init,
+ *         .instance_finalize = my_device_finalize,
+ *         .class_size = sizeof(MyDeviceClass),
+ *         .class_init = my_device_class_init,
+ *     };
+ *
+ *     static void
+ *     my_device_register_types(void)
+ *     {
+ *         type_register_static(&my_device_info);
+ *     }
+ *     type_init(my_device_register_types);
+ *   </programlisting>
+ * </example>
+ *
+ * This is sufficient to get the type registered with the type
+ * system, and the three standard methods now need to be implemented
+ * along with any other logic required for the type.
+ *
+ * If the type needs to implement one or more interfaces, then the
+ * OBJECT_DEFINE_TYPE_WITH_INTERFACES() macro can be used instead.
+ * This accepts an array of interface type names.
+ *
+ * <example>
+ *   <title>Defining a simple type implementing interfaces</title>
+ *   <programlisting>
+ *     OBJECT_DEFINE_TYPE_WITH_INTERFACES(MyDevice, my_device,
+ *                                        MY_DEVICE, DEVICE,
+ *                                        { TYPE_USER_CREATABLE }, { NULL })
+ *   </programlisting>
+ * </example>
+ *
+ * If the type is not intended to be instantiated, then then
+ * the OBJECT_DEFINE_ABSTRACT_TYPE() macro can be used instead:
+ *
+ * <example>
+ *   <title>Defining a simple type</title>
+ *   <programlisting>
+ *     OBJECT_DEFINE_ABSTRACT_TYPE(MyDevice, my_device, MY_DEVICE, DEVICE)
+ *   </programlisting>
+ * </example>
  */
 
 
@@ -440,6 +553,170 @@ struct Object
     Object *parent;
 };
 
+/**
+ * OBJECT_DECLARE_TYPE:
+ * @ModuleObjName: the object name with initial capitalization
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ *
+ * This macro is typically used in a header file, and will:
+ *
+ *   - create the typedefs for the object and class structs
+ *   - register the type for use with g_autoptr
+ *   - provide three standard type cast functions
+ *
+ * The object struct and class struct need to be declared manually.
+ */
+#define OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \
+    typedef struct ModuleObjName ModuleObjName; \
+    typedef struct ModuleObjName##Class ModuleObjName##Class; \
+    \
+    G_DEFINE_AUTOPTR_CLEANUP_FUNC(ModuleObjName, object_unref) \
+    \
+    static inline G_GNUC_UNUSED ModuleObjName##Class * \
+    MODULE_OBJ_NAME##_GET_CLASS(void *obj) \
+    { return OBJECT_GET_CLASS(ModuleObjName##Class, obj, \
+                              TYPE_##MODULE_OBJ_NAME); } \
+    \
+    static inline G_GNUC_UNUSED ModuleObjName##Class * \
+    MODULE_OBJ_NAME##_CLASS(void *klass) \
+    { return OBJECT_CLASS_CHECK(ModuleObjName##Class, klass, \
+                                TYPE_##MODULE_OBJ_NAME); } \
+    \
+    static inline G_GNUC_UNUSED ModuleObjName * \
+    MODULE_OBJ_NAME(void *obj) \
+    { return OBJECT_CHECK(ModuleObjName, obj, \
+                          TYPE_##MODULE_OBJ_NAME); }
+
+/**
+ * OBJECT_DECLARE_SIMPLE_TYPE:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @ParentModuleObjName: the parent object name with initial caps
+ *
+ * This does the same as OBJECT_DECLARE_TYPE(), but also declares
+ * the class struct, thus only the object struct needs to be declare
+ * manually.
+ *
+ * This macro should be used unless the class struct needs to have
+ * virtual methods declared.
+ */
+#define OBJECT_DECLARE_SIMPLE_TYPE(ModuleObjName, module_obj_name, \
+                                   MODULE_OBJ_NAME, ParentModuleObjName) \
+    OBJECT_DECLARE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME) \
+    struct ModuleObjName##Class { ParentModuleObjName##Class parent_class; };
+
+
+/**
+ * OBJECT_DEFINE_TYPE_EXTENDED:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore
+ *                          separators
+ * @ABSTRACT: boolean flag to indicate whether the object can be instantiated
+ * @...: list of initializers for "InterfaceInfo" to declare implemented interfaces
+ *
+ * This macro is typically used in a source file, and will:
+ *
+ *   - declare prototypes for _finalize, _class_init and _init methods
+ *   - declare the TypeInfo struct instance
+ *   - provide the constructor to register the type
+ *
+ * After using this macro, implementations of the _finalize, _class_init,
+ * and _init methods need to be written. Any of these can be zero-line
+ * no-op impls if no special logic is required for a given type.
+ *
+ * This macro should rarely be used, instead one of the more specialized
+ * macros is usually a better choice.
+ */
+#define OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \
+                                    MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \
+                                    ABSTRACT, ...) \
+    static void \
+    module_obj_name##_finalize(Object *obj); \
+    static void \
+    module_obj_name##_class_init(ObjectClass *oc, void *data); \
+    static void \
+    module_obj_name##_init(Object *obj); \
+    \
+    static const TypeInfo module_obj_name##_info = { \
+        .parent = TYPE_##PARENT_MODULE_OBJ_NAME, \
+        .name = TYPE_##MODULE_OBJ_NAME, \
+        .instance_size = sizeof(ModuleObjName), \
+        .instance_init = module_obj_name##_init, \
+        .instance_finalize = module_obj_name##_finalize, \
+        .class_size = sizeof(ModuleObjName##Class), \
+        .class_init = module_obj_name##_class_init, \
+        .abstract = ABSTRACT, \
+        .interfaces = (InterfaceInfo[]) { __VA_ARGS__ } , \
+    }; \
+    \
+    static void \
+    module_obj_name##_register_types(void) \
+    { \
+        type_register_static(&module_obj_name##_info); \
+    } \
+    type_init(module_obj_name##_register_types);
+
+/**
+ * OBJECT_DEFINE_TYPE:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore
+ *                          separators
+ *
+ * This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable
+ * for the common case of a non-abstract type, without any interfaces.
+ */
+#define OBJECT_DEFINE_TYPE(ModuleObjName, module_obj_name, MODULE_OBJ_NAME, \
+                           PARENT_MODULE_OBJ_NAME) \
+    OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \
+                                MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \
+                                false, { NULL })
+
+/**
+ * OBJECT_DEFINE_TYPE_WITH_INTERFACES:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore
+ *                          separators
+ * @...: list of initializers for "InterfaceInfo" to declare implemented interfaces
+ *
+ * This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable
+ * for the common case of a non-abstract type, with one or more implemented
+ * interfaces.
+ *
+ * Note when passing the list of interfaces, be sure to include the final
+ * NULL entry, e.g.  { TYPE_USER_CREATABLE }, { NULL }
+ */
+#define OBJECT_DEFINE_TYPE_WITH_INTERFACES(ModuleObjName, module_obj_name, \
+                                           MODULE_OBJ_NAME, \
+                                           PARENT_MODULE_OBJ_NAME, ...) \
+    OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \
+                                MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \
+                                false, __VA_ARGS__)
+
+/**
+ * OBJECT_DEFINE_ABSTRACT_TYPE:
+ * @ModuleObjName: the object name with initial caps
+ * @module_obj_name: the object name in lowercase with underscore separators
+ * @MODULE_OBJ_NAME: the object name in uppercase with underscore separators
+ * @PARENT_MODULE_OBJ_NAME: the parent object name in uppercase with underscore
+ *                          separators
+ *
+ * This is a specialization of OBJECT_DEFINE_TYPE_EXTENDED, which is suitable
+ * for defining an abstract type, without any interfaces.
+ */
+#define OBJECT_DEFINE_ABSTRACT_TYPE(ModuleObjName, module_obj_name, \
+                                    MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME) \
+    OBJECT_DEFINE_TYPE_EXTENDED(ModuleObjName, module_obj_name, \
+                                MODULE_OBJ_NAME, PARENT_MODULE_OBJ_NAME, \
+                                true, { NULL })
+
 /**
  * TypeInfo:
  * @name: The name of the type.
Signature · 1 line
2.26.2
#17 lore raw

[PULL 28/34] tusb6010: Rename TUSB to TUSB6010

In reply to Eduardo Habkost

Make type checking function name consistent with the TYPE_TUSB6010 constant and QOM type name ("tusb6010").

Message-Id: <[email protected]>

---
 hw/usb/tusb6010.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/usb/tusb6010.c +3 -3
index 2bee3ae59f..dd20996d13 100644
@@ -32,7 +32,7 @@
 
 #define TYPE_TUSB6010 "tusb6010"
 typedef struct TUSBState TUSBState;
-DECLARE_INSTANCE_CHECKER(TUSBState, TUSB,
+DECLARE_INSTANCE_CHECKER(TUSBState, TUSB6010,
                          TYPE_TUSB6010)
 
 struct TUSBState {
@@ -779,7 +779,7 @@ static void tusb6010_irq(void *opaque, int source, int level)
 
 static void tusb6010_reset(DeviceState *dev)
 {
-    TUSBState *s = TUSB(dev);
+    TUSBState *s = TUSB6010(dev);
     int i;
 
     s->test_reset = TUSB_PROD_TEST_RESET_VAL;
@@ -815,7 +815,7 @@ static void tusb6010_reset(DeviceState *dev)
 
 static void tusb6010_realize(DeviceState *dev, Error **errp)
 {
-    TUSBState *s = TUSB(dev);
+    TUSBState *s = TUSB6010(dev);
     SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
 
     s->otg_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, tusb_otg_tick, s);
Signature · 1 line
2.26.2
#18 lore raw

[PULL 25/34] usb: Rename USB_SERIAL_DEV to USB_SERIAL

In reply to Eduardo Habkost

Make the type checking macro name consistent with the TYPE_* constant.

Message-Id: <[email protected]>

---
 hw/usb/dev-serial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/usb/dev-serial.c +2 -2
index 1a58851d4b..1a038a222e 100644
@@ -113,7 +113,7 @@ struct USBSerialState {
 typedef struct USBSerialState USBSerialState;
 
 #define TYPE_USB_SERIAL "usb-serial-dev"
-DECLARE_INSTANCE_CHECKER(USBSerialState, USB_SERIAL_DEV,
+DECLARE_INSTANCE_CHECKER(USBSerialState, USB_SERIAL,
                          TYPE_USB_SERIAL)
 
 enum {
@@ -517,7 +517,7 @@ static void usb_serial_event(void *opaque, QEMUChrEvent event)
 
 static void usb_serial_realize(USBDevice *dev, Error **errp)
 {
-    USBSerialState *s = USB_SERIAL_DEV(dev);
+    USBSerialState *s = USB_SERIAL(dev);
     Error *local_err = NULL;
 
     usb_desc_create_serial(dev);
Signature · 1 line
2.26.2
#19 lore raw

[PULL 23/34] rs6000_mc: Rename RS6000MC_DEVICE to RS6000MC

In reply to Eduardo Habkost

Make the type checking macro name consistent with the TYPE_* constant.

Message-Id: <[email protected]>

---
 hw/ppc/rs6000_mc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/ppc/rs6000_mc.c +2 -2
index 56e96010b8..8611ffa96d 100644
@@ -30,7 +30,7 @@
 
 #define TYPE_RS6000MC "rs6000-mc"
 typedef struct RS6000MCState RS6000MCState;
-DECLARE_INSTANCE_CHECKER(RS6000MCState, RS6000MC_DEVICE,
+DECLARE_INSTANCE_CHECKER(RS6000MCState, RS6000MC,
                          TYPE_RS6000MC)
 
 struct RS6000MCState {
@@ -143,7 +143,7 @@ static const MemoryRegionPortio rs6000mc_port_list[] = {
 
 static void rs6000mc_realize(DeviceState *dev, Error **errp)
 {
-    RS6000MCState *s = RS6000MC_DEVICE(dev);
+    RS6000MCState *s = RS6000MC(dev);
     int socket = 0;
     unsigned int ram_size = s->ram_size / MiB;
     Error *local_err = NULL;
Signature · 1 line
2.26.2
#20 lore raw

[PULL 13/34] Use OBJECT_DECLARE_SIMPLE_TYPE when possible

In reply to Eduardo Habkost

Generated using:

 $ ./scripts/codeconverter/converter.py -i \
   --pattern=ObjectDeclareType $(git grep -l '' -- '*.[ch]')

Message-Id: <[email protected]>

---
 include/authz/list.h                | 7 ++-----
 include/authz/listfile.h            | 7 ++-----
 include/authz/pamacct.h             | 7 ++-----
 include/authz/simple.h              | 7 ++-----
 include/crypto/secret_keyring.h     | 7 ++-----
 include/io/dns-resolver.h           | 7 ++-----
 include/io/net-listener.h           | 7 ++-----
 include/sysemu/vhost-user-backend.h | 7 ++-----
 backends/dbus-vmstate.c             | 7 ++-----
 ui/input-barrier.c                  | 7 ++-----
 ui/input-linux.c                    | 7 ++-----
 11 files changed, 22 insertions(+), 55 deletions(-)
include/authz/list.h +2 -5
index e4e1040472..5676bb375c 100644
@@ -27,8 +27,8 @@
 
 #define TYPE_QAUTHZ_LIST "authz-list"
 
-OBJECT_DECLARE_TYPE(QAuthZList, QAuthZListClass,
-                    qauthz_list, QAUTHZ_LIST)
+OBJECT_DECLARE_SIMPLE_TYPE(QAuthZList, qauthz_list,
+                           QAUTHZ_LIST, QAuthZClass)
 
 
 
@@ -68,9 +68,6 @@ struct QAuthZList {
 };
 
 
-struct QAuthZListClass {
-    QAuthZClass parent_class;
-};
 
 
 QAuthZList *qauthz_list_new(const char *id,
include/authz/listfile.h +2 -5
index 89c5eafbfa..b491227bbe 100644
@@ -27,8 +27,8 @@
 
 #define TYPE_QAUTHZ_LIST_FILE "authz-list-file"
 
-OBJECT_DECLARE_TYPE(QAuthZListFile, QAuthZListFileClass,
-                    qauthz_list_file, QAUTHZ_LIST_FILE)
+OBJECT_DECLARE_SIMPLE_TYPE(QAuthZListFile, qauthz_list_file,
+                           QAUTHZ_LIST_FILE, QAuthZClass)
 
 
 
@@ -87,9 +87,6 @@ struct QAuthZListFile {
 };
 
 
-struct QAuthZListFileClass {
-    QAuthZClass parent_class;
-};
 
 
 QAuthZListFile *qauthz_list_file_new(const char *id,
include/authz/pamacct.h +2 -5
index 44bb5ff28d..7804853ddf 100644
@@ -27,8 +27,8 @@
 
 #define TYPE_QAUTHZ_PAM "authz-pam"
 
-OBJECT_DECLARE_TYPE(QAuthZPAM, QAuthZPAMClass,
-                    qauthz_pam, QAUTHZ_PAM)
+OBJECT_DECLARE_SIMPLE_TYPE(QAuthZPAM, qauthz_pam,
+                           QAUTHZ_PAM, QAuthZClass)
 
 
 
@@ -79,9 +79,6 @@ struct QAuthZPAM {
 };
 
 
-struct QAuthZPAMClass {
-    QAuthZClass parent_class;
-};
 
 
 QAuthZPAM *qauthz_pam_new(const char *id,
include/authz/simple.h +2 -5
index ba4a5ec5ea..346fcb0c6c 100644
@@ -26,8 +26,8 @@
 
 #define TYPE_QAUTHZ_SIMPLE "authz-simple"
 
-OBJECT_DECLARE_TYPE(QAuthZSimple, QAuthZSimpleClass,
-                    qauthz_simple, QAUTHZ_SIMPLE)
+OBJECT_DECLARE_SIMPLE_TYPE(QAuthZSimple, qauthz_simple,
+                           QAUTHZ_SIMPLE, QAuthZClass)
 
 
 
@@ -62,9 +62,6 @@ struct QAuthZSimple {
 };
 
 
-struct QAuthZSimpleClass {
-    QAuthZClass parent_class;
-};
 
 
 QAuthZSimple *qauthz_simple_new(const char *id,
include/crypto/secret_keyring.h +2 -5
index cc2c7397db..73d2a8f501 100644
@@ -26,8 +26,8 @@
 #include "crypto/secret_common.h"
 
 #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring"
-OBJECT_DECLARE_TYPE(QCryptoSecretKeyring, QCryptoSecretKeyringClass,
-                    qcrypto_secret_keyring, QCRYPTO_SECRET_KEYRING)
+OBJECT_DECLARE_SIMPLE_TYPE(QCryptoSecretKeyring, qcrypto_secret_keyring,
+                           QCRYPTO_SECRET_KEYRING, QCryptoSecretCommonClass)
 
 
 struct QCryptoSecretKeyring {
@@ -36,8 +36,5 @@ struct QCryptoSecretKeyring {
 };
 
 
-struct QCryptoSecretKeyringClass {
-    QCryptoSecretCommonClass parent;
-};
 
 #endif /* QCRYPTO_SECRET_KEYRING_H */
include/io/dns-resolver.h +2 -5
index 8ae4857e05..e248fba5bd 100644
@@ -26,8 +26,8 @@
 #include "io/task.h"
 
 #define TYPE_QIO_DNS_RESOLVER "qio-dns-resolver"
-OBJECT_DECLARE_TYPE(QIODNSResolver, QIODNSResolverClass,
-                    qio_dns_resolver, QIO_DNS_RESOLVER)
+OBJECT_DECLARE_SIMPLE_TYPE(QIODNSResolver, qio_dns_resolver,
+                           QIO_DNS_RESOLVER, ObjectClass)
 
 
 /**
@@ -133,9 +133,6 @@ struct QIODNSResolver {
     Object parent;
 };
 
-struct QIODNSResolverClass {
-    ObjectClass parent;
-};
 
 
 /**
include/io/net-listener.h +2 -5
index 4f0847ff19..60fad29ff4 100644
@@ -25,8 +25,8 @@
 #include "qom/object.h"
 
 #define TYPE_QIO_NET_LISTENER "qio-net-listener"
-OBJECT_DECLARE_TYPE(QIONetListener, QIONetListenerClass,
-                    qio_net_listener, QIO_NET_LISTENER)
+OBJECT_DECLARE_SIMPLE_TYPE(QIONetListener, qio_net_listener,
+                           QIO_NET_LISTENER, ObjectClass)
 
 
 typedef void (*QIONetListenerClientFunc)(QIONetListener *listener,
@@ -58,9 +58,6 @@ struct QIONetListener {
     GDestroyNotify io_notify;
 };
 
-struct QIONetListenerClass {
-    ObjectClass parent;
-};
 
 
 /**
include/sysemu/vhost-user-backend.h +2 -5
index 76ca06cf40..23205edeb8 100644
@@ -22,13 +22,10 @@
 #include "io/channel.h"
 
 #define TYPE_VHOST_USER_BACKEND "vhost-user-backend"
-OBJECT_DECLARE_TYPE(VhostUserBackend, VhostUserBackendClass,
-                    vhost_user_backend, VHOST_USER_BACKEND)
+OBJECT_DECLARE_SIMPLE_TYPE(VhostUserBackend, vhost_user_backend,
+                           VHOST_USER_BACKEND, ObjectClass)
 
 
-struct VhostUserBackendClass {
-    ObjectClass parent_class;
-};
 
 struct VhostUserBackend {
     /* private */
backends/dbus-vmstate.c +2 -5
index 0ca9d52ae5..a13461edea 100644
@@ -23,12 +23,9 @@
 
 
 #define TYPE_DBUS_VMSTATE "dbus-vmstate"
-OBJECT_DECLARE_TYPE(DBusVMState, DBusVMStateClass,
-                    dbus_vmstate, DBUS_VMSTATE)
+OBJECT_DECLARE_SIMPLE_TYPE(DBusVMState, dbus_vmstate,
+                           DBUS_VMSTATE, ObjectClass)
 
-struct DBusVMStateClass {
-    ObjectClass parent_class;
-};
 
 struct DBusVMState {
     Object parent;
ui/input-barrier.c +2 -5
index c7a8dc19a7..87543a3399 100644
@@ -20,8 +20,8 @@
 #include "input-barrier.h"
 
 #define TYPE_INPUT_BARRIER "input-barrier"
-OBJECT_DECLARE_TYPE(InputBarrier, InputBarrierClass,
-                    input_barrier, INPUT_BARRIER)
+OBJECT_DECLARE_SIMPLE_TYPE(InputBarrier, input_barrier,
+                           INPUT_BARRIER, ObjectClass)
 
 
 #define MAX_HELLO_LENGTH 1024
@@ -44,9 +44,6 @@ struct InputBarrier {
     char buffer[MAX_HELLO_LENGTH];
 };
 
-struct InputBarrierClass {
-    ObjectClass parent_class;
-};
 
 static const char *cmd_names[] = {
     [barrierCmdCNoop]          = "CNOP",
ui/input-linux.c +2 -5
index a95269cc25..5d501c8360 100644
@@ -31,8 +31,8 @@ static bool linux_is_button(unsigned int lnx)
 }
 
 #define TYPE_INPUT_LINUX "input-linux"
-OBJECT_DECLARE_TYPE(InputLinux, InputLinuxClass,
-                    input_linux, INPUT_LINUX)
+OBJECT_DECLARE_SIMPLE_TYPE(InputLinux, input_linux,
+                           INPUT_LINUX, ObjectClass)
 
 
 struct InputLinux {
@@ -65,9 +65,6 @@ struct InputLinux {
     QTAILQ_ENTRY(InputLinux) next;
 };
 
-struct InputLinuxClass {
-    ObjectClass parent_class;
-};
 
 static QTAILQ_HEAD(, InputLinux) inputs = QTAILQ_HEAD_INITIALIZER(inputs);
 
Signature · 1 line
2.26.2
#21 lore raw

[PULL 27/34] pc87312: Rename TYPE_PC87312_SUPERIO to TYPE_PC87312

In reply to Eduardo Habkost

This will make the type name constant consistent with the name of the type checking macro.

Message-Id: <[email protected]>

---
 include/hw/isa/pc87312.h | 4 ++--
 hw/isa/pc87312.c         | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
include/hw/isa/pc87312.h +2 -2
index a65168a157..da8dc5ddf5 100644
@@ -29,10 +29,10 @@
 #include "qom/object.h"
 
 
-#define TYPE_PC87312_SUPERIO "pc87312"
+#define TYPE_PC87312 "pc87312"
 typedef struct PC87312State PC87312State;
 DECLARE_INSTANCE_CHECKER(PC87312State, PC87312,
-                         TYPE_PC87312_SUPERIO)
+                         TYPE_PC87312)
 
 struct PC87312State {
     /*< private >*/
hw/isa/pc87312.c +1 -1
index 0cacbbc91b..8d7b8d3db2 100644
@@ -371,7 +371,7 @@ static void pc87312_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo pc87312_type_info = {
-    .name          = TYPE_PC87312_SUPERIO,
+    .name          = TYPE_PC87312,
     .parent        = TYPE_ISA_SUPERIO,
     .instance_size = sizeof(PC87312State),
     .instance_init = pc87312_initfn,
Signature · 1 line
2.26.2
#22 lore raw

[PULL 32/34] xilinx_axienet: Use typedef name for instance_size

In reply to Eduardo Habkost

This makes the code consistent with the rest of QOM code in QEMU, and will make automated conversion to type declaration macros simpler.

Message-Id: <[email protected]>

---
 hw/net/xilinx_axienet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/net/xilinx_axienet.c +2 -2
index 10a33cb4a5..4e13786e50 100644
@@ -1045,7 +1045,7 @@ static const TypeInfo xilinx_enet_info = {
 static const TypeInfo xilinx_enet_data_stream_info = {
     .name          = TYPE_XILINX_AXI_ENET_DATA_STREAM,
     .parent        = TYPE_OBJECT,
-    .instance_size = sizeof(struct XilinxAXIEnetStreamSlave),
+    .instance_size = sizeof(XilinxAXIEnetStreamSlave),
     .class_init    = xilinx_enet_data_stream_class_init,
     .interfaces = (InterfaceInfo[]) {
             { TYPE_STREAM_SLAVE },
@@ -1056,7 +1056,7 @@ static const TypeInfo xilinx_enet_data_stream_info = {
 static const TypeInfo xilinx_enet_control_stream_info = {
     .name          = TYPE_XILINX_AXI_ENET_CONTROL_STREAM,
     .parent        = TYPE_OBJECT,
-    .instance_size = sizeof(struct XilinxAXIEnetStreamSlave),
+    .instance_size = sizeof(XilinxAXIEnetStreamSlave),
     .class_init    = xilinx_enet_control_stream_class_init,
     .interfaces = (InterfaceInfo[]) {
             { TYPE_STREAM_SLAVE },
Signature · 1 line
2.26.2
#23 lore raw

[PULL 24/34] sabre: Rename SABRE_DEVICE to SABRE

In reply to Eduardo Habkost

Make the type checking macro name consistent with the TYPE_* constant.

Message-Id: <[email protected]>

---
 include/hw/pci-host/sabre.h | 2 +-
 hw/pci-host/sabre.c         | 8 ++++----
 hw/sparc64/sun4u.c          | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
include/hw/pci-host/sabre.h +1 -1
index 597bf70d69..7a76de4b9e 100644
@@ -51,7 +51,7 @@ struct SabreState {
 typedef struct SabreState SabreState;
 
 #define TYPE_SABRE "sabre"
-DECLARE_INSTANCE_CHECKER(SabreState, SABRE_DEVICE,
+DECLARE_INSTANCE_CHECKER(SabreState, SABRE,
                          TYPE_SABRE)
 
 #endif
hw/pci-host/sabre.c +4 -4
index 0cc68585f8..5ac6283623 100644
@@ -338,7 +338,7 @@ static void pci_sabre_set_irq(void *opaque, int irq_num, int level)
 
 static void sabre_reset(DeviceState *d)
 {
-    SabreState *s = SABRE_DEVICE(d);
+    SabreState *s = SABRE(d);
     PCIDevice *pci_dev;
     unsigned int i;
     uint16_t cmd;
@@ -376,7 +376,7 @@ static const MemoryRegionOps pci_config_ops = {
 
 static void sabre_realize(DeviceState *dev, Error **errp)
 {
-    SabreState *s = SABRE_DEVICE(dev);
+    SabreState *s = SABRE(dev);
     PCIHostState *phb = PCI_HOST_BRIDGE(dev);
     SysBusDevice *sbd = SYS_BUS_DEVICE(s);
     PCIDevice *pci_dev;
@@ -421,7 +421,7 @@ static void sabre_realize(DeviceState *dev, Error **errp)
 
 static void sabre_init(Object *obj)
 {
-    SabreState *s = SABRE_DEVICE(obj);
+    SabreState *s = SABRE(obj);
     SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
     unsigned int i;
 
@@ -502,7 +502,7 @@ static const TypeInfo sabre_pci_info = {
 
 static char *sabre_ofw_unit_address(const SysBusDevice *dev)
 {
-    SabreState *s = SABRE_DEVICE(dev);
+    SabreState *s = SABRE(dev);
 
     return g_strdup_printf("%x,%x",
                (uint32_t)((s->special_base >> 32) & 0xffffffff),
hw/sparc64/sun4u.c +1 -1
index 67985414e2..b4aabfc076 100644
@@ -585,7 +585,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
     prom_init(hwdef->prom_addr, bios_name);
 
     /* Init sabre (PCI host bridge) */
-    sabre = SABRE_DEVICE(qdev_new(TYPE_SABRE));
+    sabre = SABRE(qdev_new(TYPE_SABRE));
     qdev_prop_set_uint64(DEVICE(sabre), "special-base", PBM_SPECIAL_BASE);
     qdev_prop_set_uint64(DEVICE(sabre), "mem-base", PBM_MEM_BASE);
     object_property_set_link(OBJECT(sabre), "iommu", OBJECT(iommu),
Signature · 1 line
2.26.2
#24 lore raw

[PULL 14/34] gpex: Fix type checking function name

In reply to Eduardo Habkost

This looks like a copy/paste mistake: the instance type checking macro for TYPE_GPEX_ROOT_DEVICE was named MCH_PCI_DEVICE.

Message-Id: <[email protected]>

---
 include/hw/pci-host/gpex.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/pci-host/gpex.h +1 -1
index e8432eced8..2f4e852eee 100644
@@ -32,7 +32,7 @@ DECLARE_INSTANCE_CHECKER(GPEXHost, GPEX_HOST,
 
 #define TYPE_GPEX_ROOT_DEVICE "gpex-root"
 typedef struct GPEXRootState GPEXRootState;
-DECLARE_INSTANCE_CHECKER(GPEXRootState, MCH_PCI_DEVICE,
+DECLARE_INSTANCE_CHECKER(GPEXRootState, GPEX_ROOT_DEVICE,
                          TYPE_GPEX_ROOT_DEVICE)
 
 #define GPEX_NUM_IRQS 4
Signature · 1 line
2.26.2
#25 lore raw

[PULL 29/34] xilinx_axidma: Use typedef name for instance_size

In reply to Eduardo Habkost

This makes the code consistent with the rest of QOM code in QEMU, and will make automated conversion to type declaration macros simpler.

Message-Id: <[email protected]>

---
 hw/dma/xilinx_axidma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/dma/xilinx_axidma.c +2 -2
index f313453495..498fc17d8a 100644
@@ -633,7 +633,7 @@ static const TypeInfo axidma_info = {
 static const TypeInfo xilinx_axidma_data_stream_info = {
     .name          = TYPE_XILINX_AXI_DMA_DATA_STREAM,
     .parent        = TYPE_OBJECT,
-    .instance_size = sizeof(struct XilinxAXIDMAStreamSlave),
+    .instance_size = sizeof(XilinxAXIDMAStreamSlave),
     .class_init    = xilinx_axidma_stream_class_init,
     .class_data    = &xilinx_axidma_data_stream_class,
     .interfaces = (InterfaceInfo[]) {
@@ -645,7 +645,7 @@ static const TypeInfo xilinx_axidma_data_stream_info = {
 static const TypeInfo xilinx_axidma_control_stream_info = {
     .name          = TYPE_XILINX_AXI_DMA_CONTROL_STREAM,
     .parent        = TYPE_OBJECT,
-    .instance_size = sizeof(struct XilinxAXIDMAStreamSlave),
+    .instance_size = sizeof(XilinxAXIDMAStreamSlave),
     .class_init    = xilinx_axidma_stream_class_init,
     .class_data    = &xilinx_axidma_control_stream_class,
     .interfaces = (InterfaceInfo[]) {
Signature · 1 line
2.26.2
#26 lore raw

[PULL 12/34] Use OBJECT_DECLARE_TYPE where possible

In reply to Eduardo Habkost

Replace DECLARE_OBJ_CHECKERS with OBJECT_DECLARE_TYPE where the typedefs can be safely removed.

Generated running:

$ ./scripts/codeconverter/converter.py -i \
  --pattern=DeclareObjCheckers $(git grep -l '' -- '*.[ch]')

Message-Id: <[email protected]>
Message-Id: <[email protected]>
Message-Id: <[email protected]>

---
 hw/audio/intel-hda.h                | 6 ++----
 hw/display/virtio-vga.h             | 6 ++----
 include/authz/base.h                | 6 ++----
 include/authz/list.h                | 6 ++----
 include/authz/listfile.h            | 6 ++----
 include/authz/pamacct.h             | 6 ++----
 include/authz/simple.h              | 6 ++----
 include/crypto/secret_common.h      | 6 ++----
 include/crypto/secret_keyring.h     | 6 ++----
 include/hw/arm/armsse.h             | 6 ++----
 include/hw/hyperv/vmbus.h           | 6 ++----
 include/hw/i2c/i2c.h                | 6 ++----
 include/hw/i2c/smbus_slave.h        | 6 ++----
 include/hw/ipack/ipack.h            | 6 ++----
 include/hw/ipmi/ipmi.h              | 6 ++----
 include/hw/mem/pc-dimm.h            | 6 ++----
 include/hw/ppc/pnv.h                | 6 ++----
 include/hw/ppc/pnv_core.h           | 6 ++----
 include/hw/ppc/pnv_homer.h          | 6 ++----
 include/hw/ppc/pnv_occ.h            | 6 ++----
 include/hw/ppc/pnv_psi.h            | 6 ++----
 include/hw/ppc/pnv_xive.h           | 6 ++----
 include/hw/ppc/spapr_cpu_core.h     | 6 ++----
 include/hw/ppc/spapr_vio.h          | 6 ++----
 include/hw/ppc/xics.h               | 6 ++----
 include/hw/ppc/xive.h               | 6 ++----
 include/hw/s390x/event-facility.h   | 6 ++----
 include/hw/s390x/s390_flic.h        | 6 ++----
 include/hw/s390x/sclp.h             | 6 ++----
 include/hw/sd/sd.h                  | 6 ++----
 include/hw/ssi/ssi.h                | 6 ++----
 include/hw/sysbus.h                 | 6 ++----
 include/hw/virtio/virtio-gpu.h      | 6 ++----
 include/hw/virtio/virtio-input.h    | 6 ++----
 include/hw/virtio/virtio-mem.h      | 6 ++----
 include/hw/virtio/virtio-pmem.h     | 6 ++----
 include/hw/virtio/virtio-serial.h   | 6 ++----
 include/hw/xen/xen-bus.h            | 6 ++----
 include/io/channel.h                | 6 ++----
 include/io/dns-resolver.h           | 6 ++----
 include/io/net-listener.h           | 6 ++----
 include/scsi/pr-manager.h           | 6 ++----
 include/sysemu/cryptodev.h          | 6 ++----
 include/sysemu/hostmem.h            | 6 ++----
 include/sysemu/rng.h                | 6 ++----
 include/sysemu/tpm_backend.h        | 6 ++----
 include/sysemu/vhost-user-backend.h | 6 ++----
 target/alpha/cpu-qom.h              | 6 ++----
 target/arm/cpu-qom.h                | 6 ++----
 target/avr/cpu-qom.h                | 6 ++----
 target/cris/cpu-qom.h               | 6 ++----
 target/hppa/cpu-qom.h               | 6 ++----
 target/i386/cpu-qom.h               | 6 ++----
 target/lm32/cpu-qom.h               | 6 ++----
 target/m68k/cpu-qom.h               | 6 ++----
 target/microblaze/cpu-qom.h         | 6 ++----
 target/mips/cpu-qom.h               | 6 ++----
 target/moxie/cpu.h                  | 6 ++----
 target/nios2/cpu.h                  | 6 ++----
 target/openrisc/cpu.h               | 6 ++----
 target/ppc/cpu-qom.h                | 6 ++----
 target/riscv/cpu.h                  | 6 ++----
 target/rx/cpu-qom.h                 | 6 ++----
 target/s390x/cpu-qom.h              | 6 ++----
 target/sh4/cpu-qom.h                | 6 ++----
 target/sparc/cpu-qom.h              | 6 ++----
 target/tilegx/cpu.h                 | 6 ++----
 target/tricore/cpu-qom.h            | 6 ++----
 target/unicore32/cpu-qom.h          | 6 ++----
 target/xtensa/cpu-qom.h             | 6 ++----
 backends/dbus-vmstate.c             | 6 ++----
 ui/input-barrier.c                  | 6 ++----
 ui/input-linux.c                    | 6 ++----
 73 files changed, 146 insertions(+), 292 deletions(-)
hw/audio/intel-hda.h +2 -4
index 813a7a357d..f5cce18fa3 100644
@@ -8,10 +8,8 @@
 /* hda bus                                                               */
 
 #define TYPE_HDA_CODEC_DEVICE "hda-codec"
-typedef struct HDACodecDevice HDACodecDevice;
-typedef struct HDACodecDeviceClass HDACodecDeviceClass;
-DECLARE_OBJ_CHECKERS(HDACodecDevice, HDACodecDeviceClass,
-                     HDA_CODEC_DEVICE, TYPE_HDA_CODEC_DEVICE)
+OBJECT_DECLARE_TYPE(HDACodecDevice, HDACodecDeviceClass,
+                    hda_codec_device, HDA_CODEC_DEVICE)
 
 #define TYPE_HDA_BUS "HDA"
 typedef struct HDACodecBus HDACodecBus;
hw/display/virtio-vga.h +2 -4
index 19f8af7356..5c5671c9c1 100644
@@ -9,10 +9,8 @@
  * virtio-vga-base: This extends VirtioPCIProxy.
  */
 #define TYPE_VIRTIO_VGA_BASE "virtio-vga-base"
-typedef struct VirtIOVGABase VirtIOVGABase;
-typedef struct VirtIOVGABaseClass VirtIOVGABaseClass;
-DECLARE_OBJ_CHECKERS(VirtIOVGABase, VirtIOVGABaseClass,
-                     VIRTIO_VGA_BASE, TYPE_VIRTIO_VGA_BASE)
+OBJECT_DECLARE_TYPE(VirtIOVGABase, VirtIOVGABaseClass,
+                    virtio_vga_base, VIRTIO_VGA_BASE)
 
 struct VirtIOVGABase {
     VirtIOPCIProxy parent_obj;
include/authz/base.h +2 -4
index 8d8cf9fa5a..06b5e29f6f 100644
@@ -27,10 +27,8 @@
 
 #define TYPE_QAUTHZ "authz"
 
-typedef struct QAuthZ QAuthZ;
-typedef struct QAuthZClass QAuthZClass;
-DECLARE_OBJ_CHECKERS(QAuthZ, QAuthZClass,
-                     QAUTHZ, TYPE_QAUTHZ)
+OBJECT_DECLARE_TYPE(QAuthZ, QAuthZClass,
+                    qauthz, QAUTHZ)
 
 
 /**
include/authz/list.h +2 -4
index 93d16876bc..e4e1040472 100644
@@ -27,10 +27,8 @@
 
 #define TYPE_QAUTHZ_LIST "authz-list"
 
-typedef struct QAuthZList QAuthZList;
-typedef struct QAuthZListClass QAuthZListClass;
-DECLARE_OBJ_CHECKERS(QAuthZList, QAuthZListClass,
-                     QAUTHZ_LIST, TYPE_QAUTHZ_LIST)
+OBJECT_DECLARE_TYPE(QAuthZList, QAuthZListClass,
+                    qauthz_list, QAUTHZ_LIST)
 
 
 
include/authz/listfile.h +2 -4
index 2e4a629b6d..89c5eafbfa 100644
@@ -27,10 +27,8 @@
 
 #define TYPE_QAUTHZ_LIST_FILE "authz-list-file"
 
-typedef struct QAuthZListFile QAuthZListFile;
-typedef struct QAuthZListFileClass QAuthZListFileClass;
-DECLARE_OBJ_CHECKERS(QAuthZListFile, QAuthZListFileClass,
-                     QAUTHZ_LIST_FILE, TYPE_QAUTHZ_LIST_FILE)
+OBJECT_DECLARE_TYPE(QAuthZListFile, QAuthZListFileClass,
+                    qauthz_list_file, QAUTHZ_LIST_FILE)
 
 
 
include/authz/pamacct.h +2 -4
index 98454ddc25..44bb5ff28d 100644
@@ -27,10 +27,8 @@
 
 #define TYPE_QAUTHZ_PAM "authz-pam"
 
-typedef struct QAuthZPAM QAuthZPAM;
-typedef struct QAuthZPAMClass QAuthZPAMClass;
-DECLARE_OBJ_CHECKERS(QAuthZPAM, QAuthZPAMClass,
-                     QAUTHZ_PAM, TYPE_QAUTHZ_PAM)
+OBJECT_DECLARE_TYPE(QAuthZPAM, QAuthZPAMClass,
+                    qauthz_pam, QAUTHZ_PAM)
 
 
 
include/authz/simple.h +2 -4
index 7a896fb94b..ba4a5ec5ea 100644
@@ -26,10 +26,8 @@
 
 #define TYPE_QAUTHZ_SIMPLE "authz-simple"
 
-typedef struct QAuthZSimple QAuthZSimple;
-typedef struct QAuthZSimpleClass QAuthZSimpleClass;
-DECLARE_OBJ_CHECKERS(QAuthZSimple, QAuthZSimpleClass,
-                     QAUTHZ_SIMPLE, TYPE_QAUTHZ_SIMPLE)
+OBJECT_DECLARE_TYPE(QAuthZSimple, QAuthZSimpleClass,
+                    qauthz_simple, QAUTHZ_SIMPLE)
 
 
 
include/crypto/secret_common.h +2 -4
index dd3310ea5f..daf00c3b2a 100644
@@ -25,10 +25,8 @@
 #include "qom/object.h"
 
 #define TYPE_QCRYPTO_SECRET_COMMON "secret_common"
-typedef struct QCryptoSecretCommon QCryptoSecretCommon;
-typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass;
-DECLARE_OBJ_CHECKERS(QCryptoSecretCommon, QCryptoSecretCommonClass,
-                     QCRYPTO_SECRET_COMMON, TYPE_QCRYPTO_SECRET_COMMON)
+OBJECT_DECLARE_TYPE(QCryptoSecretCommon, QCryptoSecretCommonClass,
+                    qcrypto_secret_common, QCRYPTO_SECRET_COMMON)
 
 
 struct QCryptoSecretCommon {
include/crypto/secret_keyring.h +2 -4
index 9875f4cbf3..cc2c7397db 100644
@@ -26,10 +26,8 @@
 #include "crypto/secret_common.h"
 
 #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring"
-typedef struct QCryptoSecretKeyring QCryptoSecretKeyring;
-typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass;
-DECLARE_OBJ_CHECKERS(QCryptoSecretKeyring, QCryptoSecretKeyringClass,
-                     QCRYPTO_SECRET_KEYRING, TYPE_QCRYPTO_SECRET_KEYRING)
+OBJECT_DECLARE_TYPE(QCryptoSecretKeyring, QCryptoSecretKeyringClass,
+                    qcrypto_secret_keyring, QCRYPTO_SECRET_KEYRING)
 
 
 struct QCryptoSecretKeyring {
include/hw/arm/armsse.h +2 -4
index 452cbb5793..b844ef6bc0 100644
@@ -108,10 +108,8 @@
 #include "qom/object.h"
 
 #define TYPE_ARM_SSE "arm-sse"
-typedef struct ARMSSE ARMSSE;
-typedef struct ARMSSEClass ARMSSEClass;
-DECLARE_OBJ_CHECKERS(ARMSSE, ARMSSEClass,
-                     ARM_SSE, TYPE_ARM_SSE)
+OBJECT_DECLARE_TYPE(ARMSSE, ARMSSEClass,
+                    arm_sse, ARM_SSE)
 
 /*
  * These type names are for specific IoTKit subsystems; other than
include/hw/hyperv/vmbus.h +2 -4
index 0fe3d3b47c..00ad8798c1 100644
@@ -20,10 +20,8 @@
 
 #define TYPE_VMBUS_DEVICE "vmbus-dev"
 
-typedef struct VMBusDevice VMBusDevice;
-typedef struct VMBusDeviceClass VMBusDeviceClass;
-DECLARE_OBJ_CHECKERS(VMBusDevice, VMBusDeviceClass,
-                     VMBUS_DEVICE, TYPE_VMBUS_DEVICE)
+OBJECT_DECLARE_TYPE(VMBusDevice, VMBusDeviceClass,
+                    vmbus_device, VMBUS_DEVICE)
 
 #define TYPE_VMBUS "vmbus"
 typedef struct VMBus VMBus;
include/hw/i2c/i2c.h +2 -4
index 2074f7c971..5b8eef62c6 100644
@@ -16,12 +16,10 @@ enum i2c_event {
     I2C_NACK /* Masker NACKed a receive byte.  */
 };
 
-typedef struct I2CSlave I2CSlave;
 
 #define TYPE_I2C_SLAVE "i2c-slave"
-typedef struct I2CSlaveClass I2CSlaveClass;
-DECLARE_OBJ_CHECKERS(I2CSlave, I2CSlaveClass,
-                     I2C_SLAVE, TYPE_I2C_SLAVE)
+OBJECT_DECLARE_TYPE(I2CSlave, I2CSlaveClass,
+                    i2c_slave, I2C_SLAVE)
 
 struct I2CSlaveClass {
     DeviceClass parent_class;
include/hw/i2c/smbus_slave.h +2 -4
index 8d16e4bcd9..cb9cb372f9 100644
@@ -29,10 +29,8 @@
 #include "qom/object.h"
 
 #define TYPE_SMBUS_DEVICE "smbus-device"
-typedef struct SMBusDevice SMBusDevice;
-typedef struct SMBusDeviceClass SMBusDeviceClass;
-DECLARE_OBJ_CHECKERS(SMBusDevice, SMBusDeviceClass,
-                     SMBUS_DEVICE, TYPE_SMBUS_DEVICE)
+OBJECT_DECLARE_TYPE(SMBusDevice, SMBusDeviceClass,
+                    smbus_device, SMBUS_DEVICE)
 
 
 struct SMBusDeviceClass {
include/hw/ipack/ipack.h +2 -4
index a2304c1b3e..a59a487853 100644
@@ -30,12 +30,10 @@ struct IPackBus {
     qemu_irq_handler set_irq;
 };
 
-typedef struct IPackDevice IPackDevice;
-typedef struct IPackDeviceClass IPackDeviceClass;
 
 #define TYPE_IPACK_DEVICE "ipack-device"
-DECLARE_OBJ_CHECKERS(IPackDevice, IPackDeviceClass,
-                     IPACK_DEVICE, TYPE_IPACK_DEVICE)
+OBJECT_DECLARE_TYPE(IPackDevice, IPackDeviceClass,
+                    ipack_device, IPACK_DEVICE)
 
 struct IPackDeviceClass {
     /*< private >*/
include/hw/ipmi/ipmi.h +2 -4
index 01c9d497c4..3fa5a4abd0 100644
@@ -176,10 +176,8 @@ struct IPMIInterfaceClass {
  * Define a BMC simulator (or perhaps a connection to a real BMC)
  */
 #define TYPE_IPMI_BMC "ipmi-bmc"
-typedef struct IPMIBmc IPMIBmc;
-typedef struct IPMIBmcClass IPMIBmcClass;
-DECLARE_OBJ_CHECKERS(IPMIBmc, IPMIBmcClass,
-                     IPMI_BMC, TYPE_IPMI_BMC)
+OBJECT_DECLARE_TYPE(IPMIBmc, IPMIBmcClass,
+                    ipmi_bmc, IPMI_BMC)
 
 struct IPMIBmc {
     DeviceState parent;
include/hw/mem/pc-dimm.h +2 -4
index 86e3010243..1d570defc9 100644
@@ -21,10 +21,8 @@
 #include "qom/object.h"
 
 #define TYPE_PC_DIMM "pc-dimm"
-typedef struct PCDIMMDevice PCDIMMDevice;
-typedef struct PCDIMMDeviceClass PCDIMMDeviceClass;
-DECLARE_OBJ_CHECKERS(PCDIMMDevice, PCDIMMDeviceClass,
-                     PC_DIMM, TYPE_PC_DIMM)
+OBJECT_DECLARE_TYPE(PCDIMMDevice, PCDIMMDeviceClass,
+                    pc_dimm, PC_DIMM)
 
 #define PC_DIMM_ADDR_PROP "addr"
 #define PC_DIMM_SLOT_PROP "slot"
include/hw/ppc/pnv.h +2 -4
index f3bacb6a5c..b4b2b24d80 100644
@@ -35,10 +35,8 @@
 #include "qom/object.h"
 
 #define TYPE_PNV_CHIP "pnv-chip"
-typedef struct PnvChip PnvChip;
-typedef struct PnvChipClass PnvChipClass;
-DECLARE_OBJ_CHECKERS(PnvChip, PnvChipClass,
-                     PNV_CHIP, TYPE_PNV_CHIP)
+OBJECT_DECLARE_TYPE(PnvChip, PnvChipClass,
+                    pnv_chip, PNV_CHIP)
 
 struct PnvChip {
     /*< private >*/
include/hw/ppc/pnv_core.h +2 -4
index fd17a236e3..5cb22c2fa9 100644
@@ -25,10 +25,8 @@
 #include "qom/object.h"
 
 #define TYPE_PNV_CORE "powernv-cpu-core"
-typedef struct PnvCore PnvCore;
-typedef struct PnvCoreClass PnvCoreClass;
-DECLARE_OBJ_CHECKERS(PnvCore, PnvCoreClass,
-                     PNV_CORE, TYPE_PNV_CORE)
+OBJECT_DECLARE_TYPE(PnvCore, PnvCoreClass,
+                    pnv_core, PNV_CORE)
 
 typedef struct PnvChip PnvChip;
 
include/hw/ppc/pnv_homer.h +2 -4
index 7aadcab03c..0978812713 100644
@@ -24,10 +24,8 @@
 #include "qom/object.h"
 
 #define TYPE_PNV_HOMER "pnv-homer"
-typedef struct PnvHomer PnvHomer;
-typedef struct PnvHomerClass PnvHomerClass;
-DECLARE_OBJ_CHECKERS(PnvHomer, PnvHomerClass,
-                     PNV_HOMER, TYPE_PNV_HOMER)
+OBJECT_DECLARE_TYPE(PnvHomer, PnvHomerClass,
+                    pnv_homer, PNV_HOMER)
 #define TYPE_PNV8_HOMER TYPE_PNV_HOMER "-POWER8"
 DECLARE_INSTANCE_CHECKER(PnvHomer, PNV8_HOMER,
                          TYPE_PNV8_HOMER)
include/hw/ppc/pnv_occ.h +2 -4
index 4fcfb32417..b79e3440be 100644
@@ -24,10 +24,8 @@
 #include "qom/object.h"
 
 #define TYPE_PNV_OCC "pnv-occ"
-typedef struct PnvOCC PnvOCC;
-typedef struct PnvOCCClass PnvOCCClass;
-DECLARE_OBJ_CHECKERS(PnvOCC, PnvOCCClass,
-                     PNV_OCC, TYPE_PNV_OCC)
+OBJECT_DECLARE_TYPE(PnvOCC, PnvOCCClass,
+                    pnv_occ, PNV_OCC)
 #define TYPE_PNV8_OCC TYPE_PNV_OCC "-POWER8"
 DECLARE_INSTANCE_CHECKER(PnvOCC, PNV8_OCC,
                          TYPE_PNV8_OCC)
include/hw/ppc/pnv_psi.h +2 -4
index a33195df17..0034db44c3 100644
@@ -26,10 +26,8 @@
 #include "qom/object.h"
 
 #define TYPE_PNV_PSI "pnv-psi"
-typedef struct PnvPsi PnvPsi;
-typedef struct PnvPsiClass PnvPsiClass;
-DECLARE_OBJ_CHECKERS(PnvPsi, PnvPsiClass,
-                     PNV_PSI, TYPE_PNV_PSI)
+OBJECT_DECLARE_TYPE(PnvPsi, PnvPsiClass,
+                    pnv_psi, PNV_PSI)
 
 #define PSIHB_XSCOM_MAX         0x20
 
include/hw/ppc/pnv_xive.h +2 -4
index a014e2a726..29d5debd1c 100644
@@ -16,10 +16,8 @@
 struct PnvChip;
 
 #define TYPE_PNV_XIVE "pnv-xive"
-typedef struct PnvXive PnvXive;
-typedef struct PnvXiveClass PnvXiveClass;
-DECLARE_OBJ_CHECKERS(PnvXive, PnvXiveClass,
-                     PNV_XIVE, TYPE_PNV_XIVE)
+OBJECT_DECLARE_TYPE(PnvXive, PnvXiveClass,
+                    pnv_xive, PNV_XIVE)
 
 #define XIVE_BLOCK_MAX      16
 
include/hw/ppc/spapr_cpu_core.h +2 -4
index fba6a01050..4022917168 100644
@@ -16,10 +16,8 @@
 #include "qom/object.h"
 
 #define TYPE_SPAPR_CPU_CORE "spapr-cpu-core"
-typedef struct SpaprCpuCore SpaprCpuCore;
-typedef struct SpaprCpuCoreClass SpaprCpuCoreClass;
-DECLARE_OBJ_CHECKERS(SpaprCpuCore, SpaprCpuCoreClass,
-                     SPAPR_CPU_CORE, TYPE_SPAPR_CPU_CORE)
+OBJECT_DECLARE_TYPE(SpaprCpuCore, SpaprCpuCoreClass,
+                    spapr_cpu_core, SPAPR_CPU_CORE)
 
 #define SPAPR_CPU_CORE_TYPE_NAME(model) model "-" TYPE_SPAPR_CPU_CORE
 
include/hw/ppc/spapr_vio.h +2 -4
index e289028634..6c40da72ff 100644
@@ -28,10 +28,8 @@
 #include "qom/object.h"
 
 #define TYPE_VIO_SPAPR_DEVICE "vio-spapr-device"
-typedef struct SpaprVioDevice SpaprVioDevice;
-typedef struct SpaprVioDeviceClass SpaprVioDeviceClass;
-DECLARE_OBJ_CHECKERS(SpaprVioDevice, SpaprVioDeviceClass,
-                     VIO_SPAPR_DEVICE, TYPE_VIO_SPAPR_DEVICE)
+OBJECT_DECLARE_TYPE(SpaprVioDevice, SpaprVioDeviceClass,
+                    vio_spapr_device, VIO_SPAPR_DEVICE)
 
 #define TYPE_SPAPR_VIO_BUS "spapr-vio-bus"
 typedef struct SpaprVioBus SpaprVioBus;
include/hw/ppc/xics.h +2 -4
index bcb584b90d..c5a3cdcadc 100644
@@ -41,8 +41,6 @@
  * (the kernel implementation supports more but we don't exploit
  *  that yet)
  */
-typedef struct ICPStateClass ICPStateClass;
-typedef struct ICPState ICPState;
 typedef struct PnvICPState PnvICPState;
 typedef struct ICSStateClass ICSStateClass;
 typedef struct ICSState ICSState;
@@ -50,8 +48,8 @@ typedef struct ICSIRQState ICSIRQState;
 typedef struct XICSFabric XICSFabric;
 
 #define TYPE_ICP "icp"
-DECLARE_OBJ_CHECKERS(ICPState, ICPStateClass,
-                     ICP, TYPE_ICP)
+OBJECT_DECLARE_TYPE(ICPState, ICPStateClass,
+                    icp, ICP)
 
 #define TYPE_PNV_ICP "pnv-icp"
 DECLARE_INSTANCE_CHECKER(PnvICPState, PNV_ICP,
include/hw/ppc/xive.h +2 -4
index 48595ab641..482fafccfd 100644
@@ -345,12 +345,10 @@ struct XiveRouter {
 
     XiveFabric *xfb;
 };
-typedef struct XiveRouter XiveRouter;
 
 #define TYPE_XIVE_ROUTER "xive-router"
-typedef struct XiveRouterClass XiveRouterClass;
-DECLARE_OBJ_CHECKERS(XiveRouter, XiveRouterClass,
-                     XIVE_ROUTER, TYPE_XIVE_ROUTER)
+OBJECT_DECLARE_TYPE(XiveRouter, XiveRouterClass,
+                    xive_router, XIVE_ROUTER)
 
 struct XiveRouterClass {
     SysBusDeviceClass parent;
include/hw/s390x/event-facility.h +2 -4
index eccf6e924b..051c1c6576 100644
@@ -42,10 +42,8 @@
 #define SCLP_SELECTIVE_READ                     0x01
 
 #define TYPE_SCLP_EVENT "s390-sclp-event-type"
-typedef struct SCLPEvent SCLPEvent;
-typedef struct SCLPEventClass SCLPEventClass;
-DECLARE_OBJ_CHECKERS(SCLPEvent, SCLPEventClass,
-                     SCLP_EVENT, TYPE_SCLP_EVENT)
+OBJECT_DECLARE_TYPE(SCLPEvent, SCLPEventClass,
+                    sclp_event, SCLP_EVENT)
 
 #define TYPE_SCLP_CPU_HOTPLUG "sclp-cpu-hotplug"
 #define TYPE_SCLP_QUIESCE "sclpquiesce"
include/hw/s390x/s390_flic.h +2 -4
index a6a123598d..4b718c8ebf 100644
@@ -39,10 +39,8 @@ extern const VMStateDescription vmstate_adapter_routes;
     VMSTATE_STRUCT(_f, _s, 1, vmstate_adapter_routes, AdapterRoutes)
 
 #define TYPE_S390_FLIC_COMMON "s390-flic"
-typedef struct S390FLICState S390FLICState;
-typedef struct S390FLICStateClass S390FLICStateClass;
-DECLARE_OBJ_CHECKERS(S390FLICState, S390FLICStateClass,
-                     S390_FLIC_COMMON, TYPE_S390_FLIC_COMMON)
+OBJECT_DECLARE_TYPE(S390FLICState, S390FLICStateClass,
+                    s390_flic_common, S390_FLIC_COMMON)
 
 struct S390FLICState {
     SysBusDevice parent_obj;
include/hw/s390x/sclp.h +2 -4
index 5038a45612..e9f0f7e67c 100644
@@ -182,10 +182,8 @@ typedef struct SCCB {
  } QEMU_PACKED SCCB;
 
 #define TYPE_SCLP "sclp"
-typedef struct SCLPDevice SCLPDevice;
-typedef struct SCLPDeviceClass SCLPDeviceClass;
-DECLARE_OBJ_CHECKERS(SCLPDevice, SCLPDeviceClass,
-                     SCLP, TYPE_SCLP)
+OBJECT_DECLARE_TYPE(SCLPDevice, SCLPDeviceClass,
+                    sclp, SCLP)
 
 struct SCLPEventFacility;
 
include/hw/sd/sd.h +2 -4
index 31ccbeab0e..54f97a07cd 100644
@@ -90,7 +90,6 @@ typedef struct {
 } SDRequest;
 
 typedef struct SDState SDState;
-typedef struct SDBus SDBus;
 
 #define TYPE_SD_CARD "sd-card"
 typedef struct SDCardClass SDCardClass;
@@ -130,9 +129,8 @@ struct SDCardClass {
 };
 
 #define TYPE_SD_BUS "sd-bus"
-typedef struct SDBusClass SDBusClass;
-DECLARE_OBJ_CHECKERS(SDBus, SDBusClass,
-                     SD_BUS, TYPE_SD_BUS)
+OBJECT_DECLARE_TYPE(SDBus, SDBusClass,
+                    sd_bus, SD_BUS)
 
 struct SDBus {
     BusState qbus;
include/hw/ssi/ssi.h +2 -4
index b9286989fc..4fe1d85136 100644
@@ -14,13 +14,11 @@
 #include "hw/qdev-core.h"
 #include "qom/object.h"
 
-typedef struct SSISlave SSISlave;
-typedef struct SSISlaveClass SSISlaveClass;
 typedef enum SSICSMode SSICSMode;
 
 #define TYPE_SSI_SLAVE "ssi-slave"
-DECLARE_OBJ_CHECKERS(SSISlave, SSISlaveClass,
-                     SSI_SLAVE, TYPE_SSI_SLAVE)
+OBJECT_DECLARE_TYPE(SSISlave, SSISlaveClass,
+                    ssi_slave, SSI_SLAVE)
 
 #define SSI_GPIO_CS "ssi-gpio-cs"
 
include/hw/sysbus.h +2 -4
index 77e21bba18..28a9b0f634 100644
@@ -14,12 +14,10 @@
 DECLARE_INSTANCE_CHECKER(BusState, SYSTEM_BUS,
                          TYPE_SYSTEM_BUS)
 
-typedef struct SysBusDevice SysBusDevice;
 
 #define TYPE_SYS_BUS_DEVICE "sys-bus-device"
-typedef struct SysBusDeviceClass SysBusDeviceClass;
-DECLARE_OBJ_CHECKERS(SysBusDevice, SysBusDeviceClass,
-                     SYS_BUS_DEVICE, TYPE_SYS_BUS_DEVICE)
+OBJECT_DECLARE_TYPE(SysBusDevice, SysBusDeviceClass,
+                    sys_bus_device, SYS_BUS_DEVICE)
 
 /**
  * SysBusDeviceClass:
include/hw/virtio/virtio-gpu.h +2 -4
index 72f8689e2e..f334b78085 100644
@@ -25,10 +25,8 @@
 #include "qom/object.h"
 
 #define TYPE_VIRTIO_GPU_BASE "virtio-gpu-base"
-typedef struct VirtIOGPUBase VirtIOGPUBase;
-typedef struct VirtIOGPUBaseClass VirtIOGPUBaseClass;
-DECLARE_OBJ_CHECKERS(VirtIOGPUBase, VirtIOGPUBaseClass,
-                     VIRTIO_GPU_BASE, TYPE_VIRTIO_GPU_BASE)
+OBJECT_DECLARE_TYPE(VirtIOGPUBase, VirtIOGPUBaseClass,
+                    virtio_gpu_base, VIRTIO_GPU_BASE)
 
 #define TYPE_VIRTIO_GPU "virtio-gpu-device"
 typedef struct VirtIOGPU VirtIOGPU;
include/hw/virtio/virtio-input.h +2 -4
index c54aa6aa72..5eb9e7745e 100644
@@ -19,10 +19,8 @@ typedef struct virtio_input_event virtio_input_event;
 /* qemu internals                                                    */
 
 #define TYPE_VIRTIO_INPUT "virtio-input-device"
-typedef struct VirtIOInput VirtIOInput;
-typedef struct VirtIOInputClass VirtIOInputClass;
-DECLARE_OBJ_CHECKERS(VirtIOInput, VirtIOInputClass,
-                     VIRTIO_INPUT, TYPE_VIRTIO_INPUT)
+OBJECT_DECLARE_TYPE(VirtIOInput, VirtIOInputClass,
+                    virtio_input, VIRTIO_INPUT)
 #define VIRTIO_INPUT_GET_PARENT_CLASS(obj) \
         OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT)
 
include/hw/virtio/virtio-mem.h +2 -4
index 5f0b81a967..dfc72e14b1 100644
@@ -21,10 +21,8 @@
 
 #define TYPE_VIRTIO_MEM "virtio-mem"
 
-typedef struct VirtIOMEM VirtIOMEM;
-typedef struct VirtIOMEMClass VirtIOMEMClass;
-DECLARE_OBJ_CHECKERS(VirtIOMEM, VirtIOMEMClass,
-                     VIRTIO_MEM, TYPE_VIRTIO_MEM)
+OBJECT_DECLARE_TYPE(VirtIOMEM, VirtIOMEMClass,
+                    virtio_mem, VIRTIO_MEM)
 
 #define VIRTIO_MEM_MEMDEV_PROP "memdev"
 #define VIRTIO_MEM_NODE_PROP "node"
include/hw/virtio/virtio-pmem.h +2 -4
index 6c15abad70..56df9a03ce 100644
@@ -20,10 +20,8 @@
 
 #define TYPE_VIRTIO_PMEM "virtio-pmem"
 
-typedef struct VirtIOPMEM VirtIOPMEM;
-typedef struct VirtIOPMEMClass VirtIOPMEMClass;
-DECLARE_OBJ_CHECKERS(VirtIOPMEM, VirtIOPMEMClass,
-                     VIRTIO_PMEM, TYPE_VIRTIO_PMEM)
+OBJECT_DECLARE_TYPE(VirtIOPMEM, VirtIOPMEMClass,
+                    virtio_pmem, VIRTIO_PMEM)
 
 #define VIRTIO_PMEM_ADDR_PROP "memaddr"
 #define VIRTIO_PMEM_MEMDEV_PROP "memdev"
include/hw/virtio/virtio-serial.h +2 -4
index bbc76d5032..0b7f963611 100644
@@ -26,10 +26,8 @@ struct virtio_serial_conf {
 };
 
 #define TYPE_VIRTIO_SERIAL_PORT "virtio-serial-port"
-typedef struct VirtIOSerialPort VirtIOSerialPort;
-typedef struct VirtIOSerialPortClass VirtIOSerialPortClass;
-DECLARE_OBJ_CHECKERS(VirtIOSerialPort, VirtIOSerialPortClass,
-                     VIRTIO_SERIAL_PORT, TYPE_VIRTIO_SERIAL_PORT)
+OBJECT_DECLARE_TYPE(VirtIOSerialPort, VirtIOSerialPortClass,
+                    virtio_serial_port, VIRTIO_SERIAL_PORT)
 
 typedef struct VirtIOSerial VirtIOSerial;
 
include/hw/xen/xen-bus.h +2 -4
index 35fec7c905..e0e67505b8 100644
@@ -71,17 +71,15 @@ struct XenBus {
     XenWatch *backend_watch;
     QLIST_HEAD(, XenDevice) inactive_devices;
 };
-typedef struct XenBus XenBus;
 
 struct XenBusClass {
     /*< private >*/
     BusClass parent_class;
 };
-typedef struct XenBusClass XenBusClass;
 
 #define TYPE_XEN_BUS "xen-bus"
-DECLARE_OBJ_CHECKERS(XenBus, XenBusClass,
-                     XEN_BUS, TYPE_XEN_BUS)
+OBJECT_DECLARE_TYPE(XenBus, XenBusClass,
+                    xen_bus, XEN_BUS)
 
 void xen_bus_init(void);
 
include/io/channel.h +2 -4
index 3ebdc7954f..245479548a 100644
@@ -26,10 +26,8 @@
 #include "block/aio.h"
 
 #define TYPE_QIO_CHANNEL "qio-channel"
-typedef struct QIOChannel QIOChannel;
-typedef struct QIOChannelClass QIOChannelClass;
-DECLARE_OBJ_CHECKERS(QIOChannel, QIOChannelClass,
-                     QIO_CHANNEL, TYPE_QIO_CHANNEL)
+OBJECT_DECLARE_TYPE(QIOChannel, QIOChannelClass,
+                    qio_channel, QIO_CHANNEL)
 
 
 #define QIO_CHANNEL_ERR_BLOCK -2
include/io/dns-resolver.h +2 -4
index 96a3186b6b..8ae4857e05 100644
@@ -26,10 +26,8 @@
 #include "io/task.h"
 
 #define TYPE_QIO_DNS_RESOLVER "qio-dns-resolver"
-typedef struct QIODNSResolver QIODNSResolver;
-typedef struct QIODNSResolverClass QIODNSResolverClass;
-DECLARE_OBJ_CHECKERS(QIODNSResolver, QIODNSResolverClass,
-                     QIO_DNS_RESOLVER, TYPE_QIO_DNS_RESOLVER)
+OBJECT_DECLARE_TYPE(QIODNSResolver, QIODNSResolverClass,
+                    qio_dns_resolver, QIO_DNS_RESOLVER)
 
 
 /**
include/io/net-listener.h +2 -4
index 93367db291..4f0847ff19 100644
@@ -25,10 +25,8 @@
 #include "qom/object.h"
 
 #define TYPE_QIO_NET_LISTENER "qio-net-listener"
-typedef struct QIONetListener QIONetListener;
-typedef struct QIONetListenerClass QIONetListenerClass;
-DECLARE_OBJ_CHECKERS(QIONetListener, QIONetListenerClass,
-                     QIO_NET_LISTENER, TYPE_QIO_NET_LISTENER)
+OBJECT_DECLARE_TYPE(QIONetListener, QIONetListenerClass,
+                    qio_net_listener, QIO_NET_LISTENER)
 
 
 typedef void (*QIONetListenerClientFunc)(QIONetListener *listener,
include/scsi/pr-manager.h +2 -4
index f801fe9533..26bd134531 100644
@@ -9,10 +9,8 @@
 
 #define TYPE_PR_MANAGER "pr-manager"
 
-typedef struct PRManager PRManager;
-typedef struct PRManagerClass PRManagerClass;
-DECLARE_OBJ_CHECKERS(PRManager, PRManagerClass,
-                     PR_MANAGER, TYPE_PR_MANAGER)
+OBJECT_DECLARE_TYPE(PRManager, PRManagerClass,
+                    pr_manager, PR_MANAGER)
 
 struct sg_io_hdr;
 
include/sysemu/cryptodev.h +2 -4
index 65c017cf81..06726f7014 100644
@@ -37,10 +37,8 @@
 
 #define TYPE_CRYPTODEV_BACKEND "cryptodev-backend"
 
-typedef struct CryptoDevBackend CryptoDevBackend;
-typedef struct CryptoDevBackendClass CryptoDevBackendClass;
-DECLARE_OBJ_CHECKERS(CryptoDevBackend, CryptoDevBackendClass,
-                     CRYPTODEV_BACKEND, TYPE_CRYPTODEV_BACKEND)
+OBJECT_DECLARE_TYPE(CryptoDevBackend, CryptoDevBackendClass,
+                    cryptodev_backend, CRYPTODEV_BACKEND)
 
 
 #define MAX_CRYPTO_QUEUE_NUM  64
include/sysemu/hostmem.h +2 -4
index 1e6078f872..e5b7a152d3 100644
@@ -20,10 +20,8 @@
 #include "qemu/bitmap.h"
 
 #define TYPE_MEMORY_BACKEND "memory-backend"
-typedef struct HostMemoryBackend HostMemoryBackend;
-typedef struct HostMemoryBackendClass HostMemoryBackendClass;
-DECLARE_OBJ_CHECKERS(HostMemoryBackend, HostMemoryBackendClass,
-                     MEMORY_BACKEND, TYPE_MEMORY_BACKEND)
+OBJECT_DECLARE_TYPE(HostMemoryBackend, HostMemoryBackendClass,
+                    memory_backend, MEMORY_BACKEND)
 
 /* hostmem-ram.c */
 /**
include/sysemu/rng.h +2 -4
index f8fc948109..cee45a4787 100644
@@ -17,10 +17,8 @@
 #include "qom/object.h"
 
 #define TYPE_RNG_BACKEND "rng-backend"
-typedef struct RngBackend RngBackend;
-typedef struct RngBackendClass RngBackendClass;
-DECLARE_OBJ_CHECKERS(RngBackend, RngBackendClass,
-                     RNG_BACKEND, TYPE_RNG_BACKEND)
+OBJECT_DECLARE_TYPE(RngBackend, RngBackendClass,
+                    rng_backend, RNG_BACKEND)
 
 #define TYPE_RNG_BUILTIN "rng-builtin"
 
include/sysemu/tpm_backend.h +2 -4
index e038b79d34..7e8a014031 100644
@@ -19,10 +19,8 @@
 #include "qapi/error.h"
 
 #define TYPE_TPM_BACKEND "tpm-backend"
-typedef struct TPMBackend TPMBackend;
-typedef struct TPMBackendClass TPMBackendClass;
-DECLARE_OBJ_CHECKERS(TPMBackend, TPMBackendClass,
-                     TPM_BACKEND, TYPE_TPM_BACKEND)
+OBJECT_DECLARE_TYPE(TPMBackend, TPMBackendClass,
+                    tpm_backend, TPM_BACKEND)
 
 
 typedef struct TPMBackendCmd {
include/sysemu/vhost-user-backend.h +2 -4
index e4c85e33c0..76ca06cf40 100644
@@ -22,10 +22,8 @@
 #include "io/channel.h"
 
 #define TYPE_VHOST_USER_BACKEND "vhost-user-backend"
-typedef struct VhostUserBackend VhostUserBackend;
-typedef struct VhostUserBackendClass VhostUserBackendClass;
-DECLARE_OBJ_CHECKERS(VhostUserBackend, VhostUserBackendClass,
-                     VHOST_USER_BACKEND, TYPE_VHOST_USER_BACKEND)
+OBJECT_DECLARE_TYPE(VhostUserBackend, VhostUserBackendClass,
+                    vhost_user_backend, VHOST_USER_BACKEND)
 
 
 struct VhostUserBackendClass {
target/alpha/cpu-qom.h +2 -4
index 45350318c9..568fe3fb77 100644
@@ -25,10 +25,8 @@
 
 #define TYPE_ALPHA_CPU "alpha-cpu"
 
-typedef struct AlphaCPU AlphaCPU;
-typedef struct AlphaCPUClass AlphaCPUClass;
-DECLARE_OBJ_CHECKERS(AlphaCPU, AlphaCPUClass,
-                     ALPHA_CPU, TYPE_ALPHA_CPU)
+OBJECT_DECLARE_TYPE(AlphaCPU, AlphaCPUClass,
+                    alpha_cpu, ALPHA_CPU)
 
 /**
  * AlphaCPUClass:
target/arm/cpu-qom.h +2 -4
index 92d58f84fe..94bbbd4473 100644
@@ -27,10 +27,8 @@ struct arm_boot_info;
 
 #define TYPE_ARM_CPU "arm-cpu"
 
-typedef struct ARMCPU ARMCPU;
-typedef struct ARMCPUClass ARMCPUClass;
-DECLARE_OBJ_CHECKERS(ARMCPU, ARMCPUClass,
-                     ARM_CPU, TYPE_ARM_CPU)
+OBJECT_DECLARE_TYPE(ARMCPU, ARMCPUClass,
+                    arm_cpu, ARM_CPU)
 
 #define TYPE_ARM_MAX_CPU "max-" TYPE_ARM_CPU
 
target/avr/cpu-qom.h +2 -4
index 1bbfbb2087..49d63faad2 100644
@@ -26,10 +26,8 @@
 
 #define TYPE_AVR_CPU "avr-cpu"
 
-typedef struct AVRCPU AVRCPU;
-typedef struct AVRCPUClass AVRCPUClass;
-DECLARE_OBJ_CHECKERS(AVRCPU, AVRCPUClass,
-                     AVR_CPU, TYPE_AVR_CPU)
+OBJECT_DECLARE_TYPE(AVRCPU, AVRCPUClass,
+                    avr_cpu, AVR_CPU)
 
 /**
  *  AVRCPUClass:
target/cris/cpu-qom.h +2 -4
index eced6ef7c9..2b0328113c 100644
@@ -25,10 +25,8 @@
 
 #define TYPE_CRIS_CPU "cris-cpu"
 
-typedef struct CRISCPU CRISCPU;
-typedef struct CRISCPUClass CRISCPUClass;
-DECLARE_OBJ_CHECKERS(CRISCPU, CRISCPUClass,
-                     CRIS_CPU, TYPE_CRIS_CPU)
+OBJECT_DECLARE_TYPE(CRISCPU, CRISCPUClass,
+                    cris_cpu, CRIS_CPU)
 
 /**
  * CRISCPUClass:
target/hppa/cpu-qom.h +2 -4
index 5c5aa0c053..58158f374b 100644
@@ -25,10 +25,8 @@
 
 #define TYPE_HPPA_CPU "hppa-cpu"
 
-typedef struct HPPACPU HPPACPU;
-typedef struct HPPACPUClass HPPACPUClass;
-DECLARE_OBJ_CHECKERS(HPPACPU, HPPACPUClass,
-                     HPPA_CPU, TYPE_HPPA_CPU)
+OBJECT_DECLARE_TYPE(HPPACPU, HPPACPUClass,
+                    hppa_cpu, HPPA_CPU)
 
 /**
  * HPPACPUClass:
target/i386/cpu-qom.h +2 -4
index 05b52ba74c..0505472e86 100644
@@ -30,10 +30,8 @@
 #define TYPE_X86_CPU "i386-cpu"
 #endif
 
-typedef struct X86CPU X86CPU;
-typedef struct X86CPUClass X86CPUClass;
-DECLARE_OBJ_CHECKERS(X86CPU, X86CPUClass,
-                     X86_CPU, TYPE_X86_CPU)
+OBJECT_DECLARE_TYPE(X86CPU, X86CPUClass,
+                    x86_cpu, X86_CPU)
 
 typedef struct X86CPUModel X86CPUModel;
 
target/lm32/cpu-qom.h +2 -4
index 9bf2f82ffe..e9eb495bf0 100644
@@ -25,10 +25,8 @@
 
 #define TYPE_LM32_CPU "lm32-cpu"
 
-typedef struct LM32CPU LM32CPU;
-typedef struct LM32CPUClass LM32CPUClass;
-DECLARE_OBJ_CHECKERS(LM32CPU, LM32CPUClass,
-                     LM32_CPU, TYPE_LM32_CPU)
+OBJECT_DECLARE_TYPE(LM32CPU, LM32CPUClass,
+                    lm32_cpu, LM32_CPU)
 
 /**
  * LM32CPUClass:
target/m68k/cpu-qom.h +2 -4
index 241a3b19af..a10429cf67 100644
@@ -25,10 +25,8 @@
 
 #define TYPE_M68K_CPU "m68k-cpu"
 
-typedef struct M68kCPU M68kCPU;
-typedef struct M68kCPUClass M68kCPUClass;
-DECLARE_OBJ_CHECKERS(M68kCPU, M68kCPUClass,
-                     M68K_CPU, TYPE_M68K_CPU)
+OBJECT_DECLARE_TYPE(M68kCPU, M68kCPUClass,
+                    m68k_cpu, M68K_CPU)
 
 /*
  * M68kCPUClass:
target/microblaze/cpu-qom.h +2 -4
index 73c2237f98..82734b9b2b 100644
@@ -25,10 +25,8 @@
 
 #define TYPE_MICROBLAZE_CPU "microblaze-cpu"
 
-typedef struct MicroBlazeCPU MicroBlazeCPU;
-typedef struct MicroBlazeCPUClass MicroBlazeCPUClass;
-DECLARE_OBJ_CHECKERS(MicroBlazeCPU, MicroBlazeCPUClass,
-                     MICROBLAZE_CPU, TYPE_MICROBLAZE_CPU)
+OBJECT_DECLARE_TYPE(MicroBlazeCPU, MicroBlazeCPUClass,
+                    microblaze_cpu, MICROBLAZE_CPU)
 
 /**
  * MicroBlazeCPUClass:
target/mips/cpu-qom.h +2 -4
index 82f45a828c..93fbbdca1b 100644
@@ -29,10 +29,8 @@
 #define TYPE_MIPS_CPU "mips-cpu"
 #endif
 
-typedef struct MIPSCPU MIPSCPU;
-typedef struct MIPSCPUClass MIPSCPUClass;
-DECLARE_OBJ_CHECKERS(MIPSCPU, MIPSCPUClass,
-                     MIPS_CPU, TYPE_MIPS_CPU)
+OBJECT_DECLARE_TYPE(MIPSCPU, MIPSCPUClass,
+                    mips_cpu, MIPS_CPU)
 
 /**
  * MIPSCPUClass:
target/moxie/cpu.h +2 -4
index a9832a2d85..d58761ccb1 100644
@@ -51,10 +51,8 @@ typedef struct CPUMoxieState {
 
 #define TYPE_MOXIE_CPU "moxie-cpu"
 
-typedef struct MoxieCPU MoxieCPU;
-typedef struct MoxieCPUClass MoxieCPUClass;
-DECLARE_OBJ_CHECKERS(MoxieCPU, MoxieCPUClass,
-                     MOXIE_CPU, TYPE_MOXIE_CPU)
+OBJECT_DECLARE_TYPE(MoxieCPU, MoxieCPUClass,
+                    moxie_cpu, MOXIE_CPU)
 
 /**
  * MoxieCPUClass:
target/nios2/cpu.h +2 -4
index 0b91a3634b..1fa0fdaa35 100644
@@ -32,10 +32,8 @@ typedef struct CPUNios2State CPUNios2State;
 
 #define TYPE_NIOS2_CPU "nios2-cpu"
 
-typedef struct Nios2CPU Nios2CPU;
-typedef struct Nios2CPUClass Nios2CPUClass;
-DECLARE_OBJ_CHECKERS(Nios2CPU, Nios2CPUClass,
-                     NIOS2_CPU, TYPE_NIOS2_CPU)
+OBJECT_DECLARE_TYPE(Nios2CPU, Nios2CPUClass,
+                    nios2_cpu, NIOS2_CPU)
 
 /**
  * Nios2CPUClass:
target/openrisc/cpu.h +2 -4
index 5e6d8a40d6..d0a8ee657a 100644
@@ -29,10 +29,8 @@ struct OpenRISCCPU;
 
 #define TYPE_OPENRISC_CPU "or1k-cpu"
 
-typedef struct OpenRISCCPU OpenRISCCPU;
-typedef struct OpenRISCCPUClass OpenRISCCPUClass;
-DECLARE_OBJ_CHECKERS(OpenRISCCPU, OpenRISCCPUClass,
-                     OPENRISC_CPU, TYPE_OPENRISC_CPU)
+OBJECT_DECLARE_TYPE(OpenRISCCPU, OpenRISCCPUClass,
+                    openrisc_cpu, OPENRISC_CPU)
 
 /**
  * OpenRISCCPUClass:
target/ppc/cpu-qom.h +2 -4
index f7e600c7b3..5cf806a3a6 100644
@@ -29,10 +29,8 @@
 #define TYPE_POWERPC_CPU "powerpc-cpu"
 #endif
 
-typedef struct PowerPCCPU PowerPCCPU;
-typedef struct PowerPCCPUClass PowerPCCPUClass;
-DECLARE_OBJ_CHECKERS(PowerPCCPU, PowerPCCPUClass,
-                     POWERPC_CPU, TYPE_POWERPC_CPU)
+OBJECT_DECLARE_TYPE(PowerPCCPU, PowerPCCPUClass,
+                    powerpc_cpu, POWERPC_CPU)
 
 typedef struct CPUPPCState CPUPPCState;
 typedef struct ppc_tb_t ppc_tb_t;
target/riscv/cpu.h +2 -4
index 04ccb78738..ca75fc761e 100644
@@ -232,10 +232,8 @@ struct CPURISCVState {
     QEMUTimer *timer; /* Internal timer */
 };
 
-typedef struct RISCVCPU RISCVCPU;
-typedef struct RISCVCPUClass RISCVCPUClass;
-DECLARE_OBJ_CHECKERS(RISCVCPU, RISCVCPUClass,
-                     RISCV_CPU, TYPE_RISCV_CPU)
+OBJECT_DECLARE_TYPE(RISCVCPU, RISCVCPUClass,
+                    riscv_cpu, RISCV_CPU)
 
 /**
  * RISCVCPUClass:
target/rx/cpu-qom.h +2 -4
index 05f5773ab1..6c5321078d 100644
@@ -26,10 +26,8 @@
 
 #define TYPE_RX62N_CPU RX_CPU_TYPE_NAME("rx62n")
 
-typedef struct RXCPU RXCPU;
-typedef struct RXCPUClass RXCPUClass;
-DECLARE_OBJ_CHECKERS(RXCPU, RXCPUClass,
-                     RX_CPU, TYPE_RX_CPU)
+OBJECT_DECLARE_TYPE(RXCPU, RXCPUClass,
+                    rx_cpu, RX_CPU)
 
 /*
  * RXCPUClass:
target/s390x/cpu-qom.h +2 -4
index 5f0dccdac1..e2b2513711 100644
@@ -25,10 +25,8 @@
 
 #define TYPE_S390_CPU "s390x-cpu"
 
-typedef struct S390CPU S390CPU;
-typedef struct S390CPUClass S390CPUClass;
-DECLARE_OBJ_CHECKERS(S390CPU, S390CPUClass,
-                     S390_CPU, TYPE_S390_CPU)
+OBJECT_DECLARE_TYPE(S390CPU, S390CPUClass,
+                    s390_cpu, S390_CPU)
 
 typedef struct S390CPUModel S390CPUModel;
 typedef struct S390CPUDef S390CPUDef;
target/sh4/cpu-qom.h +2 -4
index b04b2bb4bf..595814b8cb 100644
@@ -29,10 +29,8 @@
 #define TYPE_SH7751R_CPU SUPERH_CPU_TYPE_NAME("sh7751r")
 #define TYPE_SH7785_CPU  SUPERH_CPU_TYPE_NAME("sh7785")
 
-typedef struct SuperHCPU SuperHCPU;
-typedef struct SuperHCPUClass SuperHCPUClass;
-DECLARE_OBJ_CHECKERS(SuperHCPU, SuperHCPUClass,
-                     SUPERH_CPU, TYPE_SUPERH_CPU)
+OBJECT_DECLARE_TYPE(SuperHCPU, SuperHCPUClass,
+                    superh_cpu, SUPERH_CPU)
 
 /**
  * SuperHCPUClass:
target/sparc/cpu-qom.h +2 -4
index 42cb631d45..5d7fb727bc 100644
@@ -29,10 +29,8 @@
 #define TYPE_SPARC_CPU "sparc-cpu"
 #endif
 
-typedef struct SPARCCPU SPARCCPU;
-typedef struct SPARCCPUClass SPARCCPUClass;
-DECLARE_OBJ_CHECKERS(SPARCCPU, SPARCCPUClass,
-                     SPARC_CPU, TYPE_SPARC_CPU)
+OBJECT_DECLARE_TYPE(SPARCCPU, SPARCCPUClass,
+                    sparc_cpu, SPARC_CPU)
 
 typedef struct sparc_def_t sparc_def_t;
 /**
target/tilegx/cpu.h +2 -4
index d4cf70dc15..d251ff80b8 100644
@@ -99,10 +99,8 @@ typedef struct CPUTLGState {
 
 #define TYPE_TILEGX_CPU "tilegx-cpu"
 
-typedef struct TileGXCPU TileGXCPU;
-typedef struct TileGXCPUClass TileGXCPUClass;
-DECLARE_OBJ_CHECKERS(TileGXCPU, TileGXCPUClass,
-                     TILEGX_CPU, TYPE_TILEGX_CPU)
+OBJECT_DECLARE_TYPE(TileGXCPU, TileGXCPUClass,
+                    tilegx_cpu, TILEGX_CPU)
 
 /**
  * TileGXCPUClass:
target/tricore/cpu-qom.h +2 -4
index 1988c26093..9e588c4c34 100644
@@ -24,10 +24,8 @@
 
 #define TYPE_TRICORE_CPU "tricore-cpu"
 
-typedef struct TriCoreCPU TriCoreCPU;
-typedef struct TriCoreCPUClass TriCoreCPUClass;
-DECLARE_OBJ_CHECKERS(TriCoreCPU, TriCoreCPUClass,
-                     TRICORE_CPU, TYPE_TRICORE_CPU)
+OBJECT_DECLARE_TYPE(TriCoreCPU, TriCoreCPUClass,
+                    tricore_cpu, TRICORE_CPU)
 
 struct TriCoreCPUClass {
     /*< private >*/
target/unicore32/cpu-qom.h +2 -4
index 5b67ac532d..c914273058 100644
@@ -16,10 +16,8 @@
 
 #define TYPE_UNICORE32_CPU "unicore32-cpu"
 
-typedef struct UniCore32CPU UniCore32CPU;
-typedef struct UniCore32CPUClass UniCore32CPUClass;
-DECLARE_OBJ_CHECKERS(UniCore32CPU, UniCore32CPUClass,
-                     UNICORE32_CPU, TYPE_UNICORE32_CPU)
+OBJECT_DECLARE_TYPE(UniCore32CPU, UniCore32CPUClass,
+                    unicore32_cpu, UNICORE32_CPU)
 
 /**
  * UniCore32CPUClass:
target/xtensa/cpu-qom.h +2 -4
index ef13262b42..299ce3e63c 100644
@@ -34,10 +34,8 @@
 
 #define TYPE_XTENSA_CPU "xtensa-cpu"
 
-typedef struct XtensaCPU XtensaCPU;
-typedef struct XtensaCPUClass XtensaCPUClass;
-DECLARE_OBJ_CHECKERS(XtensaCPU, XtensaCPUClass,
-                     XTENSA_CPU, TYPE_XTENSA_CPU)
+OBJECT_DECLARE_TYPE(XtensaCPU, XtensaCPUClass,
+                    xtensa_cpu, XTENSA_CPU)
 
 typedef struct XtensaConfig XtensaConfig;
 
backends/dbus-vmstate.c +2 -4
index bfbd4f09f1..0ca9d52ae5 100644
@@ -21,12 +21,10 @@
 #include "trace.h"
 #include "qom/object.h"
 
-typedef struct DBusVMState DBusVMState;
-typedef struct DBusVMStateClass DBusVMStateClass;
 
 #define TYPE_DBUS_VMSTATE "dbus-vmstate"
-DECLARE_OBJ_CHECKERS(DBusVMState, DBusVMStateClass,
-                     DBUS_VMSTATE, TYPE_DBUS_VMSTATE)
+OBJECT_DECLARE_TYPE(DBusVMState, DBusVMStateClass,
+                    dbus_vmstate, DBUS_VMSTATE)
 
 struct DBusVMStateClass {
     ObjectClass parent_class;
ui/input-barrier.c +2 -4
index 67d52afbea..c7a8dc19a7 100644
@@ -20,10 +20,8 @@
 #include "input-barrier.h"
 
 #define TYPE_INPUT_BARRIER "input-barrier"
-typedef struct InputBarrier InputBarrier;
-typedef struct InputBarrierClass InputBarrierClass;
-DECLARE_OBJ_CHECKERS(InputBarrier, InputBarrierClass,
-                     INPUT_BARRIER, TYPE_INPUT_BARRIER)
+OBJECT_DECLARE_TYPE(InputBarrier, InputBarrierClass,
+                    input_barrier, INPUT_BARRIER)
 
 
 #define MAX_HELLO_LENGTH 1024
ui/input-linux.c +2 -4
index bfdbd38c86..a95269cc25 100644
@@ -31,10 +31,8 @@ static bool linux_is_button(unsigned int lnx)
 }
 
 #define TYPE_INPUT_LINUX "input-linux"
-typedef struct InputLinux InputLinux;
-typedef struct InputLinuxClass InputLinuxClass;
-DECLARE_OBJ_CHECKERS(InputLinux, InputLinuxClass,
-                     INPUT_LINUX, TYPE_INPUT_LINUX)
+OBJECT_DECLARE_TYPE(InputLinux, InputLinuxClass,
+                    input_linux, INPUT_LINUX)
 
 
 struct InputLinux {
Signature · 1 line
2.26.2
#27 lore raw

[PULL 30/34] omap_intc: Use typedef name for instance_size

In reply to Eduardo Habkost

This makes the code consistent with the rest of QOM code in QEMU, and will make automated conversion to type declaration macros simpler.

Message-Id: <[email protected]>

---
 hw/intc/omap_intc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/intc/omap_intc.c +1 -1
index b8a1d1fd7d..d7183d035e 100644
@@ -676,7 +676,7 @@ static const TypeInfo omap2_intc_info = {
 static const TypeInfo omap_intc_type_info = {
     .name          = TYPE_OMAP_INTC,
     .parent        = TYPE_SYS_BUS_DEVICE,
-    .instance_size = sizeof(struct omap_intr_handler_s),
+    .instance_size = sizeof(omap_intr_handler),
     .abstract      = true,
 };
 
Signature · 1 line
2.26.2
#28 lore raw

[PULL 18/34] vfio: Rename VFIO_AP_DEVICE_TYPE to TYPE_VFIO_AP_DEVICE

In reply to Eduardo Habkost

This will make the type name constant consistent with the name of the type checking macro.

Message-Id: <[email protected]>

---
 hw/vfio/ap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/vfio/ap.c +4 -4
index 68ed059b39..582c091a24 100644
@@ -30,7 +30,7 @@
 #include "exec/address-spaces.h"
 #include "qom/object.h"
 
-#define VFIO_AP_DEVICE_TYPE      "vfio-ap"
+#define TYPE_VFIO_AP_DEVICE      "vfio-ap"
 
 struct VFIOAPDevice {
     APDevice apdev;
@@ -39,7 +39,7 @@ struct VFIOAPDevice {
 typedef struct VFIOAPDevice VFIOAPDevice;
 
 DECLARE_INSTANCE_CHECKER(VFIOAPDevice, VFIO_AP_DEVICE,
-                         VFIO_AP_DEVICE_TYPE)
+                         TYPE_VFIO_AP_DEVICE)
 
 static void vfio_ap_compute_needs_reset(VFIODevice *vdev)
 {
@@ -72,7 +72,7 @@ static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev, Error **errp)
 
     if (!group_path) {
         error_setg(errp, "%s: no iommu_group found for %s: %s",
-                   VFIO_AP_DEVICE_TYPE, vapdev->vdev.sysfsdev, gerror->message);
+                   TYPE_VFIO_AP_DEVICE, vapdev->vdev.sysfsdev, gerror->message);
         g_error_free(gerror);
         return NULL;
     }
@@ -176,7 +176,7 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo vfio_ap_info = {
-    .name = VFIO_AP_DEVICE_TYPE,
+    .name = TYPE_VFIO_AP_DEVICE,
     .parent = TYPE_AP_DEVICE,
     .instance_size = sizeof(VFIOAPDevice),
     .class_init = vfio_ap_class_init,
Signature · 1 line
2.26.2
#29 lore raw

[PULL 34/34] virtio-vga: Use typedef name for instance_size

In reply to Eduardo Habkost

This makes the code consistent with the rest of QOM code in QEMU, and will make automated conversion to type declaration macros simpler.

Message-Id: <[email protected]>

---
 hw/display/virtio-vga.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/display/virtio-vga.c +3 -3
index 17e5658d43..573e7d5928 100644
@@ -195,8 +195,8 @@ static void virtio_vga_base_class_init(ObjectClass *klass, void *data)
 static TypeInfo virtio_vga_base_info = {
     .name          = TYPE_VIRTIO_VGA_BASE,
     .parent        = TYPE_VIRTIO_PCI,
-    .instance_size = sizeof(struct VirtIOVGABase),
-    .class_size    = sizeof(struct VirtIOVGABaseClass),
+    .instance_size = sizeof(VirtIOVGABase),
+    .class_size    = sizeof(VirtIOVGABaseClass),
     .class_init    = virtio_vga_base_class_init,
     .abstract      = true,
 };
@@ -226,7 +226,7 @@ static void virtio_vga_inst_initfn(Object *obj)
 static VirtioPCIDeviceTypeInfo virtio_vga_info = {
     .generic_name  = TYPE_VIRTIO_VGA,
     .parent        = TYPE_VIRTIO_VGA_BASE,
-    .instance_size = sizeof(struct VirtIOVGA),
+    .instance_size = sizeof(VirtIOVGA),
     .instance_init = virtio_vga_inst_initfn,
 };
 
Signature · 1 line
2.26.2
#30 lore raw

[PULL 10/34] Use DECLARE_*CHECKER* macros

In reply to Eduardo Habkost

Generated using:

 $ ./scripts/codeconverter/converter.py -i \
   --pattern=TypeCheckMacro $(git grep -l '' -- '*.[ch]')

Message-Id: <[email protected]>

Message-Id: <[email protected]>
Message-Id: <[email protected]>

---
 chardev/chardev-internal.h               |  3 +-
 hw/9pfs/virtio-9p.h                      |  4 +-
 hw/audio/intel-hda.h                     | 11 ++--
 hw/avr/atmega.h                          |  3 +-
 hw/display/ati_int.h                     |  3 +-
 hw/display/qxl.h                         |  3 +-
 hw/display/virtio-vga.h                  |  8 +--
 hw/i386/amd_iommu.h                      |  4 +-
 hw/misc/tmp105.h                         |  3 +-
 hw/net/fsl_etsec/etsec.h                 |  4 +-
 hw/net/rocker/rocker.h                   |  4 +-
 hw/net/tulip.h                           |  3 +-
 hw/net/vmxnet3_defs.h                    |  3 +-
 hw/ppc/e500-ccsr.h                       |  3 +-
 hw/ppc/e500.h                            |  8 +--
 hw/ppc/mac.h                             |  8 +--
 hw/rdma/vmw/pvrdma.h                     |  3 +-
 hw/s390x/ccw-device.h                    |  7 +--
 hw/s390x/ipl.h                           |  3 +-
 hw/s390x/s390-pci-bus.h                  | 16 +++---
 hw/s390x/virtio-ccw.h                    | 68 +++++++++++-------------
 hw/scsi/mptsas.h                         |  4 +-
 hw/usb/ccid.h                            |  8 +--
 hw/usb/hcd-dwc2.h                        |  8 +--
 hw/usb/hcd-ehci.h                        | 15 +++---
 hw/usb/hcd-ohci.h                        |  3 +-
 hw/usb/hcd-xhci.h                        |  4 +-
 hw/vfio/pci.h                            |  3 +-
 hw/virtio/virtio-mem-pci.h               |  4 +-
 hw/virtio/virtio-pci.h                   | 16 ++----
 hw/virtio/virtio-pmem-pci.h              |  4 +-
 hw/xen/xen_pt.h                          |  4 +-
 include/authz/base.h                     | 11 +---
 include/authz/list.h                     | 11 +---
 include/authz/listfile.h                 | 11 +---
 include/authz/pamacct.h                  | 11 +---
 include/authz/simple.h                   | 11 +---
 include/block/throttle-groups.h          |  3 +-
 include/chardev/char-fd.h                |  3 +-
 include/chardev/char-win.h               |  3 +-
 include/chardev/char.h                   |  7 +--
 include/chardev/spice.h                  |  3 +-
 include/crypto/secret.h                  |  4 +-
 include/crypto/secret_common.h           | 10 +---
 include/crypto/secret_keyring.h          | 11 +---
 include/crypto/tls-cipher-suites.h       |  4 +-
 include/crypto/tlscreds.h                |  4 +-
 include/crypto/tlscredsanon.h            |  4 +-
 include/crypto/tlscredspsk.h             |  4 +-
 include/crypto/tlscredsx509.h            |  4 +-
 include/exec/memory.h                    | 14 ++---
 include/hw/acpi/acpi_dev_interface.h     |  8 +--
 include/hw/acpi/generic_event_device.h   |  4 +-
 include/hw/acpi/vmgenid.h                |  3 +-
 include/hw/adc/stm32f2xx_adc.h           |  4 +-
 include/hw/arm/allwinner-a10.h           |  3 +-
 include/hw/arm/allwinner-h3.h            |  3 +-
 include/hw/arm/armsse.h                  |  7 +--
 include/hw/arm/armv7m.h                  |  6 ++-
 include/hw/arm/aspeed.h                  |  8 +--
 include/hw/arm/aspeed_soc.h              |  7 +--
 include/hw/arm/bcm2835_peripherals.h     |  4 +-
 include/hw/arm/bcm2836.h                 |  7 +--
 include/hw/arm/digic.h                   |  3 +-
 include/hw/arm/exynos4210.h              |  4 +-
 include/hw/arm/fsl-imx25.h               |  3 +-
 include/hw/arm/fsl-imx31.h               |  3 +-
 include/hw/arm/fsl-imx6.h                |  3 +-
 include/hw/arm/fsl-imx6ul.h              |  3 +-
 include/hw/arm/fsl-imx7.h                |  3 +-
 include/hw/arm/linux-boot-if.h           |  6 +--
 include/hw/arm/msf2-soc.h                |  3 +-
 include/hw/arm/nrf51_soc.h               |  4 +-
 include/hw/arm/omap.h                    | 15 +++---
 include/hw/arm/pxa.h                     | 14 ++---
 include/hw/arm/smmu-common.h             |  7 +--
 include/hw/arm/smmuv3.h                  |  7 +--
 include/hw/arm/stm32f205_soc.h           |  4 +-
 include/hw/arm/stm32f405_soc.h           |  4 +-
 include/hw/arm/virt.h                    |  8 +--
 include/hw/arm/xlnx-versal.h             |  3 +-
 include/hw/arm/xlnx-zynqmp.h             |  4 +-
 include/hw/block/flash.h                 |  8 +--
 include/hw/block/swim.h                  |  9 ++--
 include/hw/boards.h                      |  8 +--
 include/hw/char/avr_usart.h              |  4 +-
 include/hw/char/bcm2835_aux.h            |  3 +-
 include/hw/char/cadence_uart.h           |  4 +-
 include/hw/char/cmsdk-apb-uart.h         |  4 +-
 include/hw/char/digic-uart.h             |  4 +-
 include/hw/char/escc.h                   |  3 +-
 include/hw/char/ibex_uart.h              |  4 +-
 include/hw/char/imx_serial.h             |  3 +-
 include/hw/char/nrf51_uart.h             |  3 +-
 include/hw/char/pl011.h                  |  3 +-
 include/hw/char/renesas_sci.h            |  3 +-
 include/hw/char/serial.h                 |  9 ++--
 include/hw/char/stm32f2xx_usart.h        |  4 +-
 include/hw/clock.h                       |  3 +-
 include/hw/core/cpu.h                    |  4 +-
 include/hw/core/generic-loader.h         |  4 +-
 include/hw/core/split-irq.h              |  3 +-
 include/hw/cpu/a15mpcore.h               |  4 +-
 include/hw/cpu/a9mpcore.h                |  4 +-
 include/hw/cpu/arm11mpcore.h             |  4 +-
 include/hw/cpu/cluster.h                 |  4 +-
 include/hw/cpu/core.h                    |  4 +-
 include/hw/display/bcm2835_fb.h          |  3 +-
 include/hw/display/dpcd.h                |  3 +-
 include/hw/display/i2c-ddc.h             |  3 +-
 include/hw/display/macfb.h               | 12 ++---
 include/hw/display/xlnx_dp.h             |  3 +-
 include/hw/dma/bcm2835_dma.h             |  4 +-
 include/hw/dma/i8257.h                   |  4 +-
 include/hw/dma/pl080.h                   |  3 +-
 include/hw/dma/xlnx-zdma.h               |  4 +-
 include/hw/dma/xlnx-zynq-devcfg.h        |  4 +-
 include/hw/dma/xlnx_dpdma.h              |  3 +-
 include/hw/fw-path-provider.h            |  6 +--
 include/hw/gpio/aspeed_gpio.h            |  7 +--
 include/hw/gpio/bcm2835_gpio.h           |  4 +-
 include/hw/gpio/imx_gpio.h               |  3 +-
 include/hw/gpio/nrf51_gpio.h             |  3 +-
 include/hw/hotplug.h                     |  6 +--
 include/hw/hyperv/vmbus-bridge.h         |  3 +-
 include/hw/hyperv/vmbus.h                | 11 ++--
 include/hw/i2c/arm_sbcon_i2c.h           |  4 +-
 include/hw/i2c/aspeed_i2c.h              |  8 +--
 include/hw/i2c/i2c.h                     | 11 ++--
 include/hw/i2c/imx_i2c.h                 |  3 +-
 include/hw/i2c/microbit_i2c.h            |  4 +-
 include/hw/i2c/ppc4xx_i2c.h              |  3 +-
 include/hw/i2c/smbus_slave.h             |  8 +--
 include/hw/i386/apic_internal.h          |  8 +--
 include/hw/i386/ich9.h                   |  4 +-
 include/hw/i386/intel_iommu.h            |  4 +-
 include/hw/i386/ioapic_internal.h        |  8 +--
 include/hw/i386/microvm.h                |  8 +--
 include/hw/i386/pc.h                     |  8 +--
 include/hw/i386/x86-iommu.h              |  8 +--
 include/hw/i386/x86.h                    |  8 +--
 include/hw/ide/ahci.h                    | 11 ++--
 include/hw/ide/internal.h                | 11 ++--
 include/hw/ide/pci.h                     |  3 +-
 include/hw/input/adb.h                   | 10 ++--
 include/hw/input/i8042.h                 |  3 +-
 include/hw/intc/allwinner-a10-pic.h      |  3 +-
 include/hw/intc/arm_gic_common.h         |  8 +--
 include/hw/intc/arm_gicv3_common.h       |  8 +--
 include/hw/intc/arm_gicv3_its_common.h   |  8 +--
 include/hw/intc/armv7m_nvic.h            |  4 +-
 include/hw/intc/aspeed_vic.h             |  3 +-
 include/hw/intc/bcm2835_ic.h             |  3 +-
 include/hw/intc/bcm2836_control.h        |  4 +-
 include/hw/intc/heathrow_pic.h           |  3 +-
 include/hw/intc/ibex_plic.h              |  4 +-
 include/hw/intc/imx_avic.h               |  3 +-
 include/hw/intc/imx_gpcv2.h              |  3 +-
 include/hw/intc/intc.h                   |  6 +--
 include/hw/intc/mips_gic.h               |  3 +-
 include/hw/intc/realview_gic.h           |  4 +-
 include/hw/intc/rx_icu.h                 |  3 +-
 include/hw/intc/xlnx-pmu-iomod-intc.h    |  4 +-
 include/hw/intc/xlnx-zynqmp-ipi.h        |  4 +-
 include/hw/ipack/ipack.h                 | 11 ++--
 include/hw/ipmi/ipmi.h                   | 18 +++----
 include/hw/isa/i8259_internal.h          |  8 +--
 include/hw/isa/isa.h                     | 17 +++---
 include/hw/isa/pc87312.h                 |  3 +-
 include/hw/isa/superio.h                 |  8 +--
 include/hw/m68k/mcf_fec.h                |  3 +-
 include/hw/mem/memory-device.h           |  6 +--
 include/hw/mem/nvdimm.h                  |  6 +--
 include/hw/mem/pc-dimm.h                 |  8 +--
 include/hw/mips/cps.h                    |  3 +-
 include/hw/misc/a9scu.h                  |  3 +-
 include/hw/misc/allwinner-cpucfg.h       |  4 +-
 include/hw/misc/allwinner-h3-ccu.h       |  4 +-
 include/hw/misc/allwinner-h3-dramc.h     |  4 +-
 include/hw/misc/allwinner-h3-sysctrl.h   |  4 +-
 include/hw/misc/allwinner-sid.h          |  4 +-
 include/hw/misc/arm11scu.h               |  3 +-
 include/hw/misc/armsse-cpuid.h           |  3 +-
 include/hw/misc/armsse-mhu.h             |  3 +-
 include/hw/misc/aspeed_scu.h             |  7 +--
 include/hw/misc/aspeed_sdmc.h            |  7 +--
 include/hw/misc/aspeed_xdma.h            |  3 +-
 include/hw/misc/auxbus.h                 | 10 ++--
 include/hw/misc/avr_power.h              |  3 +-
 include/hw/misc/bcm2835_mbox.h           |  4 +-
 include/hw/misc/bcm2835_mphi.h           |  4 +-
 include/hw/misc/bcm2835_property.h       |  4 +-
 include/hw/misc/bcm2835_rng.h            |  4 +-
 include/hw/misc/bcm2835_thermal.h        |  4 +-
 include/hw/misc/grlib_ahb_apb_pnp.h      |  8 +--
 include/hw/misc/imx25_ccm.h              |  3 +-
 include/hw/misc/imx31_ccm.h              |  3 +-
 include/hw/misc/imx6_ccm.h               |  3 +-
 include/hw/misc/imx6_src.h               |  3 +-
 include/hw/misc/imx6ul_ccm.h             |  3 +-
 include/hw/misc/imx7_ccm.h               |  6 ++-
 include/hw/misc/imx7_gpr.h               |  3 +-
 include/hw/misc/imx7_snvs.h              |  3 +-
 include/hw/misc/imx_ccm.h                |  8 +--
 include/hw/misc/imx_rngc.h               |  3 +-
 include/hw/misc/iotkit-secctl.h          |  3 +-
 include/hw/misc/iotkit-sysctl.h          |  4 +-
 include/hw/misc/iotkit-sysinfo.h         |  4 +-
 include/hw/misc/mac_via.h                | 11 ++--
 include/hw/misc/macio/cuda.h             |  7 +--
 include/hw/misc/macio/gpio.h             |  3 +-
 include/hw/misc/macio/macio.h            | 17 +++---
 include/hw/misc/macio/pmu.h              |  7 +--
 include/hw/misc/max111x.h                |  4 +-
 include/hw/misc/mips_cmgcr.h             |  3 +-
 include/hw/misc/mips_cpc.h               |  3 +-
 include/hw/misc/mips_itu.h               |  3 +-
 include/hw/misc/mos6522.h                |  7 +--
 include/hw/misc/mps2-fpgaio.h            |  3 +-
 include/hw/misc/mps2-scc.h               |  3 +-
 include/hw/misc/msf2-sysreg.h            |  3 +-
 include/hw/misc/nrf51_rng.h              |  3 +-
 include/hw/misc/pca9552.h                |  3 +-
 include/hw/misc/stm32f2xx_syscfg.h       |  4 +-
 include/hw/misc/stm32f4xx_exti.h         |  4 +-
 include/hw/misc/stm32f4xx_syscfg.h       |  4 +-
 include/hw/misc/tz-mpc.h                 |  3 +-
 include/hw/misc/tz-msc.h                 |  3 +-
 include/hw/misc/tz-ppc.h                 |  3 +-
 include/hw/misc/unimp.h                  |  4 +-
 include/hw/misc/vmcoreinfo.h             |  3 +-
 include/hw/misc/zynq-xadc.h              |  4 +-
 include/hw/net/allwinner-sun8i-emac.h    |  4 +-
 include/hw/net/allwinner_emac.h          |  3 +-
 include/hw/net/cadence_gem.h             |  3 +-
 include/hw/net/ftgmac100.h               |  6 ++-
 include/hw/net/imx_fec.h                 |  3 +-
 include/hw/net/lance.h                   |  4 +-
 include/hw/net/lasi_82596.h              |  4 +-
 include/hw/net/msf2-emac.h               |  4 +-
 include/hw/nmi.h                         |  6 +--
 include/hw/nubus/mac-nubus-bridge.h      |  4 +-
 include/hw/nubus/nubus.h                 |  7 +--
 include/hw/nvram/fw_cfg.h                | 15 +++---
 include/hw/nvram/nrf51_nvm.h             |  3 +-
 include/hw/or-irq.h                      |  3 +-
 include/hw/pci-bridge/simba.h            |  4 +-
 include/hw/pci-host/designware.h         |  8 +--
 include/hw/pci-host/gpex.h               |  8 +--
 include/hw/pci-host/i440fx.h             |  4 +-
 include/hw/pci-host/pnv_phb3.h           |  9 ++--
 include/hw/pci-host/pnv_phb4.h           | 15 +++---
 include/hw/pci-host/q35.h                |  8 +--
 include/hw/pci-host/sabre.h              |  8 +--
 include/hw/pci-host/spapr.h              |  4 +-
 include/hw/pci-host/uninorth.h           | 20 +++----
 include/hw/pci-host/xilinx-pcie.h        |  8 +--
 include/hw/pci/pci.h                     | 13 ++---
 include/hw/pci/pci_bridge.h              |  3 +-
 include/hw/pci/pci_host.h                |  8 +--
 include/hw/pci/pcie_host.h               |  4 +-
 include/hw/pci/pcie_port.h               | 12 ++---
 include/hw/pcmcia.h                      |  8 +--
 include/hw/platform-bus.h                |  4 +-
 include/hw/ppc/mac_dbdma.h               |  3 +-
 include/hw/ppc/openpic.h                 |  3 +-
 include/hw/ppc/pnv.h                     | 44 +++++++--------
 include/hw/ppc/pnv_core.h                | 12 ++---
 include/hw/ppc/pnv_homer.h               | 13 +++--
 include/hw/ppc/pnv_lpc.h                 | 17 +++---
 include/hw/ppc/pnv_occ.h                 | 13 +++--
 include/hw/ppc/pnv_pnor.h                |  3 +-
 include/hw/ppc/pnv_psi.h                 | 16 +++---
 include/hw/ppc/pnv_xive.h                |  7 +--
 include/hw/ppc/pnv_xscom.h               |  5 +-
 include/hw/ppc/spapr.h                   | 20 +++----
 include/hw/ppc/spapr_cpu_core.h          |  8 +--
 include/hw/ppc/spapr_irq.h               |  6 +--
 include/hw/ppc/spapr_tpm_proxy.h         |  4 +-
 include/hw/ppc/spapr_vio.h               | 11 ++--
 include/hw/ppc/xics.h                    | 23 +++-----
 include/hw/ppc/xive.h                    | 36 +++++--------
 include/hw/qdev-core.h                   | 10 ++--
 include/hw/rdma/rdma.h                   |  6 +--
 include/hw/register.h                    |  3 +-
 include/hw/resettable.h                  |  6 +--
 include/hw/riscv/opentitan.h             |  4 +-
 include/hw/riscv/riscv_hart.h            |  4 +-
 include/hw/riscv/spike.h                 |  4 +-
 include/hw/riscv/virt.h                  |  4 +-
 include/hw/rtc/allwinner-rtc.h           |  8 +--
 include/hw/rtc/aspeed_rtc.h              |  3 +-
 include/hw/rtc/goldfish_rtc.h            |  4 +-
 include/hw/rtc/m48t59.h                  |  6 +--
 include/hw/rtc/mc146818rtc.h             |  3 +-
 include/hw/rtc/pl031.h                   |  3 +-
 include/hw/rtc/xlnx-zynqmp-rtc.h         |  4 +-
 include/hw/rx/rx62n.h                    |  3 +-
 include/hw/s390x/3270-ccw.h              |  8 +--
 include/hw/s390x/ap-device.h             |  4 +-
 include/hw/s390x/css-bridge.h            |  8 +--
 include/hw/s390x/event-facility.h        | 18 ++-----
 include/hw/s390x/s390-ccw.h              |  8 +--
 include/hw/s390x/s390-virtio-ccw.h       |  6 +--
 include/hw/s390x/s390_flic.h             | 16 +++---
 include/hw/s390x/sclp.h                  |  5 +-
 include/hw/s390x/storage-attributes.h    | 16 +++---
 include/hw/s390x/storage-keys.h          | 12 ++---
 include/hw/s390x/tod.h                   |  7 +--
 include/hw/s390x/vfio-ccw.h              |  4 +-
 include/hw/scsi/esp.h                    |  3 +-
 include/hw/scsi/scsi.h                   | 11 ++--
 include/hw/sd/allwinner-sdhost.h         |  8 +--
 include/hw/sd/aspeed_sdhci.h             |  4 +-
 include/hw/sd/bcm2835_sdhost.h           |  4 +-
 include/hw/sd/sd.h                       | 12 ++---
 include/hw/sd/sdhci.h                    |  7 +--
 include/hw/southbridge/piix.h            |  4 +-
 include/hw/sparc/sparc32_dma.h           | 16 +++---
 include/hw/sparc/sun4m_iommu.h           |  3 +-
 include/hw/sparc/sun4u_iommu.h           |  3 +-
 include/hw/ssi/aspeed_smc.h              |  7 +--
 include/hw/ssi/imx_spi.h                 |  3 +-
 include/hw/ssi/mss-spi.h                 |  3 +-
 include/hw/ssi/pl022.h                   |  3 +-
 include/hw/ssi/ssi.h                     |  8 +--
 include/hw/ssi/stm32f2xx_spi.h           |  4 +-
 include/hw/ssi/xilinx_spips.h            | 20 +++----
 include/hw/stream.h                      |  6 +--
 include/hw/sysbus.h                      | 11 ++--
 include/hw/timer/a9gtimer.h              |  3 +-
 include/hw/timer/allwinner-a10-pit.h     |  3 +-
 include/hw/timer/arm_mptimer.h           |  4 +-
 include/hw/timer/armv7m_systick.h        |  3 +-
 include/hw/timer/aspeed_timer.h          |  8 +--
 include/hw/timer/avr_timer16.h           |  4 +-
 include/hw/timer/bcm2835_systmr.h        |  4 +-
 include/hw/timer/cmsdk-apb-dualtimer.h   |  4 +-
 include/hw/timer/cmsdk-apb-timer.h       |  4 +-
 include/hw/timer/digic-timer.h           |  3 +-
 include/hw/timer/i8254.h                 |  8 +--
 include/hw/timer/imx_epit.h              |  3 +-
 include/hw/timer/imx_gpt.h               |  3 +-
 include/hw/timer/mss-timer.h             |  4 +-
 include/hw/timer/nrf51_timer.h           |  3 +-
 include/hw/timer/renesas_cmt.h           |  3 +-
 include/hw/timer/renesas_tmr.h           |  3 +-
 include/hw/timer/stm32f2xx_timer.h       |  4 +-
 include/hw/usb.h                         | 11 ++--
 include/hw/usb/chipidea.h                |  3 +-
 include/hw/usb/imx-usb-phy.h             |  3 +-
 include/hw/vfio/vfio-amd-xgbe.h          | 10 +---
 include/hw/vfio/vfio-calxeda-xgmac.h     | 10 +---
 include/hw/vfio/vfio-platform.h          |  8 +--
 include/hw/virtio/vhost-scsi-common.h    |  4 +-
 include/hw/virtio/vhost-scsi.h           |  4 +-
 include/hw/virtio/vhost-user-blk.h       |  4 +-
 include/hw/virtio/vhost-user-fs.h        |  4 +-
 include/hw/virtio/vhost-user-scsi.h      |  4 +-
 include/hw/virtio/vhost-user-vsock.h     |  4 +-
 include/hw/virtio/vhost-vsock-common.h   |  4 +-
 include/hw/virtio/vhost-vsock.h          |  4 +-
 include/hw/virtio/virtio-balloon.h       |  4 +-
 include/hw/virtio/virtio-blk.h           |  4 +-
 include/hw/virtio/virtio-bus.h           |  7 +--
 include/hw/virtio/virtio-crypto.h        |  4 +-
 include/hw/virtio/virtio-gpu-pci.h       |  4 +-
 include/hw/virtio/virtio-gpu.h           | 16 +++---
 include/hw/virtio/virtio-input.h         | 20 +++----
 include/hw/virtio/virtio-iommu.h         |  4 +-
 include/hw/virtio/virtio-mem.h           |  8 +--
 include/hw/virtio/virtio-mmio.h          |  4 +-
 include/hw/virtio/virtio-net.h           |  4 +-
 include/hw/virtio/virtio-pmem.h          |  8 +--
 include/hw/virtio/virtio-rng.h           |  4 +-
 include/hw/virtio/virtio-scsi.h          |  8 +--
 include/hw/virtio/virtio-serial.h        | 16 +++---
 include/hw/virtio/virtio.h               |  8 +--
 include/hw/vmstate-if.h                  |  6 +--
 include/hw/watchdog/cmsdk-apb-watchdog.h |  4 +-
 include/hw/watchdog/wdt_aspeed.h         |  8 +--
 include/hw/watchdog/wdt_diag288.h        |  8 +--
 include/hw/watchdog/wdt_imx2.h           |  3 +-
 include/hw/xen/xen-block.h               | 16 +++---
 include/hw/xen/xen-bus.h                 | 16 ++----
 include/hw/xen/xen-legacy-backend.h      |  4 +-
 include/io/channel-buffer.h              |  4 +-
 include/io/channel-command.h             |  4 +-
 include/io/channel-file.h                |  4 +-
 include/io/channel-socket.h              |  4 +-
 include/io/channel-tls.h                 |  4 +-
 include/io/channel-websock.h             |  4 +-
 include/io/channel.h                     |  8 +--
 include/io/dns-resolver.h                |  8 +--
 include/io/net-listener.h                |  8 +--
 include/net/can_emu.h                    |  4 +-
 include/net/can_host.h                   |  8 +--
 include/net/filter.h                     |  8 +--
 include/qom/object_interfaces.h          |  8 +--
 include/scsi/pr-manager.h                |  8 +--
 include/sysemu/cryptodev.h               | 11 +---
 include/sysemu/hostmem.h                 |  8 +--
 include/sysemu/hvf.h                     |  4 +-
 include/sysemu/iothread.h                |  4 +-
 include/sysemu/kvm.h                     |  4 +-
 include/sysemu/rng-random.h              |  3 +-
 include/sysemu/rng.h                     |  8 +--
 include/sysemu/tpm.h                     |  6 +--
 include/sysemu/tpm_backend.h             |  8 +--
 include/sysemu/vhost-user-backend.h      |  8 +--
 include/ui/console.h                     |  8 +--
 migration/migration.h                    |  8 +--
 target/alpha/cpu-qom.h                   |  8 +--
 target/arm/cpu-qom.h                     | 14 ++---
 target/arm/idau.h                        |  6 +--
 target/avr/cpu-qom.h                     |  8 +--
 target/cris/cpu-qom.h                    |  8 +--
 target/hppa/cpu-qom.h                    |  8 +--
 target/i386/cpu-qom.h                    |  8 +--
 target/lm32/cpu-qom.h                    |  8 +--
 target/m68k/cpu-qom.h                    |  8 +--
 target/microblaze/cpu-qom.h              |  8 +--
 target/mips/cpu-qom.h                    |  8 +--
 target/moxie/cpu.h                       |  8 +--
 target/nios2/cpu.h                       |  8 +--
 target/openrisc/cpu.h                    |  8 +--
 target/ppc/cpu-qom.h                     |  8 +--
 target/ppc/cpu.h                         | 10 +---
 target/riscv/cpu.h                       |  8 +--
 target/rx/cpu-qom.h                      |  8 +--
 target/s390x/cpu-qom.h                   |  8 +--
 target/sh4/cpu-qom.h                     |  8 +--
 target/sparc/cpu-qom.h                   |  8 +--
 target/tilegx/cpu.h                      |  8 +--
 target/tricore/cpu-qom.h                 |  8 +--
 target/unicore32/cpu-qom.h               |  8 +--
 target/xtensa/cpu-qom.h                  |  8 +--
 accel/tcg/tcg-all.c                      |  4 +-
 backends/cryptodev-builtin.c             |  5 +-
 backends/cryptodev-vhost-user.c          |  5 +-
 backends/dbus-vmstate.c                  |  8 +--
 backends/hostmem-file.c                  |  4 +-
 backends/hostmem-memfd.c                 |  4 +-
 backends/rng-builtin.c                   |  3 +-
 backends/rng-egd.c                       |  3 +-
 backends/tpm/tpm_emulator.c              |  4 +-
 backends/tpm/tpm_passthrough.c           |  4 +-
 chardev/baum.c                           |  3 +-
 chardev/char-parallel.c                  |  6 +--
 chardev/char-pty.c                       |  3 +-
 chardev/char-ringbuf.c                   |  4 +-
 chardev/char-socket.c                    |  4 +-
 chardev/char-udp.c                       |  3 +-
 chardev/char-win-stdio.c                 |  4 +-
 chardev/msmouse.c                        |  4 +-
 chardev/testdev.c                        |  4 +-
 chardev/wctablet.c                       |  4 +-
 hw/acpi/piix4.c                          |  4 +-
 hw/alpha/typhoon.c                       |  4 +-
 hw/arm/collie.c                          |  4 +-
 hw/arm/highbank.c                        |  4 +-
 hw/arm/integratorcp.c                    | 12 ++---
 hw/arm/microbit.c                        |  4 +-
 hw/arm/mps2-tz.c                         |  8 +--
 hw/arm/mps2.c                            |  8 +--
 hw/arm/musca.c                           |  8 +--
 hw/arm/musicpal.c                        | 32 +++++------
 hw/arm/palm.c                            |  4 +-
 hw/arm/pxa2xx.c                          | 12 ++---
 hw/arm/pxa2xx_gpio.c                     |  4 +-
 hw/arm/pxa2xx_pic.c                      |  4 +-
 hw/arm/raspi.c                           |  8 +--
 hw/arm/sbsa-ref.c                        |  4 +-
 hw/arm/spitz.c                           | 25 +++++----
 hw/arm/stellaris.c                       | 12 ++---
 hw/arm/strongarm.c                       | 24 ++++-----
 hw/arm/tosa.c                            |  7 +--
 hw/arm/versatilepb.c                     |  4 +-
 hw/arm/vexpress.c                        |  8 +--
 hw/arm/xilinx_zynq.c                     |  4 +-
 hw/arm/xlnx-versal-virt.c                |  4 +-
 hw/arm/xlnx-zcu102.c                     |  4 +-
 hw/arm/z2.c                              |  6 ++-
 hw/audio/ac97.c                          |  4 +-
 hw/audio/adlib.c                         |  3 +-
 hw/audio/cs4231.c                        |  4 +-
 hw/audio/cs4231a.c                       |  3 +-
 hw/audio/es1370.c                        |  4 +-
 hw/audio/gus.c                           |  3 +-
 hw/audio/hda-codec.c                     |  3 +-
 hw/audio/intel-hda.c                     |  4 +-
 hw/audio/marvell_88w8618.c               |  4 +-
 hw/audio/milkymist-ac97.c                |  4 +-
 hw/audio/pcspk.c                         |  3 +-
 hw/audio/pl041.c                         |  3 +-
 hw/audio/sb16.c                          |  3 +-
 hw/audio/wm8750.c                        |  3 +-
 hw/avr/arduino.c                         |  8 +--
 hw/avr/atmega.c                          |  6 +--
 hw/block/fdc.c                           | 13 +++--
 hw/block/m25p80.c                        |  8 +--
 hw/block/nand.c                          |  4 +-
 hw/block/onenand.c                       |  3 +-
 hw/char/debugcon.c                       |  4 +-
 hw/char/etraxfs_ser.c                    |  4 +-
 hw/char/exynos4210_uart.c                |  4 +-
 hw/char/grlib_apbuart.c                  |  4 +-
 hw/char/ipoctal232.c                     |  4 +-
 hw/char/lm32_juart.c                     |  3 +-
 hw/char/lm32_uart.c                      |  3 +-
 hw/char/mcf_uart.c                       |  3 +-
 hw/char/milkymist-uart.c                 |  4 +-
 hw/char/parallel.c                       |  4 +-
 hw/char/sclpconsole-lm.c                 |  4 +-
 hw/char/sclpconsole.c                    |  4 +-
 hw/char/serial-isa.c                     |  3 +-
 hw/char/serial-pci.c                     |  3 +-
 hw/char/spapr_vty.c                      |  4 +-
 hw/char/terminal3270.c                   |  4 +-
 hw/char/virtio-console.c                 |  4 +-
 hw/char/xilinx_uartlite.c                |  4 +-
 hw/core/irq.c                            |  3 +-
 hw/cpu/realview_mpcore.c                 |  4 +-
 hw/display/ads7846.c                     |  3 +-
 hw/display/artist.c                      |  3 +-
 hw/display/bochs-display.c               |  4 +-
 hw/display/cg3.c                         |  3 +-
 hw/display/cirrus_vga.c                  |  4 +-
 hw/display/cirrus_vga_isa.c              |  4 +-
 hw/display/exynos4210_fimd.c             |  4 +-
 hw/display/g364fb.c                      |  3 +-
 hw/display/jazz_led.c                    |  3 +-
 hw/display/milkymist-tmu2.c              |  4 +-
 hw/display/milkymist-vgafb.c             |  4 +-
 hw/display/next-fb.c                     |  3 +-
 hw/display/pl110.c                       |  3 +-
 hw/display/ramfb-standalone.c            |  3 +-
 hw/display/sii9022.c                     |  3 +-
 hw/display/sm501.c                       |  7 +--
 hw/display/ssd0303.c                     |  3 +-
 hw/display/ssd0323.c                     |  3 +-
 hw/display/tcx.c                         |  3 +-
 hw/display/vga-isa.c                     |  3 +-
 hw/display/vga-pci.c                     |  3 +-
 hw/display/vhost-user-gpu-pci.c          |  4 +-
 hw/display/vhost-user-vga.c              |  4 +-
 hw/display/virtio-gpu-pci.c              |  4 +-
 hw/display/virtio-vga.c                  |  4 +-
 hw/display/vmware_vga.c                  |  4 +-
 hw/dma/i82374.c                          |  3 +-
 hw/dma/pl330.c                           |  3 +-
 hw/dma/puv3_dma.c                        |  3 +-
 hw/dma/pxa2xx_dma.c                      |  3 +-
 hw/dma/rc4030.c                          |  4 +-
 hw/dma/xilinx_axidma.c                   | 14 +++--
 hw/gpio/gpio_key.c                       |  3 +-
 hw/gpio/max7310.c                        |  3 +-
 hw/gpio/mpc8xxx.c                        |  3 +-
 hw/gpio/pl061.c                          |  3 +-
 hw/gpio/puv3_gpio.c                      |  3 +-
 hw/gpio/zaurus.c                         |  3 +-
 hw/hppa/dino.c                           |  4 +-
 hw/hppa/lasi.c                           |  4 +-
 hw/hyperv/hyperv.c                       |  3 +-
 hw/hyperv/hyperv_testdev.c               |  4 +-
 hw/i2c/bitbang_i2c.c                     |  3 +-
 hw/i2c/exynos4210_i2c.c                  |  4 +-
 hw/i2c/mpc_i2c.c                         |  4 +-
 hw/i2c/smbus_eeprom.c                    |  4 +-
 hw/i2c/smbus_ich9.c                      |  4 +-
 hw/i2c/versatile_i2c.c                   |  4 +-
 hw/i386/kvm/clock.c                      |  3 +-
 hw/i386/kvm/i8254.c                      |  7 +--
 hw/i386/kvm/i8259.c                      |  6 +--
 hw/i386/kvmvapic.c                       |  3 +-
 hw/i386/port92.c                         |  3 +-
 hw/i386/vmmouse.c                        |  3 +-
 hw/i386/vmport.c                         |  3 +-
 hw/i386/xen/xen_platform.c               |  4 +-
 hw/i386/xen/xen_pvdevice.c               |  4 +-
 hw/ide/isa.c                             |  3 +-
 hw/ide/microdrive.c                      |  3 +-
 hw/ide/mmio.c                            |  3 +-
 hw/ide/sii3112.c                         |  2 +-
 hw/input/adb-kbd.c                       |  7 +--
 hw/input/adb-mouse.c                     |  7 +--
 hw/input/lm832x.c                        |  3 +-
 hw/input/milkymist-softusb.c             |  4 +-
 hw/input/pl050.c                         |  3 +-
 hw/intc/arm_gicv2m.c                     |  3 +-
 hw/intc/etraxfs_pic.c                    |  4 +-
 hw/intc/exynos4210_combiner.c            |  4 +-
 hw/intc/exynos4210_gic.c                 |  8 +--
 hw/intc/grlib_irqmp.c                    |  3 +-
 hw/intc/i8259.c                          |  4 +-
 hw/intc/lm32_pic.c                       |  3 +-
 hw/intc/loongson_liointc.c               |  4 +-
 hw/intc/nios2_iic.c                      |  4 +-
 hw/intc/ompic.c                          |  3 +-
 hw/intc/openpic_kvm.c                    |  4 +-
 hw/intc/pl190.c                          |  3 +-
 hw/intc/puv3_intc.c                      |  3 +-
 hw/intc/s390_flic_kvm.c                  |  6 +--
 hw/intc/slavio_intctl.c                  |  4 +-
 hw/intc/xilinx_intc.c                    |  3 +-
 hw/ipack/tpci200.c                       |  4 +-
 hw/ipmi/ipmi_bmc_extern.c                |  4 +-
 hw/ipmi/isa_ipmi_bt.c                    |  4 +-
 hw/ipmi/isa_ipmi_kcs.c                   |  4 +-
 hw/ipmi/pci_ipmi_bt.c                    |  4 +-
 hw/ipmi/pci_ipmi_kcs.c                   |  4 +-
 hw/ipmi/smbus_ipmi.c                     |  3 +-
 hw/isa/i82378.c                          |  4 +-
 hw/isa/piix4.c                           |  4 +-
 hw/isa/vt82c686.c                        | 16 +++---
 hw/m68k/mcf_intc.c                       |  3 +-
 hw/m68k/next-cube.c                      |  3 +-
 hw/m68k/next-kbd.c                       |  3 +-
 hw/microblaze/xlnx-zynqmp-pmu.c          |  4 +-
 hw/mips/boston.c                         |  3 +-
 hw/mips/gt64xxx_pci.c                    |  4 +-
 hw/mips/malta.c                          |  3 +-
 hw/misc/applesmc.c                       |  3 +-
 hw/misc/arm_integrator_debug.c           |  4 +-
 hw/misc/arm_l2x0.c                       |  3 +-
 hw/misc/arm_sysctl.c                     |  4 +-
 hw/misc/debugexit.c                      |  4 +-
 hw/misc/eccmemctl.c                      |  3 +-
 hw/misc/edu.c                            |  3 +-
 hw/misc/empty_slot.c                     |  3 +-
 hw/misc/exynos4210_clk.c                 |  4 +-
 hw/misc/exynos4210_pmu.c                 |  4 +-
 hw/misc/exynos4210_rng.c                 |  4 +-
 hw/misc/ivshmem.c                        | 16 +++---
 hw/misc/milkymist-hpdmc.c                |  4 +-
 hw/misc/milkymist-pfpu.c                 |  4 +-
 hw/misc/mst_fpga.c                       |  4 +-
 hw/misc/pc-testdev.c                     |  4 +-
 hw/misc/pca9552.c                        |  6 +--
 hw/misc/pci-testdev.c                    |  4 +-
 hw/misc/puv3_pm.c                        |  3 +-
 hw/misc/pvpanic.c                        |  4 +-
 hw/misc/sga.c                            |  3 +-
 hw/misc/slavio_misc.c                    |  6 ++-
 hw/misc/tmp421.c                         |  7 +--
 hw/misc/zynq_slcr.c                      |  3 +-
 hw/net/can/can_kvaser_pci.c              |  4 +-
 hw/net/can/can_mioe3680_pci.c            |  4 +-
 hw/net/can/can_pcm3680_pci.c             |  4 +-
 hw/net/dp8393x.c                         |  3 +-
 hw/net/e1000.c                           |  8 +--
 hw/net/e1000e.c                          |  3 +-
 hw/net/etraxfs_eth.c                     |  4 +-
 hw/net/lan9118.c                         |  3 +-
 hw/net/milkymist-minimac2.c              |  4 +-
 hw/net/mipsnet.c                         |  3 +-
 hw/net/ne2000-isa.c                      |  3 +-
 hw/net/opencores_eth.c                   |  3 +-
 hw/net/pcnet-pci.c                       |  4 +-
 hw/net/rtl8139.c                         |  4 +-
 hw/net/smc91c111.c                       |  3 +-
 hw/net/spapr_llan.c                      |  4 +-
 hw/net/stellaris_enet.c                  |  4 +-
 hw/net/sungem.c                          |  3 +-
 hw/net/sunhme.c                          |  3 +-
 hw/net/vmxnet3.c                         |  6 +--
 hw/net/xgmac.c                           |  3 +-
 hw/net/xilinx_axienet.c                  | 14 +++--
 hw/net/xilinx_ethlite.c                  |  4 +-
 hw/nvram/ds1225y.c                       |  3 +-
 hw/nvram/eeprom_at24c.c                  |  3 +-
 hw/nvram/spapr_nvram.c                   |  4 +-
 hw/pci-bridge/dec.c                      |  3 +-
 hw/pci-bridge/gen_pcie_root_port.c       |  4 +-
 hw/pci-bridge/pci_bridge_dev.c           |  4 +-
 hw/pci-bridge/pci_expander_bridge.c      | 12 +++--
 hw/pci-bridge/pcie_pci_bridge.c          |  4 +-
 hw/pci-host/bonito.c                     |  8 +--
 hw/pci-host/grackle.c                    |  4 +-
 hw/pci-host/i440fx.c                     |  4 +-
 hw/pci-host/pnv_phb3.c                   |  4 +-
 hw/pci-host/pnv_phb4.c                   |  4 +-
 hw/pci-host/ppce500.c                    |  8 +--
 hw/pci-host/prep.c                       |  8 +--
 hw/pci-host/versatile.c                  |  8 +--
 hw/ppc/mpc8544_guts.c                    |  3 +-
 hw/ppc/ppc440_pcix.c                     |  4 +-
 hw/ppc/ppc440_uc.c                       |  4 +-
 hw/ppc/ppc4xx_pci.c                      |  4 +-
 hw/ppc/ppce500_spin.c                    |  3 +-
 hw/ppc/prep_systemio.c                   |  4 +-
 hw/ppc/rs6000_mc.c                       |  4 +-
 hw/ppc/spapr_rng.c                       |  4 +-
 hw/rtc/ds1338.c                          |  3 +-
 hw/rtc/exynos4210_rtc.c                  |  4 +-
 hw/rtc/m41t80.c                          |  3 +-
 hw/rtc/m48t59-isa.c                      |  8 +--
 hw/rtc/m48t59.c                          |  8 +--
 hw/rtc/sun4v-rtc.c                       |  3 +-
 hw/rtc/twl92230.c                        |  3 +-
 hw/rx/rx-gdbsim.c                        |  8 +--
 hw/rx/rx62n.c                            |  6 +--
 hw/scsi/esp-pci.c                        |  8 +--
 hw/scsi/lsi53c895a.c                     |  4 +-
 hw/scsi/megasas.c                        |  8 +--
 hw/scsi/scsi-disk.c                      |  8 +--
 hw/scsi/spapr_vscsi.c                    |  4 +-
 hw/scsi/vmw_pvscsi.c                     |  7 +--
 hw/sd/milkymist-memcard.c                |  4 +-
 hw/sd/pl181.c                            |  3 +-
 hw/sd/ssi-sd.c                           |  3 +-
 hw/sh4/sh_pci.c                          |  4 +-
 hw/sparc/sun4m.c                         | 13 +++--
 hw/sparc64/sun4u.c                       | 12 +++--
 hw/ssi/ssi.c                             |  3 +-
 hw/ssi/xilinx_spi.c                      |  3 +-
 hw/timer/altera_timer.c                  |  4 +-
 hw/timer/arm_timer.c                     |  7 +--
 hw/timer/cadence_ttc.c                   |  4 +-
 hw/timer/etraxfs_timer.c                 |  4 +-
 hw/timer/exynos4210_mct.c                |  4 +-
 hw/timer/exynos4210_pwm.c                |  4 +-
 hw/timer/grlib_gptimer.c                 |  4 +-
 hw/timer/hpet.c                          |  3 +-
 hw/timer/i8254.c                         |  4 +-
 hw/timer/lm32_timer.c                    |  3 +-
 hw/timer/milkymist-sysctl.c              |  4 +-
 hw/timer/puv3_ost.c                      |  3 +-
 hw/timer/pxa2xx_timer.c                  |  4 +-
 hw/timer/slavio_timer.c                  |  4 +-
 hw/timer/xilinx_timer.c                  |  4 +-
 hw/tpm/tpm_crb.c                         |  3 +-
 hw/tpm/tpm_spapr.c                       |  4 +-
 hw/tpm/tpm_tis_isa.c                     |  3 +-
 hw/tpm/tpm_tis_sysbus.c                  |  3 +-
 hw/usb/ccid-card-emulated.c              |  4 +-
 hw/usb/ccid-card-passthru.c              |  4 +-
 hw/usb/dev-audio.c                       |  3 +-
 hw/usb/dev-hid.c                         |  3 +-
 hw/usb/dev-hub.c                         |  3 +-
 hw/usb/dev-mtp.c                         |  3 +-
 hw/usb/dev-network.c                     |  3 +-
 hw/usb/dev-serial.c                      |  3 +-
 hw/usb/dev-smartcard-reader.c            |  6 ++-
 hw/usb/dev-storage.c                     |  3 +-
 hw/usb/dev-uas.c                         |  3 +-
 hw/usb/dev-wacom.c                       |  3 +-
 hw/usb/hcd-ohci-pci.c                    |  3 +-
 hw/usb/hcd-uhci.c                        |  3 +-
 hw/usb/host-libusb.c                     |  4 +-
 hw/usb/redirect.c                        |  3 +-
 hw/usb/tusb6010.c                        |  3 +-
 hw/vfio/ap.c                             |  4 +-
 hw/virtio/vhost-scsi-pci.c               |  4 +-
 hw/virtio/vhost-user-blk-pci.c           |  4 +-
 hw/virtio/vhost-user-fs-pci.c            |  4 +-
 hw/virtio/vhost-user-input-pci.c         |  4 +-
 hw/virtio/vhost-user-scsi-pci.c          |  4 +-
 hw/virtio/vhost-user-vsock-pci.c         |  4 +-
 hw/virtio/vhost-vsock-pci.c              |  4 +-
 hw/virtio/virtio-9p-pci.c                |  4 +-
 hw/virtio/virtio-balloon-pci.c           |  4 +-
 hw/virtio/virtio-blk-pci.c               |  4 +-
 hw/virtio/virtio-crypto-pci.c            |  4 +-
 hw/virtio/virtio-input-host-pci.c        |  4 +-
 hw/virtio/virtio-input-pci.c             |  8 +--
 hw/virtio/virtio-iommu-pci.c             |  4 +-
 hw/virtio/virtio-net-pci.c               |  4 +-
 hw/virtio/virtio-rng-pci.c               |  4 +-
 hw/virtio/virtio-scsi-pci.c              |  4 +-
 hw/virtio/virtio-serial-pci.c            |  4 +-
 hw/watchdog/wdt_i6300esb.c               |  4 +-
 hw/watchdog/wdt_ib700.c                  |  3 +-
 iothread.c                               |  6 +--
 migration/rdma.c                         |  4 +-
 net/can/can_socketcan.c                  |  4 +-
 net/colo-compare.c                       |  4 +-
 net/dump.c                               |  4 +-
 net/filter-buffer.c                      |  4 +-
 net/filter-mirror.c                      |  8 +--
 net/filter-replay.c                      |  4 +-
 net/filter-rewriter.c                    |  4 +-
 scsi/pr-manager-helper.c                 |  5 +-
 target/i386/sev.c                        |  4 +-
 tests/check-qom-interface.c              |  6 +--
 tests/check-qom-proplist.c               | 16 +++---
 tests/test-qdev-global-props.c           |  8 +--
 ui/console.c                             |  3 +-
 ui/gtk.c                                 |  3 +-
 ui/input-barrier.c                       |  8 +--
 ui/input-linux.c                         |  8 +--
 ui/spice-app.c                           |  3 +-
 792 files changed, 1991 insertions(+), 2429 deletions(-)
chardev/chardev-internal.h +2 -1
index 2926a326e0..aba0240759 100644
@@ -54,7 +54,8 @@ struct MuxChardev {
 };
 typedef struct MuxChardev MuxChardev;
 
-#define MUX_CHARDEV(obj) OBJECT_CHECK(MuxChardev, (obj), TYPE_CHARDEV_MUX)
+DECLARE_INSTANCE_CHECKER(MuxChardev, MUX_CHARDEV,
+                         TYPE_CHARDEV_MUX)
 #define CHARDEV_IS_MUX(chr)                             \
     object_dynamic_cast(OBJECT(chr), TYPE_CHARDEV_MUX)
 
hw/9pfs/virtio-9p.h +2 -2
index 6dd945ecda..ff70c5a971 100644
@@ -16,7 +16,7 @@ struct V9fsVirtioState {
 typedef struct V9fsVirtioState V9fsVirtioState;
 
 #define TYPE_VIRTIO_9P "virtio-9p-device"
-#define VIRTIO_9P(obj) \
-        OBJECT_CHECK(V9fsVirtioState, (obj), TYPE_VIRTIO_9P)
+DECLARE_INSTANCE_CHECKER(V9fsVirtioState, VIRTIO_9P,
+                         TYPE_VIRTIO_9P)
 
 #endif
hw/audio/intel-hda.h +4 -7
index 44a2897fff..813a7a357d 100644
@@ -10,16 +10,13 @@
 #define TYPE_HDA_CODEC_DEVICE "hda-codec"
 typedef struct HDACodecDevice HDACodecDevice;
 typedef struct HDACodecDeviceClass HDACodecDeviceClass;
-#define HDA_CODEC_DEVICE(obj) \
-     OBJECT_CHECK(HDACodecDevice, (obj), TYPE_HDA_CODEC_DEVICE)
-#define HDA_CODEC_DEVICE_CLASS(klass) \
-     OBJECT_CLASS_CHECK(HDACodecDeviceClass, (klass), TYPE_HDA_CODEC_DEVICE)
-#define HDA_CODEC_DEVICE_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(HDACodecDeviceClass, (obj), TYPE_HDA_CODEC_DEVICE)
+DECLARE_OBJ_CHECKERS(HDACodecDevice, HDACodecDeviceClass,
+                     HDA_CODEC_DEVICE, TYPE_HDA_CODEC_DEVICE)
 
 #define TYPE_HDA_BUS "HDA"
 typedef struct HDACodecBus HDACodecBus;
-#define HDA_BUS(obj) OBJECT_CHECK(HDACodecBus, (obj), TYPE_HDA_BUS)
+DECLARE_INSTANCE_CHECKER(HDACodecBus, HDA_BUS,
+                         TYPE_HDA_BUS)
 
 
 typedef void (*hda_codec_response_func)(HDACodecDevice *dev,
hw/avr/atmega.h +2 -1
index 2c46ecb904..a99ee15c7e 100644
@@ -24,7 +24,8 @@
 #define TYPE_ATMEGA2560_MCU "ATmega2560"
 
 typedef struct AtmegaMcuState AtmegaMcuState;
-#define ATMEGA_MCU(obj) OBJECT_CHECK(AtmegaMcuState, (obj), TYPE_ATMEGA_MCU)
+DECLARE_INSTANCE_CHECKER(AtmegaMcuState, ATMEGA_MCU,
+                         TYPE_ATMEGA_MCU)
 
 #define POWER_MAX 2
 #define USART_MAX 4
hw/display/ati_int.h +2 -1
index 2a8a3306da..714005447d 100644
@@ -31,7 +31,8 @@
 
 #define TYPE_ATI_VGA "ati-vga"
 typedef struct ATIVGAState ATIVGAState;
-#define ATI_VGA(obj) OBJECT_CHECK(ATIVGAState, (obj), TYPE_ATI_VGA)
+DECLARE_INSTANCE_CHECKER(ATIVGAState, ATI_VGA,
+                         TYPE_ATI_VGA)
 
 typedef struct ATIVGARegs {
     uint32_t mm_index;
hw/display/qxl.h +2 -1
index 4ecb6b2934..714cd01b63 100644
@@ -131,7 +131,8 @@ struct PCIQXLDevice {
 typedef struct PCIQXLDevice PCIQXLDevice;
 
 #define TYPE_PCI_QXL "pci-qxl"
-#define PCI_QXL(obj) OBJECT_CHECK(PCIQXLDevice, (obj), TYPE_PCI_QXL)
+DECLARE_INSTANCE_CHECKER(PCIQXLDevice, PCI_QXL,
+                         TYPE_PCI_QXL)
 
 #define PANIC_ON(x) if ((x)) {                         \
     printf("%s: PANIC %s failed\n", __func__, #x); \
hw/display/virtio-vga.h +2 -6
index 2d3b765bf9..19f8af7356 100644
@@ -11,12 +11,8 @@
 #define TYPE_VIRTIO_VGA_BASE "virtio-vga-base"
 typedef struct VirtIOVGABase VirtIOVGABase;
 typedef struct VirtIOVGABaseClass VirtIOVGABaseClass;
-#define VIRTIO_VGA_BASE(obj)                                \
-    OBJECT_CHECK(VirtIOVGABase, (obj), TYPE_VIRTIO_VGA_BASE)
-#define VIRTIO_VGA_BASE_GET_CLASS(obj)                      \
-    OBJECT_GET_CLASS(VirtIOVGABaseClass, obj, TYPE_VIRTIO_VGA_BASE)
-#define VIRTIO_VGA_BASE_CLASS(klass)                        \
-    OBJECT_CLASS_CHECK(VirtIOVGABaseClass, klass, TYPE_VIRTIO_VGA_BASE)
+DECLARE_OBJ_CHECKERS(VirtIOVGABase, VirtIOVGABaseClass,
+                     VIRTIO_VGA_BASE, TYPE_VIRTIO_VGA_BASE)
 
 struct VirtIOVGABase {
     VirtIOPCIProxy parent_obj;
hw/i386/amd_iommu.h +2 -2
index 85860c36dd..fa5feb183c 100644
@@ -298,8 +298,8 @@ struct irte_ga {
 
 #define TYPE_AMD_IOMMU_DEVICE "amd-iommu"
 typedef struct AMDVIState AMDVIState;
-#define AMD_IOMMU_DEVICE(obj)\
-    OBJECT_CHECK(AMDVIState, (obj), TYPE_AMD_IOMMU_DEVICE)
+DECLARE_INSTANCE_CHECKER(AMDVIState, AMD_IOMMU_DEVICE,
+                         TYPE_AMD_IOMMU_DEVICE)
 
 #define TYPE_AMD_IOMMU_PCI "AMDVI-PCI"
 
hw/misc/tmp105.h +2 -1
index 634bb4a0d6..7ee8a496ff 100644
@@ -20,7 +20,8 @@
 
 #define TYPE_TMP105 "tmp105"
 typedef struct TMP105State TMP105State;
-#define TMP105(obj) OBJECT_CHECK(TMP105State, (obj), TYPE_TMP105)
+DECLARE_INSTANCE_CHECKER(TMP105State, TMP105,
+                         TYPE_TMP105)
 
 /**
  * TMP105State:
hw/net/fsl_etsec/etsec.h +2 -2
index 132a87b1ba..0c929d9afd 100644
@@ -150,8 +150,8 @@ struct eTSEC {
 typedef struct eTSEC eTSEC;
 
 #define TYPE_ETSEC_COMMON "eTSEC"
-#define ETSEC_COMMON(obj) \
-     OBJECT_CHECK(eTSEC, (obj), TYPE_ETSEC_COMMON)
+DECLARE_INSTANCE_CHECKER(eTSEC, ETSEC_COMMON,
+                         TYPE_ETSEC_COMMON)
 
 #define eTSEC_TRANSMIT 1
 #define eTSEC_RECEIVE  2
hw/net/rocker/rocker.h +2 -2
index 0dd49d5f41..941c932265 100644
@@ -73,8 +73,8 @@ typedef struct desc_ring DescRing;
 
 #define TYPE_ROCKER "rocker"
 typedef struct rocker Rocker;
-#define ROCKER(obj) \
-    OBJECT_CHECK(Rocker, (obj), TYPE_ROCKER)
+DECLARE_INSTANCE_CHECKER(Rocker, ROCKER,
+                         TYPE_ROCKER)
 
 Rocker *rocker_find(const char *name);
 uint32_t rocker_fp_ports(Rocker *r);
hw/net/tulip.h +2 -1
index 5fe4aee87d..87e3ab79bc 100644
@@ -7,7 +7,8 @@
 
 #define TYPE_TULIP "tulip"
 typedef struct TULIPState TULIPState;
-#define TULIP(obj) OBJECT_CHECK(TULIPState, (obj), TYPE_TULIP)
+DECLARE_INSTANCE_CHECKER(TULIPState, TULIP,
+                         TYPE_TULIP)
 
 #define CSR(_x) ((_x) << 3)
 
hw/net/vmxnet3_defs.h +2 -1
index 1df1e4c3a6..71440509ca 100644
@@ -23,7 +23,8 @@
 
 #define TYPE_VMXNET3 "vmxnet3"
 typedef struct VMXNET3State VMXNET3State;
-#define VMXNET3(obj) OBJECT_CHECK(VMXNET3State, (obj), TYPE_VMXNET3)
+DECLARE_INSTANCE_CHECKER(VMXNET3State, VMXNET3,
+                         TYPE_VMXNET3)
 
 /* Device state and helper functions */
 #define VMXNET3_RX_RINGS_PER_QUEUE (2)
hw/ppc/e500-ccsr.h +2 -1
index f7fd73fc0d..de4b9d2bc3 100644
@@ -14,6 +14,7 @@ struct PPCE500CCSRState {
 typedef struct PPCE500CCSRState PPCE500CCSRState;
 
 #define TYPE_CCSR "e500-ccsr"
-#define CCSR(obj) OBJECT_CHECK(PPCE500CCSRState, (obj), TYPE_CCSR)
+DECLARE_INSTANCE_CHECKER(PPCE500CCSRState, CCSR,
+                         TYPE_CCSR)
 
 #endif /* E500_CCSR_H */
hw/ppc/e500.h +2 -6
index 5773460d5e..63870751ff 100644
@@ -46,11 +46,7 @@ void ppce500_init(MachineState *machine);
 hwaddr booke206_page_size_to_tlb(uint64_t size);
 
 #define TYPE_PPCE500_MACHINE      "ppce500-base-machine"
-#define PPCE500_MACHINE(obj) \
-    OBJECT_CHECK(PPCE500MachineState, (obj), TYPE_PPCE500_MACHINE)
-#define PPCE500_MACHINE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(PPCE500MachineClass, obj, TYPE_PPCE500_MACHINE)
-#define PPCE500_MACHINE_CLASS(klass) \
-    OBJECT_CLASS_CHECK(PPCE500MachineClass, klass, TYPE_PPCE500_MACHINE)
+DECLARE_OBJ_CHECKERS(PPCE500MachineState, PPCE500MachineClass,
+                     PPCE500_MACHINE, TYPE_PPCE500_MACHINE)
 
 #endif
hw/ppc/mac.h +4 -4
index f4ef3f32b0..2b6425f600 100644
@@ -73,8 +73,8 @@
 /* Core99 machine */
 #define TYPE_CORE99_MACHINE MACHINE_TYPE_NAME("mac99")
 typedef struct Core99MachineState Core99MachineState;
-#define CORE99_MACHINE(obj) OBJECT_CHECK(Core99MachineState, (obj), \
-                                         TYPE_CORE99_MACHINE)
+DECLARE_INSTANCE_CHECKER(Core99MachineState, CORE99_MACHINE,
+                         TYPE_CORE99_MACHINE)
 
 #define CORE99_VIA_CONFIG_CUDA     0x0
 #define CORE99_VIA_CONFIG_PMU      0x1
@@ -93,8 +93,8 @@ struct Core99MachineState {
 /* Mac NVRAM */
 #define TYPE_MACIO_NVRAM "macio-nvram"
 typedef struct MacIONVRAMState MacIONVRAMState;
-#define MACIO_NVRAM(obj) \
-    OBJECT_CHECK(MacIONVRAMState, (obj), TYPE_MACIO_NVRAM)
+DECLARE_INSTANCE_CHECKER(MacIONVRAMState, MACIO_NVRAM,
+                         TYPE_MACIO_NVRAM)
 
 struct MacIONVRAMState {
     /*< private >*/
hw/rdma/vmw/pvrdma.h +2 -1
index db9d9e2c73..1d36a76f1e 100644
@@ -101,7 +101,8 @@ struct PVRDMADev {
     PVRDMADevStats stats;
 };
 typedef struct PVRDMADev PVRDMADev;
-#define PVRDMA_DEV(dev) OBJECT_CHECK(PVRDMADev, (dev), PVRDMA_HW_NAME)
+DECLARE_INSTANCE_CHECKER(PVRDMADev, PVRDMA_DEV,
+                         PVRDMA_HW_NAME)
 
 static inline int get_reg_val(PVRDMADev *dev, hwaddr addr, uint32_t *val)
 {
hw/s390x/ccw-device.h +2 -5
index 867547b4eb..cf7d492084 100644
@@ -47,10 +47,7 @@ static inline CcwDevice *to_ccw_dev_fast(DeviceState *d)
 
 #define TYPE_CCW_DEVICE "ccw-device"
 
-#define CCW_DEVICE(obj) OBJECT_CHECK(CcwDevice, (obj), TYPE_CCW_DEVICE)
-#define CCW_DEVICE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(CCWDeviceClass, (obj), TYPE_CCW_DEVICE)
-#define CCW_DEVICE_CLASS(klass) \
-    OBJECT_CLASS_CHECK(CCWDeviceClass, (klass), TYPE_CCW_DEVICE)
+DECLARE_OBJ_CHECKERS(CcwDevice, CCWDeviceClass,
+                     CCW_DEVICE, TYPE_CCW_DEVICE)
 
 #endif
hw/s390x/ipl.h +2 -1
index 282b22cc4f..9e6061a043 100644
@@ -154,7 +154,8 @@ typedef struct QemuIplParameters QemuIplParameters;
 
 #define TYPE_S390_IPL "s390-ipl"
 typedef struct S390IPLState S390IPLState;
-#define S390_IPL(obj) OBJECT_CHECK(S390IPLState, (obj), TYPE_S390_IPL)
+DECLARE_INSTANCE_CHECKER(S390IPLState, S390_IPL,
+                         TYPE_S390_IPL)
 
 struct S390IPLState {
     /*< private >*/
hw/s390x/s390-pci-bus.h +8 -8
index 06f046e73a..045805980f 100644
@@ -38,17 +38,17 @@
 #define UID_CHECKING_ENABLED 0x01
 
 typedef struct S390pciState S390pciState;
-#define S390_PCI_HOST_BRIDGE(obj) \
-    OBJECT_CHECK(S390pciState, (obj), TYPE_S390_PCI_HOST_BRIDGE)
+DECLARE_INSTANCE_CHECKER(S390pciState, S390_PCI_HOST_BRIDGE,
+                         TYPE_S390_PCI_HOST_BRIDGE)
 typedef struct S390PCIBus S390PCIBus;
-#define S390_PCI_BUS(obj) \
-    OBJECT_CHECK(S390PCIBus, (obj), TYPE_S390_PCI_BUS)
+DECLARE_INSTANCE_CHECKER(S390PCIBus, S390_PCI_BUS,
+                         TYPE_S390_PCI_BUS)
 typedef struct S390PCIBusDevice S390PCIBusDevice;
-#define S390_PCI_DEVICE(obj) \
-    OBJECT_CHECK(S390PCIBusDevice, (obj), TYPE_S390_PCI_DEVICE)
+DECLARE_INSTANCE_CHECKER(S390PCIBusDevice, S390_PCI_DEVICE,
+                         TYPE_S390_PCI_DEVICE)
 typedef struct S390PCIIOMMU S390PCIIOMMU;
-#define S390_PCI_IOMMU(obj) \
-    OBJECT_CHECK(S390PCIIOMMU, (obj), TYPE_S390_PCI_IOMMU)
+DECLARE_INSTANCE_CHECKER(S390PCIIOMMU, S390_PCI_IOMMU,
+                         TYPE_S390_PCI_IOMMU)
 
 #define HP_EVENT_TO_CONFIGURED        0x0301
 #define HP_EVENT_RESERVED_TO_STANDBY  0x0302
hw/s390x/virtio-ccw.h +30 -38

157 lines not on this page · raw message

hw/scsi/mptsas.h +2 -2
index 2e76bda79e..b85ac1a5fc 100644
@@ -16,8 +16,8 @@ typedef struct MPTSASRequest MPTSASRequest;
 
 #define TYPE_MPTSAS1068 "mptsas1068"
 typedef struct MPTSASState MPTSASState;
-#define MPT_SAS(obj) \
-    OBJECT_CHECK(MPTSASState, (obj), TYPE_MPTSAS1068)
+DECLARE_INSTANCE_CHECKER(MPTSASState, MPT_SAS,
+                         TYPE_MPTSAS1068)
 
 enum {
     DOORBELL_NONE,
hw/usb/ccid.h +2 -6
index b992d2ccf8..ef2bb3462d 100644
@@ -18,12 +18,8 @@ typedef struct CCIDCardInfo CCIDCardInfo;
 
 #define TYPE_CCID_CARD "ccid-card"
 typedef struct CCIDCardClass CCIDCardClass;
-#define CCID_CARD(obj) \
-     OBJECT_CHECK(CCIDCardState, (obj), TYPE_CCID_CARD)
-#define CCID_CARD_CLASS(klass) \
-     OBJECT_CLASS_CHECK(CCIDCardClass, (klass), TYPE_CCID_CARD)
-#define CCID_CARD_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(CCIDCardClass, (obj), TYPE_CCID_CARD)
+DECLARE_OBJ_CHECKERS(CCIDCardState, CCIDCardClass,
+                     CCID_CARD, TYPE_CCID_CARD)
 
 /*
  * callbacks to be used by the CCID device (hw/usb-ccid.c) to call
hw/usb/hcd-dwc2.h +2 -6
index 71b40f0d8a..919e3e43b1 100644
@@ -181,11 +181,7 @@ struct DWC2Class {
 };
 
 #define TYPE_DWC2_USB   "dwc2-usb"
-#define DWC2_USB(obj) \
-    OBJECT_CHECK(DWC2State, (obj), TYPE_DWC2_USB)
-#define DWC2_USB_CLASS(klass) \
-    OBJECT_CLASS_CHECK(DWC2Class, (klass), TYPE_DWC2_USB)
-#define DWC2_USB_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(DWC2Class, (obj), TYPE_DWC2_USB)
+DECLARE_OBJ_CHECKERS(DWC2State, DWC2Class,
+                     DWC2_USB, TYPE_DWC2_USB)
 
 #endif
hw/usb/hcd-ehci.h +6 -9
index c12c9bae46..1301ce0be7 100644
@@ -330,7 +330,8 @@ void ehci_reset(void *opaque);
 
 #define TYPE_PCI_EHCI "pci-ehci-usb"
 typedef struct EHCIPCIState EHCIPCIState;
-#define PCI_EHCI(obj) OBJECT_CHECK(EHCIPCIState, (obj), TYPE_PCI_EHCI)
+DECLARE_INSTANCE_CHECKER(EHCIPCIState, PCI_EHCI,
+                         TYPE_PCI_EHCI)
 
 struct EHCIPCIState {
     /*< private >*/
@@ -351,12 +352,8 @@ struct EHCIPCIState {
 
 typedef struct EHCISysBusState EHCISysBusState;
 typedef struct SysBusEHCIClass SysBusEHCIClass;
-#define SYS_BUS_EHCI(obj) \
-    OBJECT_CHECK(EHCISysBusState, (obj), TYPE_SYS_BUS_EHCI)
-#define SYS_BUS_EHCI_CLASS(class) \
-    OBJECT_CLASS_CHECK(SysBusEHCIClass, (class), TYPE_SYS_BUS_EHCI)
-#define SYS_BUS_EHCI_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(SysBusEHCIClass, (obj), TYPE_SYS_BUS_EHCI)
+DECLARE_OBJ_CHECKERS(EHCISysBusState, SysBusEHCIClass,
+                     SYS_BUS_EHCI, TYPE_SYS_BUS_EHCI)
 
 struct EHCISysBusState {
     /*< private >*/
@@ -378,8 +375,8 @@ struct SysBusEHCIClass {
 };
 
 typedef struct FUSBH200EHCIState FUSBH200EHCIState;
-#define FUSBH200_EHCI(obj) \
-    OBJECT_CHECK(FUSBH200EHCIState, (obj), TYPE_FUSBH200_EHCI)
+DECLARE_INSTANCE_CHECKER(FUSBH200EHCIState, FUSBH200_EHCI,
+                         TYPE_FUSBH200_EHCI)
 
 struct FUSBH200EHCIState {
     /*< private >*/
hw/usb/hcd-ohci.h +2 -1
index 3e9053fb26..6e28e97839 100644
@@ -94,7 +94,8 @@ typedef struct OHCIState {
 
 #define TYPE_SYSBUS_OHCI "sysbus-ohci"
 typedef struct OHCISysBusState OHCISysBusState;
-#define SYSBUS_OHCI(obj) OBJECT_CHECK(OHCISysBusState, (obj), TYPE_SYSBUS_OHCI)
+DECLARE_INSTANCE_CHECKER(OHCISysBusState, SYSBUS_OHCI,
+                         TYPE_SYSBUS_OHCI)
 
 struct OHCISysBusState {
     /*< private >*/
hw/usb/hcd-xhci.h +2 -2
index 867388a061..2110c0399e 100644
@@ -28,8 +28,8 @@
 #define TYPE_QEMU_XHCI "qemu-xhci"
 
 typedef struct XHCIState XHCIState;
-#define XHCI(obj) \
-    OBJECT_CHECK(XHCIState, (obj), TYPE_XHCI)
+DECLARE_INSTANCE_CHECKER(XHCIState, XHCI,
+                         TYPE_XHCI)
 
 #define MAXPORTS_2 15
 #define MAXPORTS_3 15
hw/vfio/pci.h +2 -1
index 8c1f94118a..846d60e56c 100644
@@ -116,7 +116,8 @@ typedef struct VFIOMSIXInfo {
 
 #define TYPE_VFIO_PCI "vfio-pci"
 typedef struct VFIOPCIDevice VFIOPCIDevice;
-#define PCI_VFIO(obj)    OBJECT_CHECK(VFIOPCIDevice, obj, TYPE_VFIO_PCI)
+DECLARE_INSTANCE_CHECKER(VFIOPCIDevice, PCI_VFIO,
+                         TYPE_VFIO_PCI)
 
 struct VFIOPCIDevice {
     PCIDevice pdev;
hw/virtio/virtio-mem-pci.h +2 -2
index 65b86beac7..e636e1a48d 100644
@@ -23,8 +23,8 @@ typedef struct VirtIOMEMPCI VirtIOMEMPCI;
  * virtio-mem-pci: This extends VirtioPCIProxy.
  */
 #define TYPE_VIRTIO_MEM_PCI "virtio-mem-pci-base"
-#define VIRTIO_MEM_PCI(obj) \
-        OBJECT_CHECK(VirtIOMEMPCI, (obj), TYPE_VIRTIO_MEM_PCI)
+DECLARE_INSTANCE_CHECKER(VirtIOMEMPCI, VIRTIO_MEM_PCI,
+                         TYPE_VIRTIO_MEM_PCI)
 
 struct VirtIOMEMPCI {
     VirtIOPCIProxy parent_obj;
hw/virtio/virtio-pci.h +4 -12
index d59ac97430..47b6bb4e26 100644
@@ -27,12 +27,8 @@ typedef struct VirtioBusState VirtioPCIBusState;
 typedef struct VirtioBusClass VirtioPCIBusClass;
 
 #define TYPE_VIRTIO_PCI_BUS "virtio-pci-bus"
-#define VIRTIO_PCI_BUS(obj) \
-        OBJECT_CHECK(VirtioPCIBusState, (obj), TYPE_VIRTIO_PCI_BUS)
-#define VIRTIO_PCI_BUS_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(VirtioPCIBusClass, obj, TYPE_VIRTIO_PCI_BUS)
-#define VIRTIO_PCI_BUS_CLASS(klass) \
-        OBJECT_CLASS_CHECK(VirtioPCIBusClass, klass, TYPE_VIRTIO_PCI_BUS)
+DECLARE_OBJ_CHECKERS(VirtioPCIBusState, VirtioPCIBusClass,
+                     VIRTIO_PCI_BUS, TYPE_VIRTIO_PCI_BUS)
 
 enum {
     VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT,
@@ -96,12 +92,8 @@ typedef struct {
  */
 #define TYPE_VIRTIO_PCI "virtio-pci"
 typedef struct VirtioPCIClass VirtioPCIClass;
-#define VIRTIO_PCI_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(VirtioPCIClass, obj, TYPE_VIRTIO_PCI)
-#define VIRTIO_PCI_CLASS(klass) \
-        OBJECT_CLASS_CHECK(VirtioPCIClass, klass, TYPE_VIRTIO_PCI)
-#define VIRTIO_PCI(obj) \
-        OBJECT_CHECK(VirtIOPCIProxy, (obj), TYPE_VIRTIO_PCI)
+DECLARE_OBJ_CHECKERS(VirtIOPCIProxy, VirtioPCIClass,
+                     VIRTIO_PCI, TYPE_VIRTIO_PCI)
 
 struct VirtioPCIClass {
     PCIDeviceClass parent_class;
hw/virtio/virtio-pmem-pci.h +2 -2
index 5ac8099637..63cfe727f7 100644
@@ -24,8 +24,8 @@ typedef struct VirtIOPMEMPCI VirtIOPMEMPCI;
  * virtio-pmem-pci: This extends VirtioPCIProxy.
  */
 #define TYPE_VIRTIO_PMEM_PCI "virtio-pmem-pci-base"
-#define VIRTIO_PMEM_PCI(obj) \
-        OBJECT_CHECK(VirtIOPMEMPCI, (obj), TYPE_VIRTIO_PMEM_PCI)
+DECLARE_INSTANCE_CHECKER(VirtIOPMEMPCI, VIRTIO_PMEM_PCI,
+                         TYPE_VIRTIO_PMEM_PCI)
 
 struct VirtIOPMEMPCI {
     VirtIOPCIProxy parent_obj;
hw/xen/xen_pt.h +2 -2
index c367c7da27..f46971eac6 100644
@@ -40,8 +40,8 @@ typedef struct XenPTReg XenPTReg;
 typedef struct XenPCIPassthroughState XenPCIPassthroughState;
 
 #define TYPE_XEN_PT_DEVICE "xen-pci-passthrough"
-#define XEN_PT_DEVICE(obj) \
-    OBJECT_CHECK(XenPCIPassthroughState, (obj), TYPE_XEN_PT_DEVICE)
+DECLARE_INSTANCE_CHECKER(XenPCIPassthroughState, XEN_PT_DEVICE,
+                         TYPE_XEN_PT_DEVICE)
 
 uint32_t igd_read_opregion(XenPCIPassthroughState *s);
 void igd_write_opregion(XenPCIPassthroughState *s, uint32_t val);
include/authz/base.h +2 -9
index c01946b4ce..8d8cf9fa5a 100644
@@ -29,15 +29,8 @@
 
 typedef struct QAuthZ QAuthZ;
 typedef struct QAuthZClass QAuthZClass;
-#define QAUTHZ_CLASS(klass) \
-     OBJECT_CLASS_CHECK(QAuthZClass, (klass), \
-                        TYPE_QAUTHZ)
-#define QAUTHZ_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(QAuthZClass, (obj), \
-                      TYPE_QAUTHZ)
-#define QAUTHZ(obj) \
-     OBJECT_CHECK(QAuthZ, (obj), \
-                  TYPE_QAUTHZ)
+DECLARE_OBJ_CHECKERS(QAuthZ, QAuthZClass,
+                     QAUTHZ, TYPE_QAUTHZ)
 
 
 /**
include/authz/list.h +2 -9
index 5d5e8e803f..93d16876bc 100644
@@ -29,15 +29,8 @@
 
 typedef struct QAuthZList QAuthZList;
 typedef struct QAuthZListClass QAuthZListClass;
-#define QAUTHZ_LIST_CLASS(klass)                        \
-    OBJECT_CLASS_CHECK(QAuthZListClass, (klass),        \
-                       TYPE_QAUTHZ_LIST)
-#define QAUTHZ_LIST_GET_CLASS(obj)              \
-    OBJECT_GET_CLASS(QAuthZListClass, (obj),    \
-                      TYPE_QAUTHZ_LIST)
-#define QAUTHZ_LIST(obj) \
-    OBJECT_CHECK(QAuthZList, (obj), \
-                 TYPE_QAUTHZ_LIST)
+DECLARE_OBJ_CHECKERS(QAuthZList, QAuthZListClass,
+                     QAUTHZ_LIST, TYPE_QAUTHZ_LIST)
 
 
 
include/authz/listfile.h +2 -9
index 11169ac882..2e4a629b6d 100644
@@ -29,15 +29,8 @@
 
 typedef struct QAuthZListFile QAuthZListFile;
 typedef struct QAuthZListFileClass QAuthZListFileClass;
-#define QAUTHZ_LIST_FILE_CLASS(klass)                        \
-    OBJECT_CLASS_CHECK(QAuthZListFileClass, (klass),        \
-                       TYPE_QAUTHZ_LIST_FILE)
-#define QAUTHZ_LIST_FILE_GET_CLASS(obj)              \
-    OBJECT_GET_CLASS(QAuthZListFileClass, (obj),    \
-                      TYPE_QAUTHZ_LIST_FILE)
-#define QAUTHZ_LIST_FILE(obj) \
-    OBJECT_CHECK(QAuthZListFile, (obj), \
-                 TYPE_QAUTHZ_LIST_FILE)
+DECLARE_OBJ_CHECKERS(QAuthZListFile, QAuthZListFileClass,
+                     QAUTHZ_LIST_FILE, TYPE_QAUTHZ_LIST_FILE)
 
 
 
include/authz/pamacct.h +2 -9
index a14cf33fb4..98454ddc25 100644
@@ -29,15 +29,8 @@
 
 typedef struct QAuthZPAM QAuthZPAM;
 typedef struct QAuthZPAMClass QAuthZPAMClass;
-#define QAUTHZ_PAM_CLASS(klass) \
-     OBJECT_CLASS_CHECK(QAuthZPAMClass, (klass), \
-                        TYPE_QAUTHZ_PAM)
-#define QAUTHZ_PAM_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(QAuthZPAMClass, (obj), \
-                      TYPE_QAUTHZ_PAM)
-#define QAUTHZ_PAM(obj) \
-     OBJECT_CHECK(QAuthZPAM, (obj), \
-                  TYPE_QAUTHZ_PAM)
+DECLARE_OBJ_CHECKERS(QAuthZPAM, QAuthZPAMClass,
+                     QAUTHZ_PAM, TYPE_QAUTHZ_PAM)
 
 
 
include/authz/simple.h +2 -9
index df8c1bf39c..7a896fb94b 100644
@@ -28,15 +28,8 @@
 
 typedef struct QAuthZSimple QAuthZSimple;
 typedef struct QAuthZSimpleClass QAuthZSimpleClass;
-#define QAUTHZ_SIMPLE_CLASS(klass)                        \
-    OBJECT_CLASS_CHECK(QAuthZSimpleClass, (klass),        \
-                       TYPE_QAUTHZ_SIMPLE)
-#define QAUTHZ_SIMPLE_GET_CLASS(obj)              \
-    OBJECT_GET_CLASS(QAuthZSimpleClass, (obj),    \
-                      TYPE_QAUTHZ_SIMPLE)
-#define QAUTHZ_SIMPLE(obj) \
-    OBJECT_CHECK(QAuthZSimple, (obj), \
-                 TYPE_QAUTHZ_SIMPLE)
+DECLARE_OBJ_CHECKERS(QAuthZSimple, QAuthZSimpleClass,
+                     QAUTHZ_SIMPLE, TYPE_QAUTHZ_SIMPLE)
 
 
 
include/block/throttle-groups.h +2 -1
index 7c6f572cf9..20b308f619 100644
@@ -61,7 +61,8 @@ typedef struct ThrottleGroupMember {
 
 #define TYPE_THROTTLE_GROUP "throttle-group"
 typedef struct ThrottleGroup ThrottleGroup;
-#define THROTTLE_GROUP(obj) OBJECT_CHECK(ThrottleGroup, (obj), TYPE_THROTTLE_GROUP)
+DECLARE_INSTANCE_CHECKER(ThrottleGroup, THROTTLE_GROUP,
+                         TYPE_THROTTLE_GROUP)
 
 const char *throttle_group_get_name(ThrottleGroupMember *tgm);
 
include/chardev/char-fd.h +2 -1
index 1442dcaa62..9de0e440de 100644
@@ -38,7 +38,8 @@ typedef struct FDChardev FDChardev;
 
 #define TYPE_CHARDEV_FD "chardev-fd"
 
-#define FD_CHARDEV(obj) OBJECT_CHECK(FDChardev, (obj), TYPE_CHARDEV_FD)
+DECLARE_INSTANCE_CHECKER(FDChardev, FD_CHARDEV,
+                         TYPE_CHARDEV_FD)
 
 void qemu_chr_open_fd(Chardev *chr, int fd_in, int fd_out);
 int qmp_chardev_open_file_source(char *src, int flags, Error **errp);
include/chardev/char-win.h +2 -1
index f1632330f1..485521469c 100644
@@ -44,7 +44,8 @@ typedef struct WinChardev WinChardev;
 #define NRECVBUF 2048
 
 #define TYPE_CHARDEV_WIN "chardev-win"
-#define WIN_CHARDEV(obj) OBJECT_CHECK(WinChardev, (obj), TYPE_CHARDEV_WIN)
+DECLARE_INSTANCE_CHECKER(WinChardev, WIN_CHARDEV,
+                         TYPE_CHARDEV_WIN)
 
 void win_chr_set_file(Chardev *chr, HANDLE file, bool keep_open);
 int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp);
include/chardev/char.h +2 -5
index d91d851b33..5874de57ea 100644
@@ -227,11 +227,8 @@ int qemu_chr_wait_connected(Chardev *chr, Error **errp);
 
 #define TYPE_CHARDEV "chardev"
 typedef struct ChardevClass ChardevClass;
-#define CHARDEV(obj) OBJECT_CHECK(Chardev, (obj), TYPE_CHARDEV)
-#define CHARDEV_CLASS(klass) \
-    OBJECT_CLASS_CHECK(ChardevClass, (klass), TYPE_CHARDEV)
-#define CHARDEV_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(ChardevClass, (obj), TYPE_CHARDEV)
+DECLARE_OBJ_CHECKERS(Chardev, ChardevClass,
+                     CHARDEV, TYPE_CHARDEV)
 
 #define TYPE_CHARDEV_NULL "chardev-null"
 #define TYPE_CHARDEV_MUX "chardev-mux"
include/chardev/spice.h +2 -1
index 5bccc47392..99f26aedde 100644
@@ -21,7 +21,8 @@ typedef struct SpiceChardev SpiceChardev;
 #define TYPE_CHARDEV_SPICEVMC "chardev-spicevmc"
 #define TYPE_CHARDEV_SPICEPORT "chardev-spiceport"
 
-#define SPICE_CHARDEV(obj) OBJECT_CHECK(SpiceChardev, (obj), TYPE_CHARDEV_SPICE)
+DECLARE_INSTANCE_CHECKER(SpiceChardev, SPICE_CHARDEV,
+                         TYPE_CHARDEV_SPICE)
 
 void qemu_chr_open_spice_port(Chardev *chr, ChardevBackend *backend,
                               bool *be_opened, Error **errp);
include/crypto/secret.h +2 -2
index 8c03971e75..5d20ae6d2f 100644
@@ -27,8 +27,8 @@
 
 #define TYPE_QCRYPTO_SECRET "secret"
 typedef struct QCryptoSecret QCryptoSecret;
-#define QCRYPTO_SECRET(obj)                  \
-    OBJECT_CHECK(QCryptoSecret, (obj), TYPE_QCRYPTO_SECRET)
+DECLARE_INSTANCE_CHECKER(QCryptoSecret, QCRYPTO_SECRET,
+                         TYPE_QCRYPTO_SECRET)
 
 typedef struct QCryptoSecretClass QCryptoSecretClass;
 
include/crypto/secret_common.h +2 -8
index db282a3872..dd3310ea5f 100644
@@ -27,14 +27,8 @@
 #define TYPE_QCRYPTO_SECRET_COMMON "secret_common"
 typedef struct QCryptoSecretCommon QCryptoSecretCommon;
 typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass;
-#define QCRYPTO_SECRET_COMMON(obj) \
-    OBJECT_CHECK(QCryptoSecretCommon, (obj), TYPE_QCRYPTO_SECRET_COMMON)
-#define QCRYPTO_SECRET_COMMON_CLASS(class) \
-    OBJECT_CLASS_CHECK(QCryptoSecretCommonClass, \
-                       (class), TYPE_QCRYPTO_SECRET_COMMON)
-#define QCRYPTO_SECRET_COMMON_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(QCryptoSecretCommonClass, \
-                     (obj), TYPE_QCRYPTO_SECRET_COMMON)
+DECLARE_OBJ_CHECKERS(QCryptoSecretCommon, QCryptoSecretCommonClass,
+                     QCRYPTO_SECRET_COMMON, TYPE_QCRYPTO_SECRET_COMMON)
 
 
 struct QCryptoSecretCommon {
include/crypto/secret_keyring.h +2 -9
index 8b3b8ee67d..9875f4cbf3 100644
@@ -28,15 +28,8 @@
 #define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring"
 typedef struct QCryptoSecretKeyring QCryptoSecretKeyring;
 typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass;
-#define QCRYPTO_SECRET_KEYRING(obj) \
-    OBJECT_CHECK(QCryptoSecretKeyring, (obj), \
-                 TYPE_QCRYPTO_SECRET_KEYRING)
-#define QCRYPTO_SECRET_KEYRING_CLASS(class) \
-    OBJECT_CLASS_CHECK(QCryptoSecretKeyringClass, \
-                       (class), TYPE_QCRYPTO_SECRET_KEYRING)
-#define QCRYPTO_SECRET_KEYRING_GET_CLASS(class) \
-    OBJECT_GET_CLASS(QCryptoSecretKeyringClass, \
-                     (class), TYPE_QCRYPTO_SECRET_KEYRING)
+DECLARE_OBJ_CHECKERS(QCryptoSecretKeyring, QCryptoSecretKeyringClass,
+                     QCRYPTO_SECRET_KEYRING, TYPE_QCRYPTO_SECRET_KEYRING)
 
 
 struct QCryptoSecretKeyring {
include/crypto/tls-cipher-suites.h +2 -2
index 23f031953f..bb9ee53e03 100644
@@ -16,8 +16,8 @@
 
 #define TYPE_QCRYPTO_TLS_CIPHER_SUITES "tls-cipher-suites"
 typedef struct QCryptoTLSCipherSuites QCryptoTLSCipherSuites;
-#define QCRYPTO_TLS_CIPHER_SUITES(obj) \
-    OBJECT_CHECK(QCryptoTLSCipherSuites, (obj), TYPE_QCRYPTO_TLS_CIPHER_SUITES)
+DECLARE_INSTANCE_CHECKER(QCryptoTLSCipherSuites, QCRYPTO_TLS_CIPHER_SUITES,
+                         TYPE_QCRYPTO_TLS_CIPHER_SUITES)
 
 struct QCryptoTLSCipherSuites {
     /* <private> */
include/crypto/tlscreds.h +2 -2
index 9f065a4def..079e376047 100644
@@ -30,8 +30,8 @@
 
 #define TYPE_QCRYPTO_TLS_CREDS "tls-creds"
 typedef struct QCryptoTLSCreds QCryptoTLSCreds;
-#define QCRYPTO_TLS_CREDS(obj)                  \
-    OBJECT_CHECK(QCryptoTLSCreds, (obj), TYPE_QCRYPTO_TLS_CREDS)
+DECLARE_INSTANCE_CHECKER(QCryptoTLSCreds, QCRYPTO_TLS_CREDS,
+                         TYPE_QCRYPTO_TLS_CREDS)
 
 typedef struct QCryptoTLSCredsClass QCryptoTLSCredsClass;
 
include/crypto/tlscredsanon.h +2 -2
index 034ebd3fd9..3f464a3809 100644
@@ -26,8 +26,8 @@
 
 #define TYPE_QCRYPTO_TLS_CREDS_ANON "tls-creds-anon"
 typedef struct QCryptoTLSCredsAnon QCryptoTLSCredsAnon;
-#define QCRYPTO_TLS_CREDS_ANON(obj)                  \
-    OBJECT_CHECK(QCryptoTLSCredsAnon, (obj), TYPE_QCRYPTO_TLS_CREDS_ANON)
+DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsAnon, QCRYPTO_TLS_CREDS_ANON,
+                         TYPE_QCRYPTO_TLS_CREDS_ANON)
 
 
 typedef struct QCryptoTLSCredsAnonClass QCryptoTLSCredsAnonClass;
include/crypto/tlscredspsk.h +2 -2
index 6e361366eb..d7e6bdb5ed 100644
@@ -26,8 +26,8 @@
 
 #define TYPE_QCRYPTO_TLS_CREDS_PSK "tls-creds-psk"
 typedef struct QCryptoTLSCredsPSK QCryptoTLSCredsPSK;
-#define QCRYPTO_TLS_CREDS_PSK(obj)                  \
-    OBJECT_CHECK(QCryptoTLSCredsPSK, (obj), TYPE_QCRYPTO_TLS_CREDS_PSK)
+DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsPSK, QCRYPTO_TLS_CREDS_PSK,
+                         TYPE_QCRYPTO_TLS_CREDS_PSK)
 
 typedef struct QCryptoTLSCredsPSKClass QCryptoTLSCredsPSKClass;
 
include/crypto/tlscredsx509.h +2 -2
index e4d44ea22d..c6d89b7881 100644
@@ -26,8 +26,8 @@
 
 #define TYPE_QCRYPTO_TLS_CREDS_X509 "tls-creds-x509"
 typedef struct QCryptoTLSCredsX509 QCryptoTLSCredsX509;
-#define QCRYPTO_TLS_CREDS_X509(obj)                  \
-    OBJECT_CHECK(QCryptoTLSCredsX509, (obj), TYPE_QCRYPTO_TLS_CREDS_X509)
+DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsX509, QCRYPTO_TLS_CREDS_X509,
+                         TYPE_QCRYPTO_TLS_CREDS_X509)
 
 typedef struct QCryptoTLSCredsX509Class QCryptoTLSCredsX509Class;
 
include/exec/memory.h +4 -10
index 5c17a21c65..f1bb2a7df5 100644
@@ -34,19 +34,13 @@
 #define MAX_PHYS_ADDR            (((hwaddr)1 << MAX_PHYS_ADDR_SPACE_BITS) - 1)
 
 #define TYPE_MEMORY_REGION "qemu:memory-region"
-#define MEMORY_REGION(obj) \
-        OBJECT_CHECK(MemoryRegion, (obj), TYPE_MEMORY_REGION)
+DECLARE_INSTANCE_CHECKER(MemoryRegion, MEMORY_REGION,
+                         TYPE_MEMORY_REGION)
 
 #define TYPE_IOMMU_MEMORY_REGION "qemu:iommu-memory-region"
 typedef struct IOMMUMemoryRegionClass IOMMUMemoryRegionClass;
-#define IOMMU_MEMORY_REGION(obj) \
-        OBJECT_CHECK(IOMMUMemoryRegion, (obj), TYPE_IOMMU_MEMORY_REGION)
-#define IOMMU_MEMORY_REGION_CLASS(klass) \
-        OBJECT_CLASS_CHECK(IOMMUMemoryRegionClass, (klass), \
-                         TYPE_IOMMU_MEMORY_REGION)
-#define IOMMU_MEMORY_REGION_GET_CLASS(obj) \
-        OBJECT_GET_CLASS(IOMMUMemoryRegionClass, (obj), \
-                         TYPE_IOMMU_MEMORY_REGION)
+DECLARE_OBJ_CHECKERS(IOMMUMemoryRegion, IOMMUMemoryRegionClass,
+                     IOMMU_MEMORY_REGION, TYPE_IOMMU_MEMORY_REGION)
 
 extern bool global_dirty_log;
 
include/hw/acpi/acpi_dev_interface.h +2 -6
index 4ef44d6fe8..9adf1e4706 100644
@@ -19,12 +19,8 @@ typedef enum {
 #define TYPE_ACPI_DEVICE_IF "acpi-device-interface"
 
 typedef struct AcpiDeviceIfClass AcpiDeviceIfClass;
-#define ACPI_DEVICE_IF_CLASS(klass) \
-     OBJECT_CLASS_CHECK(AcpiDeviceIfClass, (klass), \
-                        TYPE_ACPI_DEVICE_IF)
-#define ACPI_DEVICE_IF_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(AcpiDeviceIfClass, (obj), \
-                      TYPE_ACPI_DEVICE_IF)
+DECLARE_CLASS_CHECKERS(AcpiDeviceIfClass, ACPI_DEVICE_IF,
+                       TYPE_ACPI_DEVICE_IF)
 #define ACPI_DEVICE_IF(obj) \
      INTERFACE_CHECK(AcpiDeviceIf, (obj), \
                      TYPE_ACPI_DEVICE_IF)
include/hw/acpi/generic_event_device.h +2 -2
index 2208f0b939..1be05a3c0f 100644
@@ -68,8 +68,8 @@
 
 #define TYPE_ACPI_GED "acpi-ged"
 typedef struct AcpiGedState AcpiGedState;
-#define ACPI_GED(obj) \
-    OBJECT_CHECK(AcpiGedState, (obj), TYPE_ACPI_GED)
+DECLARE_INSTANCE_CHECKER(AcpiGedState, ACPI_GED,
+                         TYPE_ACPI_GED)
 
 #define ACPI_GED_EVT_SEL_OFFSET    0x0
 #define ACPI_GED_EVT_SEL_LEN       0x4
include/hw/acpi/vmgenid.h +2 -1
index 0286fc0f09..86cd1da605 100644
@@ -17,7 +17,8 @@
                                        */
 
 typedef struct VmGenIdState VmGenIdState;
-#define VMGENID(obj) OBJECT_CHECK(VmGenIdState, (obj), VMGENID_DEVICE)
+DECLARE_INSTANCE_CHECKER(VmGenIdState, VMGENID,
+                         VMGENID_DEVICE)
 
 struct VmGenIdState {
     DeviceClass parent_obj;
include/hw/adc/stm32f2xx_adc.h +2 -2
index 60d4b65570..6a4f8e955b 100644
@@ -60,8 +60,8 @@
 
 #define TYPE_STM32F2XX_ADC "stm32f2xx-adc"
 typedef struct STM32F2XXADCState STM32F2XXADCState;
-#define STM32F2XX_ADC(obj) \
-    OBJECT_CHECK(STM32F2XXADCState, (obj), TYPE_STM32F2XX_ADC)
+DECLARE_INSTANCE_CHECKER(STM32F2XXADCState, STM32F2XX_ADC,
+                         TYPE_STM32F2XX_ADC)
 
 struct STM32F2XXADCState {
     /* <private> */
include/hw/arm/allwinner-a10.h +2 -1
index 631454f1c7..d13b6cf50f 100644
@@ -23,7 +23,8 @@
 
 #define TYPE_AW_A10 "allwinner-a10"
 typedef struct AwA10State AwA10State;
-#define AW_A10(obj) OBJECT_CHECK(AwA10State, (obj), TYPE_AW_A10)
+DECLARE_INSTANCE_CHECKER(AwA10State, AW_A10,
+                         TYPE_AW_A10)
 
 struct AwA10State {
     /*< private >*/
include/hw/arm/allwinner-h3.h +2 -1
index 5fda95066f..a93e019521 100644
@@ -107,7 +107,8 @@ enum {
 
 /** Convert input object to Allwinner H3 state object */
 typedef struct AwH3State AwH3State;
-#define AW_H3(obj) OBJECT_CHECK(AwH3State, (obj), TYPE_AW_H3)
+DECLARE_INSTANCE_CHECKER(AwH3State, AW_H3,
+                         TYPE_AW_H3)
 
 /** @} */
 
include/hw/arm/armsse.h +2 -5
index e5788e9d3c..452cbb5793 100644
@@ -110,7 +110,8 @@
 #define TYPE_ARM_SSE "arm-sse"
 typedef struct ARMSSE ARMSSE;
 typedef struct ARMSSEClass ARMSSEClass;
-#define ARM_SSE(obj) OBJECT_CHECK(ARMSSE, (obj), TYPE_ARM_SSE)
+DECLARE_OBJ_CHECKERS(ARMSSE, ARMSSEClass,
+                     ARM_SSE, TYPE_ARM_SSE)
 
 /*
  * These type names are for specific IoTKit subsystems; other than
@@ -227,9 +228,5 @@ struct ARMSSEClass {
     const ARMSSEInfo *info;
 };
 
-#define ARM_SSE_CLASS(klass) \
-    OBJECT_CLASS_CHECK(ARMSSEClass, (klass), TYPE_ARM_SSE)
-#define ARM_SSE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(ARMSSEClass, (obj), TYPE_ARM_SSE)
 
 #endif
include/hw/arm/armv7m.h +4 -2
index c820d32ad5..dcb891d9cc 100644
@@ -17,7 +17,8 @@
 
 #define TYPE_BITBAND "ARM,bitband-memory"
 typedef struct BitBandState BitBandState;
-#define BITBAND(obj) OBJECT_CHECK(BitBandState, (obj), TYPE_BITBAND)
+DECLARE_INSTANCE_CHECKER(BitBandState, BITBAND,
+                         TYPE_BITBAND)
 
 struct BitBandState {
     /*< private >*/
@@ -32,7 +33,8 @@ struct BitBandState {
 
 #define TYPE_ARMV7M "armv7m"
 typedef struct ARMv7MState ARMv7MState;
-#define ARMV7M(obj) OBJECT_CHECK(ARMv7MState, (obj), TYPE_ARMV7M)
+DECLARE_INSTANCE_CHECKER(ARMv7MState, ARMV7M,
+                         TYPE_ARMV7M)
 
 #define ARMV7M_NUM_BITBANDS 2
 
include/hw/arm/aspeed.h +2 -6
index 4e5ec37acb..c9747b15fc 100644
@@ -16,18 +16,14 @@ typedef struct AspeedMachineState AspeedMachineState;
 
 #define TYPE_ASPEED_MACHINE       MACHINE_TYPE_NAME("aspeed")
 typedef struct AspeedMachineClass AspeedMachineClass;
-#define ASPEED_MACHINE(obj) \
-    OBJECT_CHECK(AspeedMachineState, (obj), TYPE_ASPEED_MACHINE)
+DECLARE_OBJ_CHECKERS(AspeedMachineState, AspeedMachineClass,
+                     ASPEED_MACHINE, TYPE_ASPEED_MACHINE)
 
 #define ASPEED_MAC0_ON   (1 << 0)
 #define ASPEED_MAC1_ON   (1 << 1)
 #define ASPEED_MAC2_ON   (1 << 2)
 #define ASPEED_MAC3_ON   (1 << 3)
 
-#define ASPEED_MACHINE_CLASS(klass) \
-     OBJECT_CLASS_CHECK(AspeedMachineClass, (klass), TYPE_ASPEED_MACHINE)
-#define ASPEED_MACHINE_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(AspeedMachineClass, (obj), TYPE_ASPEED_MACHINE)
 
 struct AspeedMachineClass {
     MachineClass parent_obj;
include/hw/arm/aspeed_soc.h +2 -5
index 31679ee42e..05c7d53df3 100644
@@ -66,7 +66,8 @@ typedef struct AspeedSoCState AspeedSoCState;
 
 #define TYPE_ASPEED_SOC "aspeed-soc"
 typedef struct AspeedSoCClass AspeedSoCClass;
-#define ASPEED_SOC(obj) OBJECT_CHECK(AspeedSoCState, (obj), TYPE_ASPEED_SOC)
+DECLARE_OBJ_CHECKERS(AspeedSoCState, AspeedSoCClass,
+                     ASPEED_SOC, TYPE_ASPEED_SOC)
 
 struct AspeedSoCClass {
     DeviceClass parent_class;
@@ -84,10 +85,6 @@ struct AspeedSoCClass {
     uint32_t num_cpus;
 };
 
-#define ASPEED_SOC_CLASS(klass)                                         \
-    OBJECT_CLASS_CHECK(AspeedSoCClass, (klass), TYPE_ASPEED_SOC)
-#define ASPEED_SOC_GET_CLASS(obj)                               \
-    OBJECT_GET_CLASS(AspeedSoCClass, (obj), TYPE_ASPEED_SOC)
 
 enum {
     ASPEED_DEV_IOMEM,
include/hw/arm/bcm2835_peripherals.h +2 -2
index 67f5a5f8f5..b4d3ae121a 100644
@@ -33,8 +33,8 @@
 
 #define TYPE_BCM2835_PERIPHERALS "bcm2835-peripherals"
 typedef struct BCM2835PeripheralState BCM2835PeripheralState;
-#define BCM2835_PERIPHERALS(obj) \
-    OBJECT_CHECK(BCM2835PeripheralState, (obj), TYPE_BCM2835_PERIPHERALS)
+DECLARE_INSTANCE_CHECKER(BCM2835PeripheralState, BCM2835_PERIPHERALS,
+                         TYPE_BCM2835_PERIPHERALS)
 
 struct BCM2835PeripheralState {
     /*< private >*/
include/hw/arm/bcm2836.h +2 -5
index cf22dc96a0..181d9563d0 100644
@@ -20,7 +20,8 @@
 #define TYPE_BCM283X "bcm283x"
 typedef struct BCM283XClass BCM283XClass;
 typedef struct BCM283XState BCM283XState;
-#define BCM283X(obj) OBJECT_CHECK(BCM283XState, (obj), TYPE_BCM283X)
+DECLARE_OBJ_CHECKERS(BCM283XState, BCM283XClass,
+                     BCM283X, TYPE_BCM283X)
 
 #define BCM283X_NCPUS 4
 
@@ -52,9 +53,5 @@ struct BCM283XClass {
     const BCM283XInfo *info;
 };
 
-#define BCM283X_CLASS(klass) \
-    OBJECT_CLASS_CHECK(BCM283XClass, (klass), TYPE_BCM283X)
-#define BCM283X_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(BCM283XClass, (obj), TYPE_BCM283X)
 
 #endif /* BCM2836_H */
include/hw/arm/digic.h +2 -1
index f77833f6e3..f3ba398914 100644
@@ -26,7 +26,8 @@
 #define TYPE_DIGIC "digic"
 
 typedef struct DigicState DigicState;
-#define DIGIC(obj) OBJECT_CHECK(DigicState, (obj), TYPE_DIGIC)
+DECLARE_INSTANCE_CHECKER(DigicState, DIGIC,
+                         TYPE_DIGIC)
 
 #define DIGIC4_NB_TIMERS 3
 
include/hw/arm/exynos4210.h +2 -2
index 114c594cd2..c2de1dc102 100644
@@ -106,8 +106,8 @@ struct Exynos4210State {
 typedef struct Exynos4210State Exynos4210State;
 
 #define TYPE_EXYNOS4210_SOC "exynos4210"
-#define EXYNOS4210_SOC(obj) \
-    OBJECT_CHECK(Exynos4210State, obj, TYPE_EXYNOS4210_SOC)
+DECLARE_INSTANCE_CHECKER(Exynos4210State, EXYNOS4210_SOC,
+                         TYPE_EXYNOS4210_SOC)
 
 void exynos4210_write_secondary(ARMCPU *cpu,
         const struct arm_boot_info *info);
include/hw/arm/fsl-imx25.h +2 -1
index 8b4c974f09..e239505724 100644
@@ -36,7 +36,8 @@
 
 #define TYPE_FSL_IMX25 "fsl,imx25"
 typedef struct FslIMX25State FslIMX25State;
-#define FSL_IMX25(obj) OBJECT_CHECK(FslIMX25State, (obj), TYPE_FSL_IMX25)
+DECLARE_INSTANCE_CHECKER(FslIMX25State, FSL_IMX25,
+                         TYPE_FSL_IMX25)
 
 #define FSL_IMX25_NUM_UARTS 5
 #define FSL_IMX25_NUM_GPTS 4
include/hw/arm/fsl-imx31.h +2 -1
index 12368f2c8f..64b4ca07b7 100644
@@ -32,7 +32,8 @@
 
 #define TYPE_FSL_IMX31 "fsl,imx31"
 typedef struct FslIMX31State FslIMX31State;
-#define FSL_IMX31(obj) OBJECT_CHECK(FslIMX31State, (obj), TYPE_FSL_IMX31)
+DECLARE_INSTANCE_CHECKER(FslIMX31State, FSL_IMX31,
+                         TYPE_FSL_IMX31)
 
 #define FSL_IMX31_NUM_UARTS 2
 #define FSL_IMX31_NUM_EPITS 2
include/hw/arm/fsl-imx6.h +2 -1
index e66ea1e917..602b9aff36 100644
@@ -38,7 +38,8 @@
 
 #define TYPE_FSL_IMX6 "fsl,imx6"
 typedef struct FslIMX6State FslIMX6State;
-#define FSL_IMX6(obj) OBJECT_CHECK(FslIMX6State, (obj), TYPE_FSL_IMX6)
+DECLARE_INSTANCE_CHECKER(FslIMX6State, FSL_IMX6,
+                         TYPE_FSL_IMX6)
 
 #define FSL_IMX6_NUM_CPUS 4
 #define FSL_IMX6_NUM_UARTS 5
include/hw/arm/fsl-imx6ul.h +2 -1
index e95c4820c6..e4862fdb2c 100644
@@ -42,7 +42,8 @@
 
 #define TYPE_FSL_IMX6UL "fsl,imx6ul"
 typedef struct FslIMX6ULState FslIMX6ULState;
-#define FSL_IMX6UL(obj) OBJECT_CHECK(FslIMX6ULState, (obj), TYPE_FSL_IMX6UL)
+DECLARE_INSTANCE_CHECKER(FslIMX6ULState, FSL_IMX6UL,
+                         TYPE_FSL_IMX6UL)
 
 enum FslIMX6ULConfiguration {
     FSL_IMX6UL_NUM_CPUS         = 1,
include/hw/arm/fsl-imx7.h +2 -1
index 8095e5544b..434d1d0641 100644
@@ -43,7 +43,8 @@
 
 #define TYPE_FSL_IMX7 "fsl,imx7"
 typedef struct FslIMX7State FslIMX7State;
-#define FSL_IMX7(obj) OBJECT_CHECK(FslIMX7State, (obj), TYPE_FSL_IMX7)
+DECLARE_INSTANCE_CHECKER(FslIMX7State, FSL_IMX7,
+                         TYPE_FSL_IMX7)
 
 enum FslIMX7Configuration {
     FSL_IMX7_NUM_CPUS         = 2,
include/hw/arm/linux-boot-if.h +2 -4
index 6d9e13fd36..c85f33b2c5 100644
@@ -10,10 +10,8 @@
 
 #define TYPE_ARM_LINUX_BOOT_IF "arm-linux-boot-if"
 typedef struct ARMLinuxBootIfClass ARMLinuxBootIfClass;
-#define ARM_LINUX_BOOT_IF_CLASS(klass) \
-    OBJECT_CLASS_CHECK(ARMLinuxBootIfClass, (klass), TYPE_ARM_LINUX_BOOT_IF)
-#define ARM_LINUX_BOOT_IF_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(ARMLinuxBootIfClass, (obj), TYPE_ARM_LINUX_BOOT_IF)
+DECLARE_CLASS_CHECKERS(ARMLinuxBootIfClass, ARM_LINUX_BOOT_IF,
+                       TYPE_ARM_LINUX_BOOT_IF)
 #define ARM_LINUX_BOOT_IF(obj) \
     INTERFACE_CHECK(ARMLinuxBootIf, (obj), TYPE_ARM_LINUX_BOOT_IF)
 
include/hw/arm/msf2-soc.h +2 -1
index b4bc5ef96a..9b93d0d64e 100644
@@ -34,7 +34,8 @@
 
 #define TYPE_MSF2_SOC     "msf2-soc"
 typedef struct MSF2State MSF2State;
-#define MSF2_SOC(obj)     OBJECT_CHECK(MSF2State, (obj), TYPE_MSF2_SOC)
+DECLARE_INSTANCE_CHECKER(MSF2State, MSF2_SOC,
+                         TYPE_MSF2_SOC)
 
 #define MSF2_NUM_SPIS         2
 #define MSF2_NUM_UARTS        2
include/hw/arm/nrf51_soc.h +2 -2
index 727ac1ae04..b69492b29d 100644
@@ -21,8 +21,8 @@
 
 #define TYPE_NRF51_SOC "nrf51-soc"
 typedef struct NRF51State NRF51State;
-#define NRF51_SOC(obj) \
-    OBJECT_CHECK(NRF51State, (obj), TYPE_NRF51_SOC)
+DECLARE_INSTANCE_CHECKER(NRF51State, NRF51_SOC,
+                         TYPE_NRF51_SOC)
 
 #define NRF51_NUM_TIMERS 3
 
include/hw/arm/omap.h +8 -7
index 0d365edeec..0dbf1712f4 100644
@@ -71,8 +71,8 @@ void omap_clk_reparent(omap_clk clk, omap_clk parent);
 /* omap_intc.c */
 #define TYPE_OMAP_INTC "common-omap-intc"
 typedef struct omap_intr_handler_s omap_intr_handler;
-#define OMAP_INTC(obj)                                              \
-    OBJECT_CHECK(omap_intr_handler, (obj), TYPE_OMAP_INTC)
+DECLARE_INSTANCE_CHECKER(omap_intr_handler, OMAP_INTC,
+                         TYPE_OMAP_INTC)
 
 
 /*
@@ -95,7 +95,8 @@ void omap_intc_set_fclk(omap_intr_handler *intc, omap_clk clk);
 /* omap_i2c.c */
 #define TYPE_OMAP_I2C "omap_i2c"
 typedef struct OMAPI2CState OMAPI2CState;
-#define OMAP_I2C(obj) OBJECT_CHECK(OMAPI2CState, (obj), TYPE_OMAP_I2C)
+DECLARE_INSTANCE_CHECKER(OMAPI2CState, OMAP_I2C,
+                         TYPE_OMAP_I2C)
 
 
 /* TODO: clock framework (see above) */
@@ -104,12 +105,12 @@ void omap_i2c_set_fclk(OMAPI2CState *i2c, omap_clk clk);
 
 /* omap_gpio.c */
 #define TYPE_OMAP1_GPIO "omap-gpio"
-#define OMAP1_GPIO(obj)                                         \
-    OBJECT_CHECK(struct omap_gpif_s, (obj), TYPE_OMAP1_GPIO)
+DECLARE_INSTANCE_CHECKER(struct omap_gpif_s, OMAP1_GPIO,
+                         TYPE_OMAP1_GPIO)
 
 #define TYPE_OMAP2_GPIO "omap2-gpio"
-#define OMAP2_GPIO(obj)                                         \
-    OBJECT_CHECK(struct omap2_gpif_s, (obj), TYPE_OMAP2_GPIO)
+DECLARE_INSTANCE_CHECKER(struct omap2_gpif_s, OMAP2_GPIO,
+                         TYPE_OMAP2_GPIO)
 
 typedef struct omap_gpif_s omap_gpif;
 typedef struct omap2_gpif_s omap2_gpif;
include/hw/arm/pxa.h +8 -6
index b2f9a41468..9046876134 100644
@@ -89,7 +89,8 @@ void pxa2xx_lcd_vsync_notifier(PXA2xxLCDState *s, qemu_irq handler);
 /* pxa2xx_mmci.c */
 #define TYPE_PXA2XX_MMCI "pxa2xx-mmci"
 typedef struct PXA2xxMMCIState PXA2xxMMCIState;
-#define PXA2XX_MMCI(obj) OBJECT_CHECK(PXA2xxMMCIState, (obj), TYPE_PXA2XX_MMCI)
+DECLARE_INSTANCE_CHECKER(PXA2xxMMCIState, PXA2XX_MMCI,
+                         TYPE_PXA2XX_MMCI)
 
 PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
                 hwaddr base,
@@ -100,8 +101,8 @@ void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq readonly,
 /* pxa2xx_pcmcia.c */
 #define TYPE_PXA2XX_PCMCIA "pxa2xx-pcmcia"
 typedef struct PXA2xxPCMCIAState PXA2xxPCMCIAState;
-#define PXA2XX_PCMCIA(obj) \
-    OBJECT_CHECK(PXA2xxPCMCIAState, obj, TYPE_PXA2XX_PCMCIA)
+DECLARE_INSTANCE_CHECKER(PXA2xxPCMCIAState, PXA2XX_PCMCIA,
+                         TYPE_PXA2XX_PCMCIA)
 
 PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem,
                                       hwaddr base);
@@ -129,12 +130,13 @@ I2CBus *pxa2xx_i2c_bus(PXA2xxI2CState *s);
 
 #define TYPE_PXA2XX_I2C "pxa2xx_i2c"
 typedef struct PXA2xxI2SState PXA2xxI2SState;
-#define PXA2XX_I2C(obj) \
-    OBJECT_CHECK(PXA2xxI2CState, (obj), TYPE_PXA2XX_I2C)
+DECLARE_INSTANCE_CHECKER(PXA2xxI2CState, PXA2XX_I2C,
+                         TYPE_PXA2XX_I2C)
 
 #define TYPE_PXA2XX_FIR "pxa2xx-fir"
 typedef struct PXA2xxFIrState PXA2xxFIrState;
-#define PXA2XX_FIR(obj) OBJECT_CHECK(PXA2xxFIrState, (obj), TYPE_PXA2XX_FIR)
+DECLARE_INSTANCE_CHECKER(PXA2xxFIrState, PXA2XX_FIR,
+                         TYPE_PXA2XX_FIR)
 
 typedef struct {
     ARMCPU *cpu;
include/hw/arm/smmu-common.h +2 -5
index b6b51a1cb1..54d0872fd8 100644
@@ -132,11 +132,8 @@ struct SMMUBaseClass {
 typedef struct SMMUBaseClass SMMUBaseClass;
 
 #define TYPE_ARM_SMMU "arm-smmu"
-#define ARM_SMMU(obj) OBJECT_CHECK(SMMUState, (obj), TYPE_ARM_SMMU)
-#define ARM_SMMU_CLASS(klass)                                    \
-    OBJECT_CLASS_CHECK(SMMUBaseClass, (klass), TYPE_ARM_SMMU)
-#define ARM_SMMU_GET_CLASS(obj)                              \
-    OBJECT_GET_CLASS(SMMUBaseClass, (obj), TYPE_ARM_SMMU)
+DECLARE_OBJ_CHECKERS(SMMUState, SMMUBaseClass,
+                     ARM_SMMU, TYPE_ARM_SMMU)
 
 /* Return the SMMUPciBus handle associated to a PCI bus number */
 SMMUPciBus *smmu_find_smmu_pcibus(SMMUState *s, uint8_t bus_num);
include/hw/arm/smmuv3.h +2 -5
index 698b89d234..2a3f6dd197 100644
@@ -83,10 +83,7 @@ struct SMMUv3Class {
 typedef struct SMMUv3Class SMMUv3Class;
 
 #define TYPE_ARM_SMMUV3   "arm-smmuv3"
-#define ARM_SMMUV3(obj) OBJECT_CHECK(SMMUv3State, (obj), TYPE_ARM_SMMUV3)
-#define ARM_SMMUV3_CLASS(klass)                              \
-    OBJECT_CLASS_CHECK(SMMUv3Class, (klass), TYPE_ARM_SMMUV3)
-#define ARM_SMMUV3_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(SMMUv3Class, (obj), TYPE_ARM_SMMUV3)
+DECLARE_OBJ_CHECKERS(SMMUv3State, SMMUv3Class,
+                     ARM_SMMUV3, TYPE_ARM_SMMUV3)
 
 #endif
include/hw/arm/stm32f205_soc.h +2 -2
index 6d86937e07..9c2f4818a6 100644
@@ -36,8 +36,8 @@
 
 #define TYPE_STM32F205_SOC "stm32f205-soc"
 typedef struct STM32F205State STM32F205State;
-#define STM32F205_SOC(obj) \
-    OBJECT_CHECK(STM32F205State, (obj), TYPE_STM32F205_SOC)
+DECLARE_INSTANCE_CHECKER(STM32F205State, STM32F205_SOC,
+                         TYPE_STM32F205_SOC)
 
 #define STM_NUM_USARTS 6
 #define STM_NUM_TIMERS 4
include/hw/arm/stm32f405_soc.h +2 -2
index 8f44fb2046..f1a22763f4 100644
@@ -37,8 +37,8 @@
 
 #define TYPE_STM32F405_SOC "stm32f405-soc"
 typedef struct STM32F405State STM32F405State;
-#define STM32F405_SOC(obj) \
-    OBJECT_CHECK(STM32F405State, (obj), TYPE_STM32F405_SOC)
+DECLARE_INSTANCE_CHECKER(STM32F405State, STM32F405_SOC,
+                         TYPE_STM32F405_SOC)
 
 #define STM_NUM_USARTS 7
 #define STM_NUM_TIMERS 4
include/hw/arm/virt.h +2 -6
index 49ad860943..392b0bd571 100644
@@ -170,12 +170,8 @@ typedef struct VirtMachineState VirtMachineState;
 #define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM)
 
 #define TYPE_VIRT_MACHINE   MACHINE_TYPE_NAME("virt")
-#define VIRT_MACHINE(obj) \
-    OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE)
-#define VIRT_MACHINE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(VirtMachineClass, obj, TYPE_VIRT_MACHINE)
-#define VIRT_MACHINE_CLASS(klass) \
-    OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_VIRT_MACHINE)
+DECLARE_OBJ_CHECKERS(VirtMachineState, VirtMachineClass,
+                     VIRT_MACHINE, TYPE_VIRT_MACHINE)
 
 void virt_acpi_setup(VirtMachineState *vms);
 bool virt_is_acpi_enabled(VirtMachineState *vms);
include/hw/arm/xlnx-versal.h +2 -1
index a960619ec9..eaa9023fd6 100644
@@ -24,7 +24,8 @@
 
 #define TYPE_XLNX_VERSAL "xlnx-versal"
 typedef struct Versal Versal;
-#define XLNX_VERSAL(obj) OBJECT_CHECK(Versal, (obj), TYPE_XLNX_VERSAL)
+DECLARE_INSTANCE_CHECKER(Versal, XLNX_VERSAL,
+                         TYPE_XLNX_VERSAL)
 
 #define XLNX_VERSAL_NR_ACPUS   2
 #define XLNX_VERSAL_NR_UARTS   2
include/hw/arm/xlnx-zynqmp.h +2 -2
index 6a24216abf..4cc97b4610 100644
@@ -36,8 +36,8 @@
 
 #define TYPE_XLNX_ZYNQMP "xlnx,zynqmp"
 typedef struct XlnxZynqMPState XlnxZynqMPState;
-#define XLNX_ZYNQMP(obj) OBJECT_CHECK(XlnxZynqMPState, (obj), \
-                                       TYPE_XLNX_ZYNQMP)
+DECLARE_INSTANCE_CHECKER(XlnxZynqMPState, XLNX_ZYNQMP,
+                         TYPE_XLNX_ZYNQMP)
 
 #define XLNX_ZYNQMP_NUM_APU_CPUS 4
 #define XLNX_ZYNQMP_NUM_RPU_CPUS 2
include/hw/block/flash.h +4 -4
index 9b2fa7e92c..3e26303705 100644
@@ -10,8 +10,8 @@
 
 #define TYPE_PFLASH_CFI01 "cfi.pflash01"
 typedef struct PFlashCFI01 PFlashCFI01;
-#define PFLASH_CFI01(obj) \
-    OBJECT_CHECK(PFlashCFI01, (obj), TYPE_PFLASH_CFI01)
+DECLARE_INSTANCE_CHECKER(PFlashCFI01, PFLASH_CFI01,
+                         TYPE_PFLASH_CFI01)
 
 
 PFlashCFI01 *pflash_cfi01_register(hwaddr base,
@@ -31,8 +31,8 @@ void pflash_cfi01_legacy_drive(PFlashCFI01 *dev, DriveInfo *dinfo);
 
 #define TYPE_PFLASH_CFI02 "cfi.pflash02"
 typedef struct PFlashCFI02 PFlashCFI02;
-#define PFLASH_CFI02(obj) \
-    OBJECT_CHECK(PFlashCFI02, (obj), TYPE_PFLASH_CFI02)
+DECLARE_INSTANCE_CHECKER(PFlashCFI02, PFLASH_CFI02,
+                         TYPE_PFLASH_CFI02)
 
 
 PFlashCFI02 *pflash_cfi02_register(hwaddr base,
include/hw/block/swim.h +6 -3
index f013d634f7..8287da7c30 100644
@@ -22,7 +22,8 @@ typedef struct SWIMBus SWIMBus;
 typedef struct SWIMCtrl SWIMCtrl;
 
 #define TYPE_SWIM_DRIVE "swim-drive"
-#define SWIM_DRIVE(obj) OBJECT_CHECK(SWIMDrive, (obj), TYPE_SWIM_DRIVE)
+DECLARE_INSTANCE_CHECKER(SWIMDrive, SWIM_DRIVE,
+                         TYPE_SWIM_DRIVE)
 
 struct SWIMDrive {
     DeviceState qdev;
@@ -31,7 +32,8 @@ struct SWIMDrive {
 };
 
 #define TYPE_SWIM_BUS "swim-bus"
-#define SWIM_BUS(obj) OBJECT_CHECK(SWIMBus, (obj), TYPE_SWIM_BUS)
+DECLARE_INSTANCE_CHECKER(SWIMBus, SWIM_BUS,
+                         TYPE_SWIM_BUS)
 
 struct SWIMBus {
     BusState bus;
@@ -69,7 +71,8 @@ struct SWIMCtrl {
 
 #define TYPE_SWIM "swim"
 typedef struct Swim Swim;
-#define SWIM(obj) OBJECT_CHECK(Swim, (obj), TYPE_SWIM)
+DECLARE_INSTANCE_CHECKER(Swim, SWIM,
+                         TYPE_SWIM)
 
 struct Swim {
     SysBusDevice parent_obj;
include/hw/boards.h +2 -6
index bc5b82ad20..795910d01b 100644
@@ -21,12 +21,8 @@
 
 #define TYPE_MACHINE "machine"
 #undef MACHINE  /* BSD defines it and QEMU does not use it */
-#define MACHINE(obj) \
-    OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE)
-#define MACHINE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(MachineClass, (obj), TYPE_MACHINE)
-#define MACHINE_CLASS(klass) \
-    OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE)
+DECLARE_OBJ_CHECKERS(MachineState, MachineClass,
+                     MACHINE, TYPE_MACHINE)
 
 extern MachineState *current_machine;
 
include/hw/char/avr_usart.h +2 -2
index 67ad345edd..5202f152b0 100644
@@ -59,8 +59,8 @@
 
 #define TYPE_AVR_USART "avr-usart"
 typedef struct AVRUsartState AVRUsartState;
-#define AVR_USART(obj) \
-    OBJECT_CHECK(AVRUsartState, (obj), TYPE_AVR_USART)
+DECLARE_INSTANCE_CHECKER(AVRUsartState, AVR_USART,
+                         TYPE_AVR_USART)
 
 struct AVRUsartState {
     /* <private> */
include/hw/char/bcm2835_aux.h +2 -1
index 2647becc52..a08795c47f 100644
@@ -15,7 +15,8 @@
 
 #define TYPE_BCM2835_AUX "bcm2835-aux"
 typedef struct BCM2835AuxState BCM2835AuxState;
-#define BCM2835_AUX(obj) OBJECT_CHECK(BCM2835AuxState, (obj), TYPE_BCM2835_AUX)
+DECLARE_INSTANCE_CHECKER(BCM2835AuxState, BCM2835_AUX,
+                         TYPE_BCM2835_AUX)
 
 #define BCM2835_AUX_RX_FIFO_LEN 8
 
include/hw/char/cadence_uart.h +2 -2
index 3d02d6ef1a..1734f53541 100644
@@ -33,8 +33,8 @@
 
 #define TYPE_CADENCE_UART "cadence_uart"
 typedef struct CadenceUARTState CadenceUARTState;
-#define CADENCE_UART(obj) OBJECT_CHECK(CadenceUARTState, (obj), \
-                                       TYPE_CADENCE_UART)
+DECLARE_INSTANCE_CHECKER(CadenceUARTState, CADENCE_UART,
+                         TYPE_CADENCE_UART)
 
 struct CadenceUARTState {
     /*< private >*/
include/hw/char/cmsdk-apb-uart.h +2 -2
index 32c0df9df3..2c3869aa16 100644
@@ -19,8 +19,8 @@
 
 #define TYPE_CMSDK_APB_UART "cmsdk-apb-uart"
 typedef struct CMSDKAPBUART CMSDKAPBUART;
-#define CMSDK_APB_UART(obj) OBJECT_CHECK(CMSDKAPBUART, (obj), \
-                                         TYPE_CMSDK_APB_UART)
+DECLARE_INSTANCE_CHECKER(CMSDKAPBUART, CMSDK_APB_UART,
+                         TYPE_CMSDK_APB_UART)
 
 struct CMSDKAPBUART {
     /*< private >*/
include/hw/char/digic-uart.h +2 -2
index 7c6ec2a5c5..01d406833d 100644
@@ -24,8 +24,8 @@
 
 #define TYPE_DIGIC_UART "digic-uart"
 typedef struct DigicUartState DigicUartState;
-#define DIGIC_UART(obj) \
-    OBJECT_CHECK(DigicUartState, (obj), TYPE_DIGIC_UART)
+DECLARE_INSTANCE_CHECKER(DigicUartState, DIGIC_UART,
+                         TYPE_DIGIC_UART)
 
 enum {
     R_TX = 0x00,
include/hw/char/escc.h +2 -1
index 5de2a39e77..5eaec507da 100644
@@ -12,7 +12,8 @@
 #define ESCC_SIZE 4
 
 typedef struct ESCCState ESCCState;
-#define ESCC(obj) OBJECT_CHECK(ESCCState, (obj), TYPE_ESCC)
+DECLARE_INSTANCE_CHECKER(ESCCState, ESCC,
+                         TYPE_ESCC)
 
 typedef enum {
     escc_chn_a, escc_chn_b,
include/hw/char/ibex_uart.h +2 -2
index ec9fcde8f0..36eb75fc4c 100644
@@ -71,8 +71,8 @@ REG32(TIMEOUT_CTRL, 0x2c)
 
 #define TYPE_IBEX_UART "ibex-uart"
 typedef struct IbexUartState IbexUartState;
-#define IBEX_UART(obj) \
-    OBJECT_CHECK(IbexUartState, (obj), TYPE_IBEX_UART)
+DECLARE_INSTANCE_CHECKER(IbexUartState, IBEX_UART,
+                         TYPE_IBEX_UART)
 
 struct IbexUartState {
     /* <private> */
include/hw/char/imx_serial.h +2 -1
index bfaf8ec695..200f1ec33a 100644
@@ -24,7 +24,8 @@
 
 #define TYPE_IMX_SERIAL "imx.serial"
 typedef struct IMXSerialState IMXSerialState;
-#define IMX_SERIAL(obj) OBJECT_CHECK(IMXSerialState, (obj), TYPE_IMX_SERIAL)
+DECLARE_INSTANCE_CHECKER(IMXSerialState, IMX_SERIAL,
+                         TYPE_IMX_SERIAL)
 
 #define URXD_CHARRDY    (1<<15)   /* character read is valid */
 #define URXD_ERR        (1<<14)   /* Character has error */
include/hw/char/nrf51_uart.h +2 -1
index 20560ba6dc..0cf3c4e328 100644
@@ -21,7 +21,8 @@
 
 #define TYPE_NRF51_UART "nrf51_soc.uart"
 typedef struct NRF51UARTState NRF51UARTState;
-#define NRF51_UART(obj) OBJECT_CHECK(NRF51UARTState, (obj), TYPE_NRF51_UART)
+DECLARE_INSTANCE_CHECKER(NRF51UARTState, NRF51_UART,
+                         TYPE_NRF51_UART)
 
 REG32(UART_STARTRX, 0x000)
 REG32(UART_STOPRX, 0x004)
include/hw/char/pl011.h +2 -1
index ddbd8ad45b..80de4ecde6 100644
@@ -23,7 +23,8 @@
 
 #define TYPE_PL011 "pl011"
 typedef struct PL011State PL011State;
-#define PL011(obj) OBJECT_CHECK(PL011State, (obj), TYPE_PL011)
+DECLARE_INSTANCE_CHECKER(PL011State, PL011,
+                         TYPE_PL011)
 
 /* This shares the same struct (and cast macro) as the base pl011 device */
 #define TYPE_PL011_LUMINARY "pl011_luminary"
include/hw/char/renesas_sci.h +2 -1
index 5a5ebfd28c..a4764e3eee 100644
@@ -15,7 +15,8 @@
 
 #define TYPE_RENESAS_SCI "renesas-sci"
 typedef struct RSCIState RSCIState;
-#define RSCI(obj) OBJECT_CHECK(RSCIState, (obj), TYPE_RENESAS_SCI)
+DECLARE_INSTANCE_CHECKER(RSCIState, RSCI,
+                         TYPE_RENESAS_SCI)
 
 enum {
     ERI = 0,
include/hw/char/serial.h +6 -3
index dbeef43676..264f529a7f 100644
@@ -104,13 +104,16 @@ extern const MemoryRegionOps serial_io_ops;
 void serial_set_frequency(SerialState *s, uint32_t frequency);
 
 #define TYPE_SERIAL "serial"
-#define SERIAL(s) OBJECT_CHECK(SerialState, (s), TYPE_SERIAL)
+DECLARE_INSTANCE_CHECKER(SerialState, SERIAL,
+                         TYPE_SERIAL)
 
 #define TYPE_SERIAL_MM "serial-mm"
-#define SERIAL_MM(s) OBJECT_CHECK(SerialMM, (s), TYPE_SERIAL_MM)
+DECLARE_INSTANCE_CHECKER(SerialMM, SERIAL_MM,
+                         TYPE_SERIAL_MM)
 
 #define TYPE_SERIAL_IO "serial-io"
-#define SERIAL_IO(s) OBJECT_CHECK(SerialIO, (s), TYPE_SERIAL_IO)
+DECLARE_INSTANCE_CHECKER(SerialIO, SERIAL_IO,
+                         TYPE_SERIAL_IO)
 
 SerialMM *serial_mm_init(MemoryRegion *address_space,
                          hwaddr base, int regshift,
include/hw/char/stm32f2xx_usart.h +2 -2
index c44faca751..1670c076d4 100644
@@ -55,8 +55,8 @@
 
 #define TYPE_STM32F2XX_USART "stm32f2xx-usart"
 typedef struct STM32F2XXUsartState STM32F2XXUsartState;
-#define STM32F2XX_USART(obj) \
-    OBJECT_CHECK(STM32F2XXUsartState, (obj), TYPE_STM32F2XX_USART)
+DECLARE_INSTANCE_CHECKER(STM32F2XXUsartState, STM32F2XX_USART,
+                         TYPE_STM32F2XX_USART)
 
 struct STM32F2XXUsartState {
     /* <private> */
include/hw/clock.h +2 -1
index 65cf363dd5..b524509b47 100644
@@ -19,7 +19,8 @@
 
 #define TYPE_CLOCK "clock"
 typedef struct Clock Clock;
-#define CLOCK(obj) OBJECT_CHECK(Clock, (obj), TYPE_CLOCK)
+DECLARE_INSTANCE_CHECKER(Clock, CLOCK,
+                         TYPE_CLOCK)
 
 typedef void ClockCallback(void *opaque);
 
include/hw/core/cpu.h +2 -2
index b22bb54c82..99dc33ffeb 100644
@@ -63,8 +63,8 @@ typedef uint64_t vaddr;
 #define CPU(obj) ((CPUState *)(obj))
 
 typedef struct CPUClass CPUClass;
-#define CPU_CLASS(class) OBJECT_CLASS_CHECK(CPUClass, (class), TYPE_CPU)
-#define CPU_GET_CLASS(obj) OBJECT_GET_CLASS(CPUClass, (obj), TYPE_CPU)
+DECLARE_CLASS_CHECKERS(CPUClass, CPU,
+                       TYPE_CPU)
 
 typedef enum MMUAccessType {
     MMU_DATA_LOAD  = 0,
include/hw/core/generic-loader.h +2 -2
index f435af1884..8e86532df6 100644
@@ -43,7 +43,7 @@ struct GenericLoaderState {
 typedef struct GenericLoaderState GenericLoaderState;
 
 #define TYPE_GENERIC_LOADER "loader"
-#define GENERIC_LOADER(obj) OBJECT_CHECK(GenericLoaderState, (obj), \
-                                         TYPE_GENERIC_LOADER)
+DECLARE_INSTANCE_CHECKER(GenericLoaderState, GENERIC_LOADER,
+                         TYPE_GENERIC_LOADER)
 
 #endif
include/hw/core/split-irq.h +2 -1
index 872a39aa4f..76d42b29aa 100644
@@ -44,7 +44,8 @@
 
 typedef struct SplitIRQ SplitIRQ;
 
-#define SPLIT_IRQ(obj) OBJECT_CHECK(SplitIRQ, (obj), TYPE_SPLIT_IRQ)
+DECLARE_INSTANCE_CHECKER(SplitIRQ, SPLIT_IRQ,
+                         TYPE_SPLIT_IRQ)
 
 struct SplitIRQ {
     DeviceState parent_obj;
include/hw/cpu/a15mpcore.h +2 -2
index 01415728d0..58d8ac7415 100644
@@ -28,8 +28,8 @@
 
 #define TYPE_A15MPCORE_PRIV "a15mpcore_priv"
 typedef struct A15MPPrivState A15MPPrivState;
-#define A15MPCORE_PRIV(obj) \
-    OBJECT_CHECK(A15MPPrivState, (obj), TYPE_A15MPCORE_PRIV)
+DECLARE_INSTANCE_CHECKER(A15MPPrivState, A15MPCORE_PRIV,
+                         TYPE_A15MPCORE_PRIV)
 
 struct A15MPPrivState {
     /*< private >*/
include/hw/cpu/a9mpcore.h +2 -2
index 1a3b32cc4c..37e5cfce08 100644
@@ -19,8 +19,8 @@
 
 #define TYPE_A9MPCORE_PRIV "a9mpcore_priv"
 typedef struct A9MPPrivState A9MPPrivState;
-#define A9MPCORE_PRIV(obj) \
-    OBJECT_CHECK(A9MPPrivState, (obj), TYPE_A9MPCORE_PRIV)
+DECLARE_INSTANCE_CHECKER(A9MPPrivState, A9MPCORE_PRIV,
+                         TYPE_A9MPCORE_PRIV)
 
 struct A9MPPrivState {
     /*< private >*/
include/hw/cpu/arm11mpcore.h +2 -2
index 5a5575b86d..411d7e6659 100644
@@ -18,8 +18,8 @@
 
 #define TYPE_ARM11MPCORE_PRIV "arm11mpcore_priv"
 typedef struct ARM11MPCorePriveState ARM11MPCorePriveState;
-#define ARM11MPCORE_PRIV(obj) \
-    OBJECT_CHECK(ARM11MPCorePriveState, (obj), TYPE_ARM11MPCORE_PRIV)
+DECLARE_INSTANCE_CHECKER(ARM11MPCorePriveState, ARM11MPCORE_PRIV,
+                         TYPE_ARM11MPCORE_PRIV)
 
 struct ARM11MPCorePriveState {
     SysBusDevice parent_obj;
include/hw/cpu/cluster.h +2 -2
index faacf9757e..1c807c5902 100644
@@ -56,8 +56,8 @@
 
 #define TYPE_CPU_CLUSTER "cpu-cluster"
 typedef struct CPUClusterState CPUClusterState;
-#define CPU_CLUSTER(obj) \
-    OBJECT_CHECK(CPUClusterState, (obj), TYPE_CPU_CLUSTER)
+DECLARE_INSTANCE_CHECKER(CPUClusterState, CPU_CLUSTER,
+                         TYPE_CPU_CLUSTER)
 
 /*
  * This limit is imposed by TCG, which puts the cluster ID into an
include/hw/cpu/core.h +2 -2
index 850191527e..61ea3481f8 100644
@@ -15,8 +15,8 @@
 #define TYPE_CPU_CORE "cpu-core"
 
 typedef struct CPUCore CPUCore;
-#define CPU_CORE(obj) \
-    OBJECT_CHECK(CPUCore, (obj), TYPE_CPU_CORE)
+DECLARE_INSTANCE_CHECKER(CPUCore, CPU_CORE,
+                         TYPE_CPU_CORE)
 
 struct CPUCore {
     /*< private >*/
include/hw/display/bcm2835_fb.h +2 -1
index 5fc4d74a06..226d77a264 100644
@@ -18,7 +18,8 @@
 
 #define TYPE_BCM2835_FB "bcm2835-fb"
 typedef struct BCM2835FBState BCM2835FBState;
-#define BCM2835_FB(obj) OBJECT_CHECK(BCM2835FBState, (obj), TYPE_BCM2835_FB)
+DECLARE_INSTANCE_CHECKER(BCM2835FBState, BCM2835_FB,
+                         TYPE_BCM2835_FB)
 
 /*
  * Configuration information about the fb which the guest can program
include/hw/display/dpcd.h +2 -1
index 6b96a463a7..09304dd1f6 100644
@@ -29,7 +29,8 @@
 typedef struct DPCDState DPCDState;
 
 #define TYPE_DPCD "dpcd"
-#define DPCD(obj) OBJECT_CHECK(DPCDState, (obj), TYPE_DPCD)
+DECLARE_INSTANCE_CHECKER(DPCDState, DPCD,
+                         TYPE_DPCD)
 
 /* DCPD Revision. */
 #define DPCD_REVISION                           0x00
include/hw/display/i2c-ddc.h +2 -1
index 8ab50641aa..fbabfea5a9 100644
@@ -37,6 +37,7 @@ struct I2CDDCState {
 typedef struct I2CDDCState I2CDDCState;
 
 #define TYPE_I2CDDC "i2c-ddc"
-#define I2CDDC(obj) OBJECT_CHECK(I2CDDCState, (obj), TYPE_I2CDDC)
+DECLARE_INSTANCE_CHECKER(I2CDDCState, I2CDDC,
+                         TYPE_I2CDDC)
 
 #endif /* I2C_DDC_H */
include/hw/display/macfb.h +4 -8
index d330ee9823..0960480b75 100644
@@ -33,8 +33,8 @@ typedef struct MacfbState {
 
 #define TYPE_MACFB "sysbus-macfb"
 typedef struct MacfbSysBusState MacfbSysBusState;
-#define MACFB(obj) \
-    OBJECT_CHECK(MacfbSysBusState, (obj), TYPE_MACFB)
+DECLARE_INSTANCE_CHECKER(MacfbSysBusState, MACFB,
+                         TYPE_MACFB)
 
 struct MacfbSysBusState {
     SysBusDevice busdev;
@@ -45,10 +45,8 @@ struct MacfbSysBusState {
 #define TYPE_NUBUS_MACFB "nubus-macfb"
 typedef struct MacfbNubusDeviceClass MacfbNubusDeviceClass;
 typedef struct MacfbNubusState MacfbNubusState;
-#define NUBUS_MACFB_CLASS(class) \
-    OBJECT_CLASS_CHECK(MacfbNubusDeviceClass, (class), TYPE_NUBUS_MACFB)
-#define NUBUS_MACFB_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(MacfbNubusDeviceClass, (obj), TYPE_NUBUS_MACFB)
+DECLARE_OBJ_CHECKERS(MacfbNubusState, MacfbNubusDeviceClass,
+                     NUBUS_MACFB, TYPE_NUBUS_MACFB)
 
 struct MacfbNubusDeviceClass {
     DeviceClass parent_class;
@@ -56,8 +54,6 @@ struct MacfbNubusDeviceClass {
     DeviceRealize parent_realize;
 };
 
-#define NUBUS_MACFB(obj) \
-    OBJECT_CHECK(MacfbNubusState, (obj), TYPE_NUBUS_MACFB)
 
 struct MacfbNubusState {
     NubusDevice busdev;
include/hw/display/xlnx_dp.h +2 -1
index f76bde2e77..3b7d9e5a2a 100644
@@ -106,6 +106,7 @@ struct XlnxDPState {
 typedef struct XlnxDPState XlnxDPState;
 
 #define TYPE_XLNX_DP "xlnx.v-dp"
-#define XLNX_DP(obj) OBJECT_CHECK(XlnxDPState, (obj), TYPE_XLNX_DP)
+DECLARE_INSTANCE_CHECKER(XlnxDPState, XLNX_DP,
+                         TYPE_XLNX_DP)
 
 #endif
include/hw/dma/bcm2835_dma.h +2 -2
index 31f335ec5b..b94dae779a 100644
@@ -27,8 +27,8 @@ typedef struct {
 
 #define TYPE_BCM2835_DMA "bcm2835-dma"
 typedef struct BCM2835DMAState BCM2835DMAState;
-#define BCM2835_DMA(obj) \
-        OBJECT_CHECK(BCM2835DMAState, (obj), TYPE_BCM2835_DMA)
+DECLARE_INSTANCE_CHECKER(BCM2835DMAState, BCM2835_DMA,
+                         TYPE_BCM2835_DMA)
 
 #define BCM2835_DMA_NCHANS 16
 
include/hw/dma/i8257.h +2 -2
index 46eef1f581..362ce7b8dc 100644
@@ -7,8 +7,8 @@
 
 #define TYPE_I8257 "i8257"
 typedef struct I8257State I8257State;
-#define I8257(obj) \
-    OBJECT_CHECK(I8257State, (obj), TYPE_I8257)
+DECLARE_INSTANCE_CHECKER(I8257State, I8257,
+                         TYPE_I8257)
 
 typedef struct I8257Regs {
     int now[2];
include/hw/dma/pl080.h +2 -1
index 55a645b055..e9669bf5ae 100644
@@ -44,7 +44,8 @@ typedef struct {
 #define TYPE_PL080 "pl080"
 #define TYPE_PL081 "pl081"
 typedef struct PL080State PL080State;
-#define PL080(obj) OBJECT_CHECK(PL080State, (obj), TYPE_PL080)
+DECLARE_INSTANCE_CHECKER(PL080State, PL080,
+                         TYPE_PL080)
 
 struct PL080State {
     SysBusDevice parent_obj;
include/hw/dma/xlnx-zdma.h +2 -2
index 8be9ee5cc2..f638abe568 100644
@@ -80,7 +80,7 @@ typedef struct XlnxZDMA XlnxZDMA;
 
 #define TYPE_XLNX_ZDMA "xlnx.zdma"
 
-#define XLNX_ZDMA(obj) \
-     OBJECT_CHECK(XlnxZDMA, (obj), TYPE_XLNX_ZDMA)
+DECLARE_INSTANCE_CHECKER(XlnxZDMA, XLNX_ZDMA,
+                         TYPE_XLNX_ZDMA)
 
 #endif /* XLNX_ZDMA_H */
include/hw/dma/xlnx-zynq-devcfg.h +2 -2
index 52ba61b653..e16b08f9c5 100644
@@ -34,8 +34,8 @@
 #define TYPE_XLNX_ZYNQ_DEVCFG "xlnx.ps7-dev-cfg"
 
 typedef struct XlnxZynqDevcfg XlnxZynqDevcfg;
-#define XLNX_ZYNQ_DEVCFG(obj) \
-    OBJECT_CHECK(XlnxZynqDevcfg, (obj), TYPE_XLNX_ZYNQ_DEVCFG)
+DECLARE_INSTANCE_CHECKER(XlnxZynqDevcfg, XLNX_ZYNQ_DEVCFG,
+                         TYPE_XLNX_ZYNQ_DEVCFG)
 
 #define XLNX_ZYNQ_DEVCFG_R_MAX (0x100 / 4)
 
include/hw/dma/xlnx_dpdma.h +2 -1
index 50952dd7ce..94b01cad0a 100644
@@ -46,7 +46,8 @@ struct XlnxDPDMAState {
 typedef struct XlnxDPDMAState XlnxDPDMAState;
 
 #define TYPE_XLNX_DPDMA "xlnx.dpdma"
-#define XLNX_DPDMA(obj) OBJECT_CHECK(XlnxDPDMAState, (obj), TYPE_XLNX_DPDMA)
+DECLARE_INSTANCE_CHECKER(XlnxDPDMAState, XLNX_DPDMA,
+                         TYPE_XLNX_DPDMA)
 
 /*
  * xlnx_dpdma_start_operation: Start the operation on the specified channel. The
include/hw/fw-path-provider.h +2 -4
index 1231cca63b..8e1d45651c 100644
@@ -23,10 +23,8 @@
 #define TYPE_FW_PATH_PROVIDER "fw-path-provider"
 
 typedef struct FWPathProviderClass FWPathProviderClass;
-#define FW_PATH_PROVIDER_CLASS(klass) \
-     OBJECT_CLASS_CHECK(FWPathProviderClass, (klass), TYPE_FW_PATH_PROVIDER)
-#define FW_PATH_PROVIDER_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(FWPathProviderClass, (obj), TYPE_FW_PATH_PROVIDER)
+DECLARE_CLASS_CHECKERS(FWPathProviderClass, FW_PATH_PROVIDER,
+                       TYPE_FW_PATH_PROVIDER)
 #define FW_PATH_PROVIDER(obj) \
      INTERFACE_CHECK(FWPathProvider, (obj), TYPE_FW_PATH_PROVIDER)
 
include/hw/gpio/aspeed_gpio.h +2 -5
index 4dc0bc3f3d..2582e6e0dc 100644
@@ -16,11 +16,8 @@
 #define TYPE_ASPEED_GPIO "aspeed.gpio"
 typedef struct AspeedGPIOClass AspeedGPIOClass;
 typedef struct AspeedGPIOState AspeedGPIOState;
-#define ASPEED_GPIO(obj) OBJECT_CHECK(AspeedGPIOState, (obj), TYPE_ASPEED_GPIO)
-#define ASPEED_GPIO_CLASS(klass) \
-     OBJECT_CLASS_CHECK(AspeedGPIOClass, (klass), TYPE_ASPEED_GPIO)
-#define ASPEED_GPIO_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(AspeedGPIOClass, (obj), TYPE_ASPEED_GPIO)
+DECLARE_OBJ_CHECKERS(AspeedGPIOState, AspeedGPIOClass,
+                     ASPEED_GPIO, TYPE_ASPEED_GPIO)
 
 #define ASPEED_GPIO_MAX_NR_SETS 8
 #define ASPEED_REGS_PER_BANK 14
include/hw/gpio/bcm2835_gpio.h +2 -2
index d8268f1461..e06e08a0fe 100644
@@ -36,7 +36,7 @@ struct BCM2835GpioState {
 typedef struct BCM2835GpioState BCM2835GpioState;
 
 #define TYPE_BCM2835_GPIO "bcm2835_gpio"
-#define BCM2835_GPIO(obj) \
-    OBJECT_CHECK(BCM2835GpioState, (obj), TYPE_BCM2835_GPIO)
+DECLARE_INSTANCE_CHECKER(BCM2835GpioState, BCM2835_GPIO,
+                         TYPE_BCM2835_GPIO)
 
 #endif
include/hw/gpio/imx_gpio.h +2 -1
index b7dc689f73..a72b272ace 100644
@@ -25,7 +25,8 @@
 
 #define TYPE_IMX_GPIO "imx.gpio"
 typedef struct IMXGPIOState IMXGPIOState;
-#define IMX_GPIO(obj) OBJECT_CHECK(IMXGPIOState, (obj), TYPE_IMX_GPIO)
+DECLARE_INSTANCE_CHECKER(IMXGPIOState, IMX_GPIO,
+                         TYPE_IMX_GPIO)
 
 #define IMX_GPIO_MEM_SIZE 0x20
 
include/hw/gpio/nrf51_gpio.h +2 -1
index 0c37dd74c0..55d7d24a52 100644
@@ -30,7 +30,8 @@
 #include "qom/object.h"
 #define TYPE_NRF51_GPIO "nrf51_soc.gpio"
 typedef struct NRF51GPIOState NRF51GPIOState;
-#define NRF51_GPIO(obj) OBJECT_CHECK(NRF51GPIOState, (obj), TYPE_NRF51_GPIO)
+DECLARE_INSTANCE_CHECKER(NRF51GPIOState, NRF51_GPIO,
+                         TYPE_NRF51_GPIO)
 
 #define NRF51_GPIO_PINS 32
 
include/hw/hotplug.h +2 -4
index 6536bb01a3..e15f59c8b3 100644
@@ -17,10 +17,8 @@
 #define TYPE_HOTPLUG_HANDLER "hotplug-handler"
 
 typedef struct HotplugHandlerClass HotplugHandlerClass;
-#define HOTPLUG_HANDLER_CLASS(klass) \
-     OBJECT_CLASS_CHECK(HotplugHandlerClass, (klass), TYPE_HOTPLUG_HANDLER)
-#define HOTPLUG_HANDLER_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(HotplugHandlerClass, (obj), TYPE_HOTPLUG_HANDLER)
+DECLARE_CLASS_CHECKERS(HotplugHandlerClass, HOTPLUG_HANDLER,
+                       TYPE_HOTPLUG_HANDLER)
 #define HOTPLUG_HANDLER(obj) \
      INTERFACE_CHECK(HotplugHandler, (obj), TYPE_HOTPLUG_HANDLER)
 
include/hw/hyperv/vmbus-bridge.h +2 -1
index d090d46651..1324873775 100644
@@ -25,7 +25,8 @@ struct VMBusBridge {
 };
 typedef struct VMBusBridge VMBusBridge;
 
-#define VMBUS_BRIDGE(obj) OBJECT_CHECK(VMBusBridge, (obj), TYPE_VMBUS_BRIDGE)
+DECLARE_INSTANCE_CHECKER(VMBusBridge, VMBUS_BRIDGE,
+                         TYPE_VMBUS_BRIDGE)
 
 static inline VMBusBridge *vmbus_bridge_find(void)
 {
include/hw/hyperv/vmbus.h +4 -7
index 282399b8ce..0fe3d3b47c 100644
@@ -22,16 +22,13 @@
 
 typedef struct VMBusDevice VMBusDevice;
 typedef struct VMBusDeviceClass VMBusDeviceClass;
-#define VMBUS_DEVICE(obj) \
-    OBJECT_CHECK(VMBusDevice, (obj), TYPE_VMBUS_DEVICE)
-#define VMBUS_DEVICE_CLASS(klass) \
-    OBJECT_CLASS_CHECK(VMBusDeviceClass, (klass), TYPE_VMBUS_DEVICE)
-#define VMBUS_DEVICE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(VMBusDeviceClass, (obj), TYPE_VMBUS_DEVICE)
+DECLARE_OBJ_CHECKERS(VMBusDevice, VMBusDeviceClass,
+                     VMBUS_DEVICE, TYPE_VMBUS_DEVICE)
 
 #define TYPE_VMBUS "vmbus"
 typedef struct VMBus VMBus;
-#define VMBUS(obj) OBJECT_CHECK(VMBus, (obj), TYPE_VMBUS)
+DECLARE_INSTANCE_CHECKER(VMBus, VMBUS,
+                         TYPE_VMBUS)
 
 /*
  * Object wrapping a GPADL -- GPA Descriptor List -- an array of guest physical
include/hw/i2c/arm_sbcon_i2c.h +2 -2
index ca54867964..ad96781e7a 100644
@@ -20,8 +20,8 @@
 #define TYPE_ARM_SBCON_I2C TYPE_VERSATILE_I2C
 
 typedef struct ArmSbconI2CState ArmSbconI2CState;
-#define ARM_SBCON_I2C(obj) \
-    OBJECT_CHECK(ArmSbconI2CState, (obj), TYPE_ARM_SBCON_I2C)
+DECLARE_INSTANCE_CHECKER(ArmSbconI2CState, ARM_SBCON_I2C,
+                         TYPE_ARM_SBCON_I2C)
 
 struct ArmSbconI2CState {
     /*< private >*/
include/hw/i2c/aspeed_i2c.h +2 -6
index 2c0198e314..695e1c0928 100644
@@ -31,8 +31,8 @@
 #define TYPE_ASPEED_2600_I2C TYPE_ASPEED_I2C "-ast2600"
 typedef struct AspeedI2CClass AspeedI2CClass;
 typedef struct AspeedI2CState AspeedI2CState;
-#define ASPEED_I2C(obj) \
-    OBJECT_CHECK(AspeedI2CState, (obj), TYPE_ASPEED_I2C)
+DECLARE_OBJ_CHECKERS(AspeedI2CState, AspeedI2CClass,
+                     ASPEED_I2C, TYPE_ASPEED_I2C)
 
 #define ASPEED_I2C_NR_BUSSES 16
 #define ASPEED_I2C_MAX_POOL_SIZE 0x800
@@ -75,10 +75,6 @@ struct AspeedI2CState {
     AddressSpace dram_as;
 };
 
-#define ASPEED_I2C_CLASS(klass) \
-     OBJECT_CLASS_CHECK(AspeedI2CClass, (klass), TYPE_ASPEED_I2C)
-#define ASPEED_I2C_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(AspeedI2CClass, (obj), TYPE_ASPEED_I2C)
 
 struct AspeedI2CClass {
     SysBusDeviceClass parent_class;
include/hw/i2c/i2c.h +4 -7
index a22f861451..2074f7c971 100644
@@ -20,12 +20,8 @@ typedef struct I2CSlave I2CSlave;
 
 #define TYPE_I2C_SLAVE "i2c-slave"
 typedef struct I2CSlaveClass I2CSlaveClass;
-#define I2C_SLAVE(obj) \
-     OBJECT_CHECK(I2CSlave, (obj), TYPE_I2C_SLAVE)
-#define I2C_SLAVE_CLASS(klass) \
-     OBJECT_CLASS_CHECK(I2CSlaveClass, (klass), TYPE_I2C_SLAVE)
-#define I2C_SLAVE_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(I2CSlaveClass, (obj), TYPE_I2C_SLAVE)
+DECLARE_OBJ_CHECKERS(I2CSlave, I2CSlaveClass,
+                     I2C_SLAVE, TYPE_I2C_SLAVE)
 
 struct I2CSlaveClass {
     DeviceClass parent_class;
@@ -55,7 +51,8 @@ struct I2CSlave {
 };
 
 #define TYPE_I2C_BUS "i2c-bus"
-#define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS)
+DECLARE_INSTANCE_CHECKER(I2CBus, I2C_BUS,
+                         TYPE_I2C_BUS)
 
 typedef struct I2CNode I2CNode;
 
include/hw/i2c/imx_i2c.h +2 -1
index 285a8f40a4..e7f09104cf 100644
@@ -26,7 +26,8 @@
 
 #define TYPE_IMX_I2C "imx.i2c"
 typedef struct IMXI2CState IMXI2CState;
-#define IMX_I2C(obj) OBJECT_CHECK(IMXI2CState, (obj), TYPE_IMX_I2C)
+DECLARE_INSTANCE_CHECKER(IMXI2CState, IMX_I2C,
+                         TYPE_IMX_I2C)
 
 #define IMX_I2C_MEM_SIZE           0x14
 
include/hw/i2c/microbit_i2c.h +2 -2
index 76ffaff47a..69d70287d7 100644
@@ -28,8 +28,8 @@
 
 #define TYPE_MICROBIT_I2C "microbit.i2c"
 typedef struct MicrobitI2CState MicrobitI2CState;
-#define MICROBIT_I2C(obj) \
-    OBJECT_CHECK(MicrobitI2CState, (obj), TYPE_MICROBIT_I2C)
+DECLARE_INSTANCE_CHECKER(MicrobitI2CState, MICROBIT_I2C,
+                         TYPE_MICROBIT_I2C)
 
 #define MICROBIT_I2C_NREGS (NRF51_PERIPHERAL_SIZE / sizeof(uint32_t))
 
include/hw/i2c/ppc4xx_i2c.h +2 -1
index 3698e054b1..7cbcdaf12f 100644
@@ -33,7 +33,8 @@
 
 #define TYPE_PPC4xx_I2C "ppc4xx-i2c"
 typedef struct PPC4xxI2CState PPC4xxI2CState;
-#define PPC4xx_I2C(obj) OBJECT_CHECK(PPC4xxI2CState, (obj), TYPE_PPC4xx_I2C)
+DECLARE_INSTANCE_CHECKER(PPC4xxI2CState, PPC4xx_I2C,
+                         TYPE_PPC4xx_I2C)
 
 struct PPC4xxI2CState {
     /*< private >*/
include/hw/i2c/smbus_slave.h +2 -6
index 17f2cd2d8d..8d16e4bcd9 100644
@@ -31,12 +31,8 @@
 #define TYPE_SMBUS_DEVICE "smbus-device"
 typedef struct SMBusDevice SMBusDevice;
 typedef struct SMBusDeviceClass SMBusDeviceClass;
-#define SMBUS_DEVICE(obj) \
-     OBJECT_CHECK(SMBusDevice, (obj), TYPE_SMBUS_DEVICE)
-#define SMBUS_DEVICE_CLASS(klass) \
-     OBJECT_CLASS_CHECK(SMBusDeviceClass, (klass), TYPE_SMBUS_DEVICE)
-#define SMBUS_DEVICE_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(SMBusDeviceClass, (obj), TYPE_SMBUS_DEVICE)
+DECLARE_OBJ_CHECKERS(SMBusDevice, SMBusDeviceClass,
+                     SMBUS_DEVICE, TYPE_SMBUS_DEVICE)
 
 
 struct SMBusDeviceClass {
include/hw/i386/apic_internal.h +2 -6
index 124f1fad6f..da38541627 100644
@@ -127,12 +127,8 @@ typedef struct APICCommonState APICCommonState;
 
 #define TYPE_APIC_COMMON "apic-common"
 typedef struct APICCommonClass APICCommonClass;
-#define APIC_COMMON(obj) \
-     OBJECT_CHECK(APICCommonState, (obj), TYPE_APIC_COMMON)
-#define APIC_COMMON_CLASS(klass) \
-     OBJECT_CLASS_CHECK(APICCommonClass, (klass), TYPE_APIC_COMMON)
-#define APIC_COMMON_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(APICCommonClass, (obj), TYPE_APIC_COMMON)
+DECLARE_OBJ_CHECKERS(APICCommonState, APICCommonClass,
+                     APIC_COMMON, TYPE_APIC_COMMON)
 
 struct APICCommonClass {
     DeviceClass parent_class;
include/hw/i386/ich9.h +2 -2
index 8fdac227f2..e750d67975 100644
@@ -25,8 +25,8 @@ void ich9_generate_smi(void);
 
 #define TYPE_ICH9_LPC_DEVICE "ICH9-LPC"
 typedef struct ICH9LPCState ICH9LPCState;
-#define ICH9_LPC_DEVICE(obj) \
-     OBJECT_CHECK(ICH9LPCState, (obj), TYPE_ICH9_LPC_DEVICE)
+DECLARE_INSTANCE_CHECKER(ICH9LPCState, ICH9_LPC_DEVICE,
+                         TYPE_ICH9_LPC_DEVICE)
 
 struct ICH9LPCState {
     /* ICH9 LPC PCI to ISA bridge */
include/hw/i386/intel_iommu.h +2 -2
index 53e5d32d54..98cfc77723 100644
@@ -28,8 +28,8 @@
 
 #define TYPE_INTEL_IOMMU_DEVICE "intel-iommu"
 typedef struct IntelIOMMUState IntelIOMMUState;
-#define INTEL_IOMMU_DEVICE(obj) \
-     OBJECT_CHECK(IntelIOMMUState, (obj), TYPE_INTEL_IOMMU_DEVICE)
+DECLARE_INSTANCE_CHECKER(IntelIOMMUState, INTEL_IOMMU_DEVICE,
+                         TYPE_INTEL_IOMMU_DEVICE)
 
 #define TYPE_INTEL_IOMMU_MEMORY_REGION "intel-iommu-iommu-memory-region"
 
include/hw/i386/ioapic_internal.h +2 -6
index 29ae150727..e9cc2eaf54 100644
@@ -86,12 +86,8 @@ typedef struct IOAPICCommonState IOAPICCommonState;
 
 #define TYPE_IOAPIC_COMMON "ioapic-common"
 typedef struct IOAPICCommonClass IOAPICCommonClass;
-#define IOAPIC_COMMON(obj) \
-     OBJECT_CHECK(IOAPICCommonState, (obj), TYPE_IOAPIC_COMMON)
-#define IOAPIC_COMMON_CLASS(klass) \
-     OBJECT_CLASS_CHECK(IOAPICCommonClass, (klass), TYPE_IOAPIC_COMMON)
-#define IOAPIC_COMMON_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(IOAPICCommonClass, (obj), TYPE_IOAPIC_COMMON)
+DECLARE_OBJ_CHECKERS(IOAPICCommonState, IOAPICCommonClass,
+                     IOAPIC_COMMON, TYPE_IOAPIC_COMMON)
 
 struct IOAPICCommonClass {
     SysBusDeviceClass parent_class;
include/hw/i386/microvm.h +2 -6
index 0556f64206..36dbcdd123 100644
@@ -64,11 +64,7 @@ struct MicrovmMachineState {
 typedef struct MicrovmMachineState MicrovmMachineState;
 
 #define TYPE_MICROVM_MACHINE   MACHINE_TYPE_NAME("microvm")
-#define MICROVM_MACHINE(obj) \
-    OBJECT_CHECK(MicrovmMachineState, (obj), TYPE_MICROVM_MACHINE)
-#define MICROVM_MACHINE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(MicrovmMachineClass, obj, TYPE_MICROVM_MACHINE)
-#define MICROVM_MACHINE_CLASS(class) \
-    OBJECT_CLASS_CHECK(MicrovmMachineClass, class, TYPE_MICROVM_MACHINE)
+DECLARE_OBJ_CHECKERS(MicrovmMachineState, MicrovmMachineClass,
+                     MICROVM_MACHINE, TYPE_MICROVM_MACHINE)
 
 #endif
include/hw/i386/pc.h +2 -6
index 602b57dc5d..421a77acc2 100644
@@ -123,12 +123,8 @@ struct PCMachineClass {
 typedef struct PCMachineClass PCMachineClass;
 
 #define TYPE_PC_MACHINE "generic-pc-machine"
-#define PC_MACHINE(obj) \
-    OBJECT_CHECK(PCMachineState, (obj), TYPE_PC_MACHINE)
-#define PC_MACHINE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(PCMachineClass, (obj), TYPE_PC_MACHINE)
-#define PC_MACHINE_CLASS(klass) \
-    OBJECT_CLASS_CHECK(PCMachineClass, (klass), TYPE_PC_MACHINE)
+DECLARE_OBJ_CHECKERS(PCMachineState, PCMachineClass,
+                     PC_MACHINE, TYPE_PC_MACHINE)
 
 /* ioapic.c */
 
include/hw/i386/x86-iommu.h +2 -6
index dae2eab800..bbfaf44e79 100644
@@ -28,12 +28,8 @@
 #define  TYPE_X86_IOMMU_DEVICE  ("x86-iommu")
 typedef struct X86IOMMUClass X86IOMMUClass;
 typedef struct X86IOMMUState X86IOMMUState;
-#define  X86_IOMMU_DEVICE(obj) \
-    OBJECT_CHECK(X86IOMMUState, (obj), TYPE_X86_IOMMU_DEVICE)
-#define  X86_IOMMU_DEVICE_CLASS(klass) \
-    OBJECT_CLASS_CHECK(X86IOMMUClass, (klass), TYPE_X86_IOMMU_DEVICE)
-#define  X86_IOMMU_DEVICE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(X86IOMMUClass, obj, TYPE_X86_IOMMU_DEVICE)
+DECLARE_OBJ_CHECKERS(X86IOMMUState, X86IOMMUClass,
+                     X86_IOMMU_DEVICE, TYPE_X86_IOMMU_DEVICE)
 
 #define X86_IOMMU_SID_INVALID             (0xffff)
 
include/hw/i386/x86.h +2 -6
index 42d46cc404..1a188a7dea 100644
@@ -77,12 +77,8 @@ typedef struct X86MachineState X86MachineState;
 #define X86_MACHINE_ACPI             "acpi"
 
 #define TYPE_X86_MACHINE   MACHINE_TYPE_NAME("x86")
-#define X86_MACHINE(obj) \
-    OBJECT_CHECK(X86MachineState, (obj), TYPE_X86_MACHINE)
-#define X86_MACHINE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(X86MachineClass, obj, TYPE_X86_MACHINE)
-#define X86_MACHINE_CLASS(class) \
-    OBJECT_CLASS_CHECK(X86MachineClass, class, TYPE_X86_MACHINE)
+DECLARE_OBJ_CHECKERS(X86MachineState, X86MachineClass,
+                     X86_MACHINE, TYPE_X86_MACHINE)
 
 void init_topo_info(X86CPUTopoInfo *topo_info, const X86MachineState *x86ms);
 
include/hw/ide/ahci.h +6 -5
index 110269f152..4cf6813d80 100644
@@ -54,15 +54,16 @@ typedef struct AHCIState {
 typedef struct AHCIPCIState AHCIPCIState;
 
 #define TYPE_ICH9_AHCI "ich9-ahci"
-#define ICH_AHCI(obj) \
-    OBJECT_CHECK(AHCIPCIState, (obj), TYPE_ICH9_AHCI)
+DECLARE_INSTANCE_CHECKER(AHCIPCIState, ICH_AHCI,
+                         TYPE_ICH9_AHCI)
 
 int32_t ahci_get_num_ports(PCIDevice *dev);
 void ahci_ide_create_devs(PCIDevice *dev, DriveInfo **hd);
 
 #define TYPE_SYSBUS_AHCI "sysbus-ahci"
 typedef struct SysbusAHCIState SysbusAHCIState;
-#define SYSBUS_AHCI(obj) OBJECT_CHECK(SysbusAHCIState, (obj), TYPE_SYSBUS_AHCI)
+DECLARE_INSTANCE_CHECKER(SysbusAHCIState, SYSBUS_AHCI,
+                         TYPE_SYSBUS_AHCI)
 
 struct SysbusAHCIState {
     /*< private >*/
@@ -75,8 +76,8 @@ struct SysbusAHCIState {
 
 #define TYPE_ALLWINNER_AHCI "allwinner-ahci"
 typedef struct AllwinnerAHCIState AllwinnerAHCIState;
-#define ALLWINNER_AHCI(obj) \
-        OBJECT_CHECK(AllwinnerAHCIState, (obj), TYPE_ALLWINNER_AHCI)
+DECLARE_INSTANCE_CHECKER(AllwinnerAHCIState, ALLWINNER_AHCI,
+                         TYPE_ALLWINNER_AHCI)
 
 #define ALLWINNER_AHCI_MMIO_OFF  0x80
 #define ALLWINNER_AHCI_MMIO_SIZE 0x80
include/hw/ide/internal.h +4 -7
index 74ea1e324c..eb9eb4e0ae 100644
@@ -26,7 +26,8 @@ typedef struct IDEDMA IDEDMA;
 typedef struct IDEDMAOps IDEDMAOps;
 
 #define TYPE_IDE_BUS "IDE"
-#define IDE_BUS(obj) OBJECT_CHECK(IDEBus, (obj), TYPE_IDE_BUS)
+DECLARE_INSTANCE_CHECKER(IDEBus, IDE_BUS,
+                         TYPE_IDE_BUS)
 
 #define MAX_IDE_DEVS 2
 
@@ -488,12 +489,8 @@ struct IDEBus {
 
 #define TYPE_IDE_DEVICE "ide-device"
 typedef struct IDEDeviceClass IDEDeviceClass;
-#define IDE_DEVICE(obj) \
-     OBJECT_CHECK(IDEDevice, (obj), TYPE_IDE_DEVICE)
-#define IDE_DEVICE_CLASS(klass) \
-     OBJECT_CLASS_CHECK(IDEDeviceClass, (klass), TYPE_IDE_DEVICE)
-#define IDE_DEVICE_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(IDEDeviceClass, (obj), TYPE_IDE_DEVICE)
+DECLARE_OBJ_CHECKERS(IDEDevice, IDEDeviceClass,
+                     IDE_DEVICE, TYPE_IDE_DEVICE)
 
 struct IDEDeviceClass {
     DeviceClass parent_class;
include/hw/ide/pci.h +2 -1
index 7ed1fa101d..b8d7270ec8 100644
@@ -41,7 +41,8 @@ typedef struct BMDMAState {
 
 #define TYPE_PCI_IDE "pci-ide"
 typedef struct PCIIDEState PCIIDEState;
-#define PCI_IDE(obj) OBJECT_CHECK(PCIIDEState, (obj), TYPE_PCI_IDE)
+DECLARE_INSTANCE_CHECKER(PCIIDEState, PCI_IDE,
+                         TYPE_PCI_IDE)
 
 struct PCIIDEState {
     /*< private >*/
include/hw/input/adb.h +4 -6
index ad89a21176..285f70db55 100644
@@ -44,7 +44,8 @@ typedef bool ADBDeviceHasData(ADBDevice *d);
 
 #define TYPE_ADB_DEVICE "adb-device"
 typedef struct ADBDeviceClass ADBDeviceClass;
-#define ADB_DEVICE(obj) OBJECT_CHECK(ADBDevice, (obj), TYPE_ADB_DEVICE)
+DECLARE_OBJ_CHECKERS(ADBDevice, ADBDeviceClass,
+                     ADB_DEVICE, TYPE_ADB_DEVICE)
 
 struct ADBDevice {
     /*< private >*/
@@ -55,10 +56,6 @@ struct ADBDevice {
     int handler;
 };
 
-#define ADB_DEVICE_CLASS(cls) \
-    OBJECT_CLASS_CHECK(ADBDeviceClass, (cls), TYPE_ADB_DEVICE)
-#define ADB_DEVICE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(ADBDeviceClass, (obj), TYPE_ADB_DEVICE)
 
 struct ADBDeviceClass {
     /*< private >*/
@@ -70,7 +67,8 @@ struct ADBDeviceClass {
 };
 
 #define TYPE_ADB_BUS "apple-desktop-bus"
-#define ADB_BUS(obj) OBJECT_CHECK(ADBBusState, (obj), TYPE_ADB_BUS)
+DECLARE_INSTANCE_CHECKER(ADBBusState, ADB_BUS,
+                         TYPE_ADB_BUS)
 
 #define ADB_STATUS_BUSTIMEOUT  0x1
 #define ADB_STATUS_POLLREPLY   0x2
include/hw/input/i8042.h +2 -1
index d4bf584699..f8a3bf88ac 100644
@@ -13,7 +13,8 @@
 
 #define TYPE_I8042 "i8042"
 typedef struct ISAKBDState ISAKBDState;
-#define I8042(obj) OBJECT_CHECK(ISAKBDState, (obj), TYPE_I8042)
+DECLARE_INSTANCE_CHECKER(ISAKBDState, I8042,
+                         TYPE_I8042)
 
 #define I8042_A20_LINE "a20"
 
include/hw/intc/allwinner-a10-pic.h +2 -1
index 692d2a88d0..4d7199480a 100644
@@ -6,7 +6,8 @@
 
 #define TYPE_AW_A10_PIC  "allwinner-a10-pic"
 typedef struct AwA10PICState AwA10PICState;
-#define AW_A10_PIC(obj) OBJECT_CHECK(AwA10PICState, (obj), TYPE_AW_A10_PIC)
+DECLARE_INSTANCE_CHECKER(AwA10PICState, AW_A10_PIC,
+                         TYPE_AW_A10_PIC)
 
 #define AW_A10_PIC_VECTOR       0
 #define AW_A10_PIC_BASE_ADDR    4
include/hw/intc/arm_gic_common.h +2 -6
index 2cbde9b7a9..7080375008 100644
@@ -149,12 +149,8 @@ typedef struct GICState GICState;
 
 #define TYPE_ARM_GIC_COMMON "arm_gic_common"
 typedef struct ARMGICCommonClass ARMGICCommonClass;
-#define ARM_GIC_COMMON(obj) \
-     OBJECT_CHECK(GICState, (obj), TYPE_ARM_GIC_COMMON)
-#define ARM_GIC_COMMON_CLASS(klass) \
-     OBJECT_CLASS_CHECK(ARMGICCommonClass, (klass), TYPE_ARM_GIC_COMMON)
-#define ARM_GIC_COMMON_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(ARMGICCommonClass, (obj), TYPE_ARM_GIC_COMMON)
+DECLARE_OBJ_CHECKERS(GICState, ARMGICCommonClass,
+                     ARM_GIC_COMMON, TYPE_ARM_GIC_COMMON)
 
 struct ARMGICCommonClass {
     /*< private >*/
include/hw/intc/arm_gicv3_common.h +2 -6
index 86fb060320..0331b0ffdb 100644
@@ -281,12 +281,8 @@ GICV3_BITMAP_ACCESSORS(edge_trigger)
 
 #define TYPE_ARM_GICV3_COMMON "arm-gicv3-common"
 typedef struct ARMGICv3CommonClass ARMGICv3CommonClass;
-#define ARM_GICV3_COMMON(obj) \
-     OBJECT_CHECK(GICv3State, (obj), TYPE_ARM_GICV3_COMMON)
-#define ARM_GICV3_COMMON_CLASS(klass) \
-     OBJECT_CLASS_CHECK(ARMGICv3CommonClass, (klass), TYPE_ARM_GICV3_COMMON)
-#define ARM_GICV3_COMMON_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(ARMGICv3CommonClass, (obj), TYPE_ARM_GICV3_COMMON)
+DECLARE_OBJ_CHECKERS(GICv3State, ARMGICv3CommonClass,
+                     ARM_GICV3_COMMON, TYPE_ARM_GICV3_COMMON)
 
 struct ARMGICv3CommonClass {
     /*< private >*/
include/hw/intc/arm_gicv3_its_common.h +2 -6
index 03a0fa335b..5a0952b404 100644
@@ -66,12 +66,8 @@ void gicv3_its_init_mmio(GICv3ITSState *s, const MemoryRegionOps *ops);
 
 #define TYPE_ARM_GICV3_ITS_COMMON "arm-gicv3-its-common"
 typedef struct GICv3ITSCommonClass GICv3ITSCommonClass;
-#define ARM_GICV3_ITS_COMMON(obj) \
-     OBJECT_CHECK(GICv3ITSState, (obj), TYPE_ARM_GICV3_ITS_COMMON)
-#define ARM_GICV3_ITS_COMMON_CLASS(klass) \
-     OBJECT_CLASS_CHECK(GICv3ITSCommonClass, (klass), TYPE_ARM_GICV3_ITS_COMMON)
-#define ARM_GICV3_ITS_COMMON_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(GICv3ITSCommonClass, (obj), TYPE_ARM_GICV3_ITS_COMMON)
+DECLARE_OBJ_CHECKERS(GICv3ITSState, GICv3ITSCommonClass,
+                     ARM_GICV3_ITS_COMMON, TYPE_ARM_GICV3_ITS_COMMON)
 
 struct GICv3ITSCommonClass {
     /*< private >*/
include/hw/intc/armv7m_nvic.h +2 -2
index 63098822fa..bb087b23c3 100644
@@ -18,8 +18,8 @@
 #define TYPE_NVIC "armv7m_nvic"
 
 typedef struct NVICState NVICState;
-#define NVIC(obj) \
-    OBJECT_CHECK(NVICState, (obj), TYPE_NVIC)
+DECLARE_INSTANCE_CHECKER(NVICState, NVIC,
+                         TYPE_NVIC)
 
 /* Highest permitted number of exceptions (architectural limit) */
 #define NVIC_MAX_VECTORS 512
include/hw/intc/aspeed_vic.h +2 -1
index f8844b3327..8f2e67db5a 100644
@@ -18,7 +18,8 @@
 
 #define TYPE_ASPEED_VIC "aspeed.vic"
 typedef struct AspeedVICState AspeedVICState;
-#define ASPEED_VIC(obj) OBJECT_CHECK(AspeedVICState, (obj), TYPE_ASPEED_VIC)
+DECLARE_INSTANCE_CHECKER(AspeedVICState, ASPEED_VIC,
+                         TYPE_ASPEED_VIC)
 
 #define ASPEED_VIC_NR_IRQS 51
 
include/hw/intc/bcm2835_ic.h +2 -1
index 4a9f093025..fd4a767845 100644
@@ -13,7 +13,8 @@
 
 #define TYPE_BCM2835_IC "bcm2835-ic"
 typedef struct BCM2835ICState BCM2835ICState;
-#define BCM2835_IC(obj) OBJECT_CHECK(BCM2835ICState, (obj), TYPE_BCM2835_IC)
+DECLARE_INSTANCE_CHECKER(BCM2835ICState, BCM2835_IC,
+                         TYPE_BCM2835_IC)
 
 #define BCM2835_IC_GPU_IRQ "gpu-irq"
 #define BCM2835_IC_ARM_IRQ "arm-irq"
include/hw/intc/bcm2836_control.h +2 -2
index 7d8a51fc72..f23292776e 100644
@@ -25,8 +25,8 @@
 
 #define TYPE_BCM2836_CONTROL "bcm2836-control"
 typedef struct BCM2836ControlState BCM2836ControlState;
-#define BCM2836_CONTROL(obj) \
-    OBJECT_CHECK(BCM2836ControlState, (obj), TYPE_BCM2836_CONTROL)
+DECLARE_INSTANCE_CHECKER(BCM2836ControlState, BCM2836_CONTROL,
+                         TYPE_BCM2836_CONTROL)
 
 struct BCM2836ControlState {
     /*< private >*/
include/hw/intc/heathrow_pic.h +2 -1
index bd9fc115a8..f8c9bc20ab 100644
@@ -31,7 +31,8 @@
 
 #define TYPE_HEATHROW "heathrow"
 typedef struct HeathrowState HeathrowState;
-#define HEATHROW(obj) OBJECT_CHECK(HeathrowState, (obj), TYPE_HEATHROW)
+DECLARE_INSTANCE_CHECKER(HeathrowState, HEATHROW,
+                         TYPE_HEATHROW)
 
 typedef struct HeathrowPICState {
     uint32_t events;
include/hw/intc/ibex_plic.h +2 -2
index 0125b36267..8da6b03805 100644
@@ -24,8 +24,8 @@
 
 #define TYPE_IBEX_PLIC "ibex-plic"
 typedef struct IbexPlicState IbexPlicState;
-#define IBEX_PLIC(obj) \
-    OBJECT_CHECK(IbexPlicState, (obj), TYPE_IBEX_PLIC)
+DECLARE_INSTANCE_CHECKER(IbexPlicState, IBEX_PLIC,
+                         TYPE_IBEX_PLIC)
 
 struct IbexPlicState {
     /*< private >*/
include/hw/intc/imx_avic.h +2 -1
index 124f29f763..621742533c 100644
@@ -22,7 +22,8 @@
 
 #define TYPE_IMX_AVIC "imx.avic"
 typedef struct IMXAVICState IMXAVICState;
-#define IMX_AVIC(obj) OBJECT_CHECK(IMXAVICState, (obj), TYPE_IMX_AVIC)
+DECLARE_INSTANCE_CHECKER(IMXAVICState, IMX_AVIC,
+                         TYPE_IMX_AVIC)
 
 #define IMX_AVIC_NUM_IRQS 64
 
include/hw/intc/imx_gpcv2.h +2 -1
index 66befda3fd..2d8075e527 100644
@@ -19,6 +19,7 @@ struct IMXGPCv2State {
 typedef struct IMXGPCv2State IMXGPCv2State;
 
 #define TYPE_IMX_GPCV2 "imx-gpcv2"
-#define IMX_GPCV2(obj) OBJECT_CHECK(IMXGPCv2State, (obj), TYPE_IMX_GPCV2)
+DECLARE_INSTANCE_CHECKER(IMXGPCv2State, IMX_GPCV2,
+                         TYPE_IMX_GPCV2)
 
 #endif /* IMX_GPCV2_H */
include/hw/intc/intc.h +1 -5
index b51c0ac0f4..7018f608ca 100644
@@ -6,12 +6,8 @@
 #define TYPE_INTERRUPT_STATS_PROVIDER "intctrl"
 
 typedef struct InterruptStatsProviderClass InterruptStatsProviderClass;
-#define INTERRUPT_STATS_PROVIDER_CLASS(klass) \
-    OBJECT_CLASS_CHECK(InterruptStatsProviderClass, (klass), \
+DECLARE_CLASS_CHECKERS(InterruptStatsProviderClass, INTERRUPT_STATS_PROVIDER,
                        TYPE_INTERRUPT_STATS_PROVIDER)
-#define INTERRUPT_STATS_PROVIDER_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(InterruptStatsProviderClass, (obj), \
-                     TYPE_INTERRUPT_STATS_PROVIDER)
 #define INTERRUPT_STATS_PROVIDER(obj) \
     INTERFACE_CHECK(InterruptStatsProvider, (obj), \
                     TYPE_INTERRUPT_STATS_PROVIDER)
include/hw/intc/mips_gic.h +2 -1
index 5670421e62..65aa3a9a5e 100644
@@ -172,7 +172,8 @@
 
 #define TYPE_MIPS_GIC "mips-gic"
 typedef struct MIPSGICState MIPSGICState;
-#define MIPS_GIC(obj) OBJECT_CHECK(MIPSGICState, (obj), TYPE_MIPS_GIC)
+DECLARE_INSTANCE_CHECKER(MIPSGICState, MIPS_GIC,
+                         TYPE_MIPS_GIC)
 
 /* Support up to 32 VPs and 256 IRQs */
 #define GIC_MAX_VPS             32
include/hw/intc/realview_gic.h +2 -2
index e633992b9c..a93ace87c8 100644
@@ -16,8 +16,8 @@
 
 #define TYPE_REALVIEW_GIC "realview_gic"
 typedef struct RealViewGICState RealViewGICState;
-#define REALVIEW_GIC(obj) \
-    OBJECT_CHECK(RealViewGICState, (obj), TYPE_REALVIEW_GIC)
+DECLARE_INSTANCE_CHECKER(RealViewGICState, REALVIEW_GIC,
+                         TYPE_REALVIEW_GIC)
 
 struct RealViewGICState {
     SysBusDevice parent_obj;
include/hw/intc/rx_icu.h +2 -1
index 5660cb4e7f..ec02df35e3 100644
@@ -72,6 +72,7 @@ struct RXICUState {
 typedef struct RXICUState RXICUState;
 
 #define TYPE_RX_ICU "rx-icu"
-#define RX_ICU(obj) OBJECT_CHECK(RXICUState, (obj), TYPE_RX_ICU)
+DECLARE_INSTANCE_CHECKER(RXICUState, RX_ICU,
+                         TYPE_RX_ICU)
 
 #endif /* RX_ICU_H */
include/hw/intc/xlnx-pmu-iomod-intc.h +2 -2
index fce35ac941..7a560e97af 100644
@@ -32,8 +32,8 @@
 #define TYPE_XLNX_PMU_IO_INTC "xlnx.pmu_io_intc"
 
 typedef struct XlnxPMUIOIntc XlnxPMUIOIntc;
-#define XLNX_PMU_IO_INTC(obj) \
-     OBJECT_CHECK(XlnxPMUIOIntc, (obj), TYPE_XLNX_PMU_IO_INTC)
+DECLARE_INSTANCE_CHECKER(XlnxPMUIOIntc, XLNX_PMU_IO_INTC,
+                         TYPE_XLNX_PMU_IO_INTC)
 
 /* This is R_PIT3_CONTROL + 1 */
 #define XLNXPMUIOINTC_R_MAX (0x78 + 1)
include/hw/intc/xlnx-zynqmp-ipi.h +2 -2
index 9044ca5afe..29c48db307 100644
@@ -32,8 +32,8 @@
 #define TYPE_XLNX_ZYNQMP_IPI "xlnx.zynqmp_ipi"
 
 typedef struct XlnxZynqMPIPI XlnxZynqMPIPI;
-#define XLNX_ZYNQMP_IPI(obj) \
-     OBJECT_CHECK(XlnxZynqMPIPI, (obj), TYPE_XLNX_ZYNQMP_IPI)
+DECLARE_INSTANCE_CHECKER(XlnxZynqMPIPI, XLNX_ZYNQMP_IPI,
+                         TYPE_XLNX_ZYNQMP_IPI)
 
 /* This is R_IPI_IDR + 1 */
 #define R_XLNX_ZYNQMP_IPI_MAX ((0x1c / 4) + 1)
include/hw/ipack/ipack.h +4 -7
index ac6105ff8b..a2304c1b3e 100644
@@ -17,7 +17,8 @@
 typedef struct IPackBus IPackBus;
 
 #define TYPE_IPACK_BUS "IndustryPack"
-#define IPACK_BUS(obj) OBJECT_CHECK(IPackBus, (obj), TYPE_IPACK_BUS)
+DECLARE_INSTANCE_CHECKER(IPackBus, IPACK_BUS,
+                         TYPE_IPACK_BUS)
 
 struct IPackBus {
     /*< private >*/
@@ -33,12 +34,8 @@ typedef struct IPackDevice IPackDevice;
 typedef struct IPackDeviceClass IPackDeviceClass;
 
 #define TYPE_IPACK_DEVICE "ipack-device"
-#define IPACK_DEVICE(obj) \
-     OBJECT_CHECK(IPackDevice, (obj), TYPE_IPACK_DEVICE)
-#define IPACK_DEVICE_CLASS(klass)                                        \
-     OBJECT_CLASS_CHECK(IPackDeviceClass, (klass), TYPE_IPACK_DEVICE)
-#define IPACK_DEVICE_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(IPackDeviceClass, (obj), TYPE_IPACK_DEVICE)
+DECLARE_OBJ_CHECKERS(IPackDevice, IPackDeviceClass,
+                     IPACK_DEVICE, TYPE_IPACK_DEVICE)
 
 struct IPackDeviceClass {
     /*< private >*/
include/hw/ipmi/ipmi.h +6 -12
index 355a8714bb..01c9d497c4 100644
@@ -112,10 +112,8 @@ uint32_t ipmi_next_uuid(void);
 #define IPMI_INTERFACE(obj) \
      INTERFACE_CHECK(IPMIInterface, (obj), TYPE_IPMI_INTERFACE)
 typedef struct IPMIInterfaceClass IPMIInterfaceClass;
-#define IPMI_INTERFACE_CLASS(class) \
-     OBJECT_CLASS_CHECK(IPMIInterfaceClass, (class), TYPE_IPMI_INTERFACE)
-#define IPMI_INTERFACE_GET_CLASS(class) \
-     OBJECT_GET_CLASS(IPMIInterfaceClass, (class), TYPE_IPMI_INTERFACE)
+DECLARE_CLASS_CHECKERS(IPMIInterfaceClass, IPMI_INTERFACE,
+                       TYPE_IPMI_INTERFACE)
 
 typedef struct IPMIInterface IPMIInterface;
 
@@ -180,12 +178,8 @@ struct IPMIInterfaceClass {
 #define TYPE_IPMI_BMC "ipmi-bmc"
 typedef struct IPMIBmc IPMIBmc;
 typedef struct IPMIBmcClass IPMIBmcClass;
-#define IPMI_BMC(obj) \
-     OBJECT_CHECK(IPMIBmc, (obj), TYPE_IPMI_BMC)
-#define IPMI_BMC_CLASS(obj_class) \
-     OBJECT_CLASS_CHECK(IPMIBmcClass, (obj_class), TYPE_IPMI_BMC)
-#define IPMI_BMC_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(IPMIBmcClass, (obj), TYPE_IPMI_BMC)
+DECLARE_OBJ_CHECKERS(IPMIBmc, IPMIBmcClass,
+                     IPMI_BMC, TYPE_IPMI_BMC)
 
 struct IPMIBmc {
     DeviceState parent;
@@ -273,8 +267,8 @@ void ipmi_bmc_gen_event(IPMIBmc *b, uint8_t *evt, bool log);
 
 #define TYPE_IPMI_BMC_SIMULATOR "ipmi-bmc-sim"
 typedef struct IPMIBmcSim IPMIBmcSim;
-#define IPMI_BMC_SIMULATOR(obj) OBJECT_CHECK(IPMIBmcSim, (obj), \
-                                        TYPE_IPMI_BMC_SIMULATOR)
+DECLARE_INSTANCE_CHECKER(IPMIBmcSim, IPMI_BMC_SIMULATOR,
+                         TYPE_IPMI_BMC_SIMULATOR)
 
 
 typedef struct RspBuffer {
include/hw/isa/i8259_internal.h +2 -6
index 69170df6f8..cd050bb9f2 100644
@@ -34,12 +34,8 @@ typedef struct PICCommonState PICCommonState;
 
 #define TYPE_PIC_COMMON "pic-common"
 typedef struct PICCommonClass PICCommonClass;
-#define PIC_COMMON(obj) \
-     OBJECT_CHECK(PICCommonState, (obj), TYPE_PIC_COMMON)
-#define PIC_COMMON_CLASS(klass) \
-     OBJECT_CLASS_CHECK(PICCommonClass, (klass), TYPE_PIC_COMMON)
-#define PIC_COMMON_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(PICCommonClass, (obj), TYPE_PIC_COMMON)
+DECLARE_OBJ_CHECKERS(PICCommonState, PICCommonClass,
+                     PIC_COMMON, TYPE_PIC_COMMON)
 
 struct PICCommonClass {
     ISADeviceClass parent_class;
include/hw/isa/isa.h +6 -11
index c7f27d5aa9..ddb6a2d168 100644
@@ -12,15 +12,12 @@
 
 #define TYPE_ISA_DEVICE "isa-device"
 typedef struct ISADeviceClass ISADeviceClass;
-#define ISA_DEVICE(obj) \
-     OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE)
-#define ISA_DEVICE_CLASS(klass) \
-     OBJECT_CLASS_CHECK(ISADeviceClass, (klass), TYPE_ISA_DEVICE)
-#define ISA_DEVICE_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(ISADeviceClass, (obj), TYPE_ISA_DEVICE)
+DECLARE_OBJ_CHECKERS(ISADevice, ISADeviceClass,
+                     ISA_DEVICE, TYPE_ISA_DEVICE)
 
 #define TYPE_ISA_BUS "ISA"
-#define ISA_BUS(obj) OBJECT_CHECK(ISABus, (obj), TYPE_ISA_BUS)
+DECLARE_INSTANCE_CHECKER(ISABus, ISA_BUS,
+                         TYPE_ISA_BUS)
 
 #define TYPE_APPLE_SMC "isa-applesmc"
 #define APPLESMC_MAX_DATA_LENGTH       32
@@ -39,10 +36,8 @@ static inline uint16_t applesmc_port(void)
 #define TYPE_ISADMA "isa-dma"
 
 typedef struct IsaDmaClass IsaDmaClass;
-#define ISADMA_CLASS(klass) \
-    OBJECT_CLASS_CHECK(IsaDmaClass, (klass), TYPE_ISADMA)
-#define ISADMA_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(IsaDmaClass, (obj), TYPE_ISADMA)
+DECLARE_CLASS_CHECKERS(IsaDmaClass, ISADMA,
+                       TYPE_ISADMA)
 #define ISADMA(obj) \
     INTERFACE_CHECK(IsaDma, (obj), TYPE_ISADMA)
 
include/hw/isa/pc87312.h +2 -1
index c8e98ea029..a65168a157 100644
@@ -31,7 +31,8 @@
 
 #define TYPE_PC87312_SUPERIO "pc87312"
 typedef struct PC87312State PC87312State;
-#define PC87312(obj) OBJECT_CHECK(PC87312State, (obj), TYPE_PC87312_SUPERIO)
+DECLARE_INSTANCE_CHECKER(PC87312State, PC87312,
+                         TYPE_PC87312_SUPERIO)
 
 struct PC87312State {
     /*< private >*/
include/hw/isa/superio.h +2 -6
index c782c8b64e..b9f5c19155 100644
@@ -17,12 +17,8 @@
 #define TYPE_ISA_SUPERIO "isa-superio"
 typedef struct ISASuperIOClass ISASuperIOClass;
 typedef struct ISASuperIODevice ISASuperIODevice;
-#define ISA_SUPERIO(obj) \
-    OBJECT_CHECK(ISASuperIODevice, (obj), TYPE_ISA_SUPERIO)
-#define ISA_SUPERIO_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(ISASuperIOClass, (obj), TYPE_ISA_SUPERIO)
-#define ISA_SUPERIO_CLASS(klass) \
-    OBJECT_CLASS_CHECK(ISASuperIOClass, (klass), TYPE_ISA_SUPERIO)
+DECLARE_OBJ_CHECKERS(ISASuperIODevice, ISASuperIOClass,
+                     ISA_SUPERIO, TYPE_ISA_SUPERIO)
 
 #define SUPERIO_MAX_SERIAL_PORTS 4
 
include/hw/m68k/mcf_fec.h +2 -1
index c8ece3cb4b..840c5bbf53 100644
@@ -13,7 +13,8 @@
 
 #define TYPE_MCF_FEC_NET "mcf-fec"
 typedef struct mcf_fec_state mcf_fec_state;
-#define MCF_FEC_NET(obj) OBJECT_CHECK(mcf_fec_state, (obj), TYPE_MCF_FEC_NET)
+DECLARE_INSTANCE_CHECKER(mcf_fec_state, MCF_FEC_NET,
+                         TYPE_MCF_FEC_NET)
 
 #define FEC_NUM_IRQ 13
 
include/hw/mem/memory-device.h +2 -4
index d19bca5942..cde52e83c9 100644
@@ -20,10 +20,8 @@
 #define TYPE_MEMORY_DEVICE "memory-device"
 
 typedef struct MemoryDeviceClass MemoryDeviceClass;
-#define MEMORY_DEVICE_CLASS(klass) \
-     OBJECT_CLASS_CHECK(MemoryDeviceClass, (klass), TYPE_MEMORY_DEVICE)
-#define MEMORY_DEVICE_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(MemoryDeviceClass, (obj), TYPE_MEMORY_DEVICE)
+DECLARE_CLASS_CHECKERS(MemoryDeviceClass, MEMORY_DEVICE,
+                       TYPE_MEMORY_DEVICE)
 #define MEMORY_DEVICE(obj) \
      INTERFACE_CHECK(MemoryDeviceState, (obj), TYPE_MEMORY_DEVICE)
 
include/hw/mem/nvdimm.h +2 -4
index 4b4a4b5b17..19e3d3092d 100644
@@ -48,10 +48,8 @@
 #define TYPE_NVDIMM      "nvdimm"
 typedef struct NVDIMMClass NVDIMMClass;
 typedef struct NVDIMMDevice NVDIMMDevice;
-#define NVDIMM(obj)      OBJECT_CHECK(NVDIMMDevice, (obj), TYPE_NVDIMM)
-#define NVDIMM_CLASS(oc) OBJECT_CLASS_CHECK(NVDIMMClass, (oc), TYPE_NVDIMM)
-#define NVDIMM_GET_CLASS(obj) OBJECT_GET_CLASS(NVDIMMClass, (obj), \
-                                               TYPE_NVDIMM)
+DECLARE_OBJ_CHECKERS(NVDIMMDevice, NVDIMMClass,
+                     NVDIMM, TYPE_NVDIMM)
 
 #define NVDIMM_LABEL_SIZE_PROP "label-size"
 #define NVDIMM_UUID_PROP       "uuid"
include/hw/mem/pc-dimm.h +2 -6
index 41d4ff39ba..86e3010243 100644
@@ -23,12 +23,8 @@
 #define TYPE_PC_DIMM "pc-dimm"
 typedef struct PCDIMMDevice PCDIMMDevice;
 typedef struct PCDIMMDeviceClass PCDIMMDeviceClass;
-#define PC_DIMM(obj) \
-    OBJECT_CHECK(PCDIMMDevice, (obj), TYPE_PC_DIMM)
-#define PC_DIMM_CLASS(oc) \
-    OBJECT_CLASS_CHECK(PCDIMMDeviceClass, (oc), TYPE_PC_DIMM)
-#define PC_DIMM_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(PCDIMMDeviceClass, (obj), TYPE_PC_DIMM)
+DECLARE_OBJ_CHECKERS(PCDIMMDevice, PCDIMMDeviceClass,
+                     PC_DIMM, TYPE_PC_DIMM)
 
 #define PC_DIMM_ADDR_PROP "addr"
 #define PC_DIMM_SLOT_PROP "slot"
include/hw/mips/cps.h +2 -1
index ab79a66b1d..849e640570 100644
@@ -30,7 +30,8 @@
 
 #define TYPE_MIPS_CPS "mips-cps"
 typedef struct MIPSCPSState MIPSCPSState;
-#define MIPS_CPS(obj) OBJECT_CHECK(MIPSCPSState, (obj), TYPE_MIPS_CPS)
+DECLARE_INSTANCE_CHECKER(MIPSCPSState, MIPS_CPS,
+                         TYPE_MIPS_CPS)
 
 struct MIPSCPSState {
     SysBusDevice parent_obj;
include/hw/misc/a9scu.h +2 -1
index c5481f4dbb..fd1b92e923 100644
@@ -28,6 +28,7 @@ struct A9SCUState {
 typedef struct A9SCUState A9SCUState;
 
 #define TYPE_A9_SCU "a9-scu"
-#define A9_SCU(obj) OBJECT_CHECK(A9SCUState, (obj), TYPE_A9_SCU)
+DECLARE_INSTANCE_CHECKER(A9SCUState, A9_SCU,
+                         TYPE_A9_SCU)
 
 #endif
include/hw/misc/allwinner-cpucfg.h +2 -2
index f5420b11d5..058514de15 100644
@@ -30,8 +30,8 @@
 
 #define TYPE_AW_CPUCFG   "allwinner-cpucfg"
 typedef struct AwCpuCfgState AwCpuCfgState;
-#define AW_CPUCFG(obj) \
-    OBJECT_CHECK(AwCpuCfgState, (obj), TYPE_AW_CPUCFG)
+DECLARE_INSTANCE_CHECKER(AwCpuCfgState, AW_CPUCFG,
+                         TYPE_AW_CPUCFG)
 
 /** @} */
 
include/hw/misc/allwinner-h3-ccu.h +2 -2
index 60f0c56cd9..05f5c7bd8e 100644
@@ -43,8 +43,8 @@
 
 #define TYPE_AW_H3_CCU    "allwinner-h3-ccu"
 typedef struct AwH3ClockCtlState AwH3ClockCtlState;
-#define AW_H3_CCU(obj) \
-    OBJECT_CHECK(AwH3ClockCtlState, (obj), TYPE_AW_H3_CCU)
+DECLARE_INSTANCE_CHECKER(AwH3ClockCtlState, AW_H3_CCU,
+                         TYPE_AW_H3_CCU)
 
 /** @} */
 
include/hw/misc/allwinner-h3-dramc.h +2 -2
index 0538e598b0..60a13a6958 100644
@@ -59,8 +59,8 @@
 
 #define TYPE_AW_H3_DRAMC "allwinner-h3-dramc"
 typedef struct AwH3DramCtlState AwH3DramCtlState;
-#define AW_H3_DRAMC(obj) \
-    OBJECT_CHECK(AwH3DramCtlState, (obj), TYPE_AW_H3_DRAMC)
+DECLARE_INSTANCE_CHECKER(AwH3DramCtlState, AW_H3_DRAMC,
+                         TYPE_AW_H3_DRAMC)
 
 /** @} */
 
include/hw/misc/allwinner-h3-sysctrl.h +2 -2
index 7360698f8f..50baa8eb07 100644
@@ -44,8 +44,8 @@
 
 #define TYPE_AW_H3_SYSCTRL    "allwinner-h3-sysctrl"
 typedef struct AwH3SysCtrlState AwH3SysCtrlState;
-#define AW_H3_SYSCTRL(obj) \
-    OBJECT_CHECK(AwH3SysCtrlState, (obj), TYPE_AW_H3_SYSCTRL)
+DECLARE_INSTANCE_CHECKER(AwH3SysCtrlState, AW_H3_SYSCTRL,
+                         TYPE_AW_H3_SYSCTRL)
 
 /** @} */
 
include/hw/misc/allwinner-sid.h +2 -2
index 70cd7cc7c0..b8e83bb7ce 100644
@@ -31,8 +31,8 @@
 
 #define TYPE_AW_SID    "allwinner-sid"
 typedef struct AwSidState AwSidState;
-#define AW_SID(obj) \
-    OBJECT_CHECK(AwSidState, (obj), TYPE_AW_SID)
+DECLARE_INSTANCE_CHECKER(AwSidState, AW_SID,
+                         TYPE_AW_SID)
 
 /** @} */
 
include/hw/misc/arm11scu.h +2 -1
index 7e2e6d2b44..71b4bc9a22 100644
@@ -16,7 +16,8 @@
 
 #define TYPE_ARM11_SCU "arm11-scu"
 typedef struct ARM11SCUState ARM11SCUState;
-#define ARM11_SCU(obj) OBJECT_CHECK(ARM11SCUState, (obj), TYPE_ARM11_SCU)
+DECLARE_INSTANCE_CHECKER(ARM11SCUState, ARM11_SCU,
+                         TYPE_ARM11_SCU)
 
 struct ARM11SCUState {
     /*< private >*/
include/hw/misc/armsse-cpuid.h +2 -1
index 290a52cf10..80691c7180 100644
@@ -27,7 +27,8 @@
 
 #define TYPE_ARMSSE_CPUID "armsse-cpuid"
 typedef struct ARMSSECPUID ARMSSECPUID;
-#define ARMSSE_CPUID(obj) OBJECT_CHECK(ARMSSECPUID, (obj), TYPE_ARMSSE_CPUID)
+DECLARE_INSTANCE_CHECKER(ARMSSECPUID, ARMSSE_CPUID,
+                         TYPE_ARMSSE_CPUID)
 
 struct ARMSSECPUID {
     /*< private >*/
include/hw/misc/armsse-mhu.h +2 -1
index d1ae4a463a..310643a022 100644
@@ -28,7 +28,8 @@
 
 #define TYPE_ARMSSE_MHU "armsse-mhu"
 typedef struct ARMSSEMHU ARMSSEMHU;
-#define ARMSSE_MHU(obj) OBJECT_CHECK(ARMSSEMHU, (obj), TYPE_ARMSSE_MHU)
+DECLARE_INSTANCE_CHECKER(ARMSSEMHU, ARMSSE_MHU,
+                         TYPE_ARMSSE_MHU)
 
 struct ARMSSEMHU {
     /*< private >*/
include/hw/misc/aspeed_scu.h +2 -5
index feebb1baf6..8d3b14acd4 100644
@@ -17,7 +17,8 @@
 #define TYPE_ASPEED_SCU "aspeed.scu"
 typedef struct AspeedSCUClass AspeedSCUClass;
 typedef struct AspeedSCUState AspeedSCUState;
-#define ASPEED_SCU(obj) OBJECT_CHECK(AspeedSCUState, (obj), TYPE_ASPEED_SCU)
+DECLARE_OBJ_CHECKERS(AspeedSCUState, AspeedSCUClass,
+                     ASPEED_SCU, TYPE_ASPEED_SCU)
 #define TYPE_ASPEED_2400_SCU TYPE_ASPEED_SCU "-ast2400"
 #define TYPE_ASPEED_2500_SCU TYPE_ASPEED_SCU "-ast2500"
 #define TYPE_ASPEED_2600_SCU TYPE_ASPEED_SCU "-ast2600"
@@ -50,10 +51,6 @@ struct AspeedSCUState {
 
 extern bool is_supported_silicon_rev(uint32_t silicon_rev);
 
-#define ASPEED_SCU_CLASS(klass) \
-     OBJECT_CLASS_CHECK(AspeedSCUClass, (klass), TYPE_ASPEED_SCU)
-#define ASPEED_SCU_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(AspeedSCUClass, (obj), TYPE_ASPEED_SCU)
 
 struct AspeedSCUClass {
     SysBusDeviceClass parent_class;
include/hw/misc/aspeed_sdmc.h +2 -5
index 3d98817715..3375afc89b 100644
@@ -15,7 +15,8 @@
 #define TYPE_ASPEED_SDMC "aspeed.sdmc"
 typedef struct AspeedSDMCClass AspeedSDMCClass;
 typedef struct AspeedSDMCState AspeedSDMCState;
-#define ASPEED_SDMC(obj) OBJECT_CHECK(AspeedSDMCState, (obj), TYPE_ASPEED_SDMC)
+DECLARE_OBJ_CHECKERS(AspeedSDMCState, AspeedSDMCClass,
+                     ASPEED_SDMC, TYPE_ASPEED_SDMC)
 #define TYPE_ASPEED_2400_SDMC TYPE_ASPEED_SDMC "-ast2400"
 #define TYPE_ASPEED_2500_SDMC TYPE_ASPEED_SDMC "-ast2500"
 #define TYPE_ASPEED_2600_SDMC TYPE_ASPEED_SDMC "-ast2600"
@@ -45,10 +46,6 @@ struct AspeedSDMCState {
     uint64_t max_ram_size;
 };
 
-#define ASPEED_SDMC_CLASS(klass) \
-     OBJECT_CLASS_CHECK(AspeedSDMCClass, (klass), TYPE_ASPEED_SDMC)
-#define ASPEED_SDMC_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(AspeedSDMCClass, (obj), TYPE_ASPEED_SDMC)
 
 struct AspeedSDMCClass {
     SysBusDeviceClass parent_class;
include/hw/misc/aspeed_xdma.h +2 -1
index e5177e2c02..0e62c04520 100644
@@ -14,7 +14,8 @@
 
 #define TYPE_ASPEED_XDMA "aspeed.xdma"
 typedef struct AspeedXDMAState AspeedXDMAState;
-#define ASPEED_XDMA(obj) OBJECT_CHECK(AspeedXDMAState, (obj), TYPE_ASPEED_XDMA)
+DECLARE_INSTANCE_CHECKER(AspeedXDMAState, ASPEED_XDMA,
+                         TYPE_ASPEED_XDMA)
 
 #define ASPEED_XDMA_NUM_REGS (ASPEED_XDMA_REG_SIZE / sizeof(uint32_t))
 #define ASPEED_XDMA_REG_SIZE 0x7C
include/hw/misc/auxbus.h +6 -4
index f24f2fd789..f910d94118 100644
@@ -36,7 +36,8 @@ typedef enum AUXReply AUXReply;
 
 #define TYPE_AUXTOI2C "aux-to-i2c-bridge"
 typedef struct AUXTOI2CState AUXTOI2CState;
-#define AUXTOI2C(obj) OBJECT_CHECK(AUXTOI2CState, (obj), TYPE_AUXTOI2C)
+DECLARE_INSTANCE_CHECKER(AUXTOI2CState, AUXTOI2C,
+                         TYPE_AUXTOI2C)
 
 enum AUXCommand {
     WRITE_I2C = 0,
@@ -57,7 +58,8 @@ enum AUXReply {
 };
 
 #define TYPE_AUX_BUS "aux-bus"
-#define AUX_BUS(obj) OBJECT_CHECK(AUXBus, (obj), TYPE_AUX_BUS)
+DECLARE_INSTANCE_CHECKER(AUXBus, AUX_BUS,
+                         TYPE_AUX_BUS)
 
 struct AUXBus {
     /* < private > */
@@ -76,8 +78,8 @@ struct AUXBus {
 };
 
 #define TYPE_AUX_SLAVE "aux-slave"
-#define AUX_SLAVE(obj) \
-     OBJECT_CHECK(AUXSlave, (obj), TYPE_AUX_SLAVE)
+DECLARE_INSTANCE_CHECKER(AUXSlave, AUX_SLAVE,
+                         TYPE_AUX_SLAVE)
 
 struct AUXSlave {
     /* < private > */
include/hw/misc/avr_power.h +2 -1
index c230a2655c..938ab3e21b 100644
@@ -32,7 +32,8 @@
 
 #define TYPE_AVR_MASK "avr-power"
 typedef struct AVRMaskState AVRMaskState;
-#define AVR_MASK(obj) OBJECT_CHECK(AVRMaskState, (obj), TYPE_AVR_MASK)
+DECLARE_INSTANCE_CHECKER(AVRMaskState, AVR_MASK,
+                         TYPE_AVR_MASK)
 
 struct AVRMaskState {
     /* <private> */
include/hw/misc/bcm2835_mbox.h +2 -2
index 3ec6a2f0e8..d8c8017f4e 100644
@@ -14,8 +14,8 @@
 
 #define TYPE_BCM2835_MBOX "bcm2835-mbox"
 typedef struct BCM2835MboxState BCM2835MboxState;
-#define BCM2835_MBOX(obj) \
-        OBJECT_CHECK(BCM2835MboxState, (obj), TYPE_BCM2835_MBOX)
+DECLARE_INSTANCE_CHECKER(BCM2835MboxState, BCM2835_MBOX,
+                         TYPE_BCM2835_MBOX)
 
 typedef struct {
     uint32_t reg[MBOX_SIZE];
include/hw/misc/bcm2835_mphi.h +2 -2
index ce1c273cfb..249511182e 100644
@@ -39,7 +39,7 @@ struct BCM2835MphiState {
 
 #define TYPE_BCM2835_MPHI   "bcm2835-mphi"
 
-#define BCM2835_MPHI(obj) \
-    OBJECT_CHECK(BCM2835MphiState, (obj), TYPE_BCM2835_MPHI)
+DECLARE_INSTANCE_CHECKER(BCM2835MphiState, BCM2835_MPHI,
+                         TYPE_BCM2835_MPHI)
 
 #endif
include/hw/misc/bcm2835_property.h +2 -2
index 28bf2b49b6..5c827a1900 100644
@@ -15,8 +15,8 @@
 
 #define TYPE_BCM2835_PROPERTY "bcm2835-property"
 typedef struct BCM2835PropertyState BCM2835PropertyState;
-#define BCM2835_PROPERTY(obj) \
-        OBJECT_CHECK(BCM2835PropertyState, (obj), TYPE_BCM2835_PROPERTY)
+DECLARE_INSTANCE_CHECKER(BCM2835PropertyState, BCM2835_PROPERTY,
+                         TYPE_BCM2835_PROPERTY)
 
 struct BCM2835PropertyState {
     /*< private >*/
include/hw/misc/bcm2835_rng.h +2 -2
index 0921d9b3f1..fec76eef8e 100644
@@ -15,8 +15,8 @@
 
 #define TYPE_BCM2835_RNG "bcm2835-rng"
 typedef struct BCM2835RngState BCM2835RngState;
-#define BCM2835_RNG(obj) \
-        OBJECT_CHECK(BCM2835RngState, (obj), TYPE_BCM2835_RNG)
+DECLARE_INSTANCE_CHECKER(BCM2835RngState, BCM2835_RNG,
+                         TYPE_BCM2835_RNG)
 
 struct BCM2835RngState {
     SysBusDevice busdev;
include/hw/misc/bcm2835_thermal.h +2 -2
index 2b937527eb..5b827c970e 100644
@@ -15,8 +15,8 @@
 #define TYPE_BCM2835_THERMAL "bcm2835-thermal"
 
 typedef struct Bcm2835ThermalState Bcm2835ThermalState;
-#define BCM2835_THERMAL(obj) \
-    OBJECT_CHECK(Bcm2835ThermalState, (obj), TYPE_BCM2835_THERMAL)
+DECLARE_INSTANCE_CHECKER(Bcm2835ThermalState, BCM2835_THERMAL,
+                         TYPE_BCM2835_THERMAL)
 
 struct Bcm2835ThermalState {
     /*< private >*/
include/hw/misc/grlib_ahb_apb_pnp.h +4 -4
index 427606fd6b..34b18e3193 100644
@@ -27,13 +27,13 @@
 
 #define TYPE_GRLIB_AHB_PNP "grlib,ahbpnp"
 typedef struct AHBPnp AHBPnp;
-#define GRLIB_AHB_PNP(obj) \
-    OBJECT_CHECK(AHBPnp, (obj), TYPE_GRLIB_AHB_PNP)
+DECLARE_INSTANCE_CHECKER(AHBPnp, GRLIB_AHB_PNP,
+                         TYPE_GRLIB_AHB_PNP)
 
 #define TYPE_GRLIB_APB_PNP "grlib,apbpnp"
 typedef struct APBPnp APBPnp;
-#define GRLIB_APB_PNP(obj) \
-    OBJECT_CHECK(APBPnp, (obj), TYPE_GRLIB_APB_PNP)
+DECLARE_INSTANCE_CHECKER(APBPnp, GRLIB_APB_PNP,
+                         TYPE_GRLIB_APB_PNP)
 
 void grlib_ahb_pnp_add_entry(AHBPnp *dev, uint32_t address, uint32_t mask,
                              uint8_t vendor, uint16_t device, int slave,
include/hw/misc/imx25_ccm.h +2 -1
index 8a7a9b675f..55c5db8815 100644
@@ -65,7 +65,8 @@
 
 #define TYPE_IMX25_CCM "imx25.ccm"
 typedef struct IMX25CCMState IMX25CCMState;
-#define IMX25_CCM(obj) OBJECT_CHECK(IMX25CCMState, (obj), TYPE_IMX25_CCM)
+DECLARE_INSTANCE_CHECKER(IMX25CCMState, IMX25_CCM,
+                         TYPE_IMX25_CCM)
 
 struct IMX25CCMState {
     /* <private> */
include/hw/misc/imx31_ccm.h +2 -1
index a56ee992af..25e280e976 100644
@@ -74,7 +74,8 @@
 
 #define TYPE_IMX31_CCM "imx31.ccm"
 typedef struct IMX31CCMState IMX31CCMState;
-#define IMX31_CCM(obj) OBJECT_CHECK(IMX31CCMState, (obj), TYPE_IMX31_CCM)
+DECLARE_INSTANCE_CHECKER(IMX31CCMState, IMX31_CCM,
+                         TYPE_IMX31_CCM)
 
 struct IMX31CCMState {
     /* <private> */
include/hw/misc/imx6_ccm.h +2 -1
index affa13087e..85f32417d6 100644
@@ -180,7 +180,8 @@
 
 #define TYPE_IMX6_CCM "imx6.ccm"
 typedef struct IMX6CCMState IMX6CCMState;
-#define IMX6_CCM(obj) OBJECT_CHECK(IMX6CCMState, (obj), TYPE_IMX6_CCM)
+DECLARE_INSTANCE_CHECKER(IMX6CCMState, IMX6_CCM,
+                         TYPE_IMX6_CCM)
 
 struct IMX6CCMState {
     /* <private> */
include/hw/misc/imx6_src.h +2 -1
index f1d70ec177..15b51757ba 100644
@@ -59,7 +59,8 @@
 
 #define TYPE_IMX6_SRC "imx6.src"
 typedef struct IMX6SRCState IMX6SRCState;
-#define IMX6_SRC(obj) OBJECT_CHECK(IMX6SRCState, (obj), TYPE_IMX6_SRC)
+DECLARE_INSTANCE_CHECKER(IMX6SRCState, IMX6_SRC,
+                         TYPE_IMX6_SRC)
 
 struct IMX6SRCState {
     /* <private> */
include/hw/misc/imx6ul_ccm.h +2 -1
index 2304c6e738..d614de0edd 100644
@@ -209,7 +209,8 @@
 
 #define TYPE_IMX6UL_CCM "imx6ul.ccm"
 typedef struct IMX6ULCCMState IMX6ULCCMState;
-#define IMX6UL_CCM(obj) OBJECT_CHECK(IMX6ULCCMState, (obj), TYPE_IMX6UL_CCM)
+DECLARE_INSTANCE_CHECKER(IMX6ULCCMState, IMX6UL_CCM,
+                         TYPE_IMX6UL_CCM)
 
 struct IMX6ULCCMState {
     /* <private> */
include/hw/misc/imx7_ccm.h +4 -2
index 9e9e58a5c2..e2757622d0 100644
@@ -106,7 +106,8 @@ enum IMX7PMURegisters {
 
 #define TYPE_IMX7_CCM "imx7.ccm"
 typedef struct IMX7CCMState IMX7CCMState;
-#define IMX7_CCM(obj) OBJECT_CHECK(IMX7CCMState, (obj), TYPE_IMX7_CCM)
+DECLARE_INSTANCE_CHECKER(IMX7CCMState, IMX7_CCM,
+                         TYPE_IMX7_CCM)
 
 struct IMX7CCMState {
     /* <private> */
@@ -121,7 +122,8 @@ struct IMX7CCMState {
 
 #define TYPE_IMX7_ANALOG "imx7.analog"
 typedef struct IMX7AnalogState IMX7AnalogState;
-#define IMX7_ANALOG(obj) OBJECT_CHECK(IMX7AnalogState, (obj), TYPE_IMX7_ANALOG)
+DECLARE_INSTANCE_CHECKER(IMX7AnalogState, IMX7_ANALOG,
+                         TYPE_IMX7_ANALOG)
 
 struct IMX7AnalogState {
     /* <private> */
include/hw/misc/imx7_gpr.h +2 -1
index 83384ec0cc..f80b3ed28c 100644
@@ -18,7 +18,8 @@
 
 #define TYPE_IMX7_GPR "imx7.gpr"
 typedef struct IMX7GPRState IMX7GPRState;
-#define IMX7_GPR(obj) OBJECT_CHECK(IMX7GPRState, (obj), TYPE_IMX7_GPR)
+DECLARE_INSTANCE_CHECKER(IMX7GPRState, IMX7_GPR,
+                         TYPE_IMX7_GPR)
 
 struct IMX7GPRState {
     /* <private> */
include/hw/misc/imx7_snvs.h +2 -1
index f8659acb7d..ea5395c107 100644
@@ -25,7 +25,8 @@ enum IMX7SNVSRegisters {
 
 #define TYPE_IMX7_SNVS "imx7.snvs"
 typedef struct IMX7SNVSState IMX7SNVSState;
-#define IMX7_SNVS(obj) OBJECT_CHECK(IMX7SNVSState, (obj), TYPE_IMX7_SNVS)
+DECLARE_INSTANCE_CHECKER(IMX7SNVSState, IMX7_SNVS,
+                         TYPE_IMX7_SNVS)
 
 struct IMX7SNVSState {
     /* <private> */
include/hw/misc/imx_ccm.h +2 -6
index 174248e5df..e9d82a2a50 100644
@@ -30,12 +30,8 @@
 #define TYPE_IMX_CCM "imx.ccm"
 typedef struct IMXCCMClass IMXCCMClass;
 typedef struct IMXCCMState IMXCCMState;
-#define IMX_CCM(obj) \
-     OBJECT_CHECK(IMXCCMState, (obj), TYPE_IMX_CCM)
-#define IMX_CCM_CLASS(klass) \
-     OBJECT_CLASS_CHECK(IMXCCMClass, (klass), TYPE_IMX_CCM)
-#define IMX_CCM_GET_CLASS(obj) \
-     OBJECT_GET_CLASS(IMXCCMClass, (obj), TYPE_IMX_CCM)
+DECLARE_OBJ_CHECKERS(IMXCCMState, IMXCCMClass,
+                     IMX_CCM, TYPE_IMX_CCM)
 
 struct IMXCCMState {
     /* <private> */
include/hw/misc/imx_rngc.h +2 -1
index cd7ba8f91e..f7b569cac5 100644
@@ -15,7 +15,8 @@
 
 #define TYPE_IMX_RNGC "imx.rngc"
 typedef struct IMXRNGCState IMXRNGCState;
-#define IMX_RNGC(obj) OBJECT_CHECK(IMXRNGCState, (obj), TYPE_IMX_RNGC)
+DECLARE_INSTANCE_CHECKER(IMXRNGCState, IMX_RNGC,
+                         TYPE_IMX_RNGC)
 
 struct IMXRNGCState {
     /*< private >*/
include/hw/misc/iotkit-secctl.h +2 -1
index 3d54d8f3de..d062ed43e7 100644
@@ -60,7 +60,8 @@
 
 #define TYPE_IOTKIT_SECCTL "iotkit-secctl"
 typedef struct IoTKitSecCtl IoTKitSecCtl;
-#define IOTKIT_SECCTL(obj) OBJECT_CHECK(IoTKitSecCtl, (obj), TYPE_IOTKIT_SECCTL)
+DECLARE_INSTANCE_CHECKER(IoTKitSecCtl, IOTKIT_SECCTL,
+                         TYPE_IOTKIT_SECCTL)
 
 #define IOTS_APB_PPC0_NUM_PORTS 3
 #define IOTS_APB_PPC1_NUM_PORTS 1
include/hw/misc/iotkit-sysctl.h +2 -2
index 27fe6346e6..22ceb5d76d 100644
@@ -32,8 +32,8 @@
 
 #define TYPE_IOTKIT_SYSCTL "iotkit-sysctl"
 typedef struct IoTKitSysCtl IoTKitSysCtl;
-#define IOTKIT_SYSCTL(obj) OBJECT_CHECK(IoTKitSysCtl, (obj), \
-                                        TYPE_IOTKIT_SYSCTL)
+DECLARE_INSTANCE_CHECKER(IoTKitSysCtl, IOTKIT_SYSCTL,
+                         TYPE_IOTKIT_SYSCTL)
 
 struct IoTKitSysCtl {
     /*< private >*/
include/hw/misc/iotkit-sysinfo.h +2 -2
index e0e610c75c..23ae43e549 100644
@@ -27,8 +27,8 @@
 
 #define TYPE_IOTKIT_SYSINFO "iotkit-sysinfo"
 typedef struct IoTKitSysInfo IoTKitSysInfo;
-#define IOTKIT_SYSINFO(obj) OBJECT_CHECK(IoTKitSysInfo, (obj), \
-                                        TYPE_IOTKIT_SYSINFO)
+DECLARE_INSTANCE_CHECKER(IoTKitSysInfo, IOTKIT_SYSINFO,
+                         TYPE_IOTKIT_SYSINFO)
 
 struct IoTKitSysInfo {
     /*< private >*/
include/hw/misc/mac_via.h +6 -5
index a59750634f..862cbba3ab 100644
@@ -33,8 +33,8 @@
 
 #define TYPE_MOS6522_Q800_VIA1 "mos6522-q800-via1"
 typedef struct MOS6522Q800VIA1State MOS6522Q800VIA1State;
-#define MOS6522_Q800_VIA1(obj)  OBJECT_CHECK(MOS6522Q800VIA1State, (obj), \
-                                    TYPE_MOS6522_Q800_VIA1)
+DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA1State, MOS6522_Q800_VIA1,
+                         TYPE_MOS6522_Q800_VIA1)
 
 struct MOS6522Q800VIA1State {
     /*< private >*/
@@ -69,8 +69,8 @@ struct MOS6522Q800VIA1State {
 
 #define TYPE_MOS6522_Q800_VIA2 "mos6522-q800-via2"
 typedef struct MOS6522Q800VIA2State MOS6522Q800VIA2State;
-#define MOS6522_Q800_VIA2(obj)  OBJECT_CHECK(MOS6522Q800VIA2State, (obj), \
-                                    TYPE_MOS6522_Q800_VIA2)
+DECLARE_INSTANCE_CHECKER(MOS6522Q800VIA2State, MOS6522_Q800_VIA2,
+                         TYPE_MOS6522_Q800_VIA2)
 
 struct MOS6522Q800VIA2State {
     /*< private >*/
@@ -80,7 +80,8 @@ struct MOS6522Q800VIA2State {
 
 #define TYPE_MAC_VIA "mac_via"
 typedef struct MacVIAState MacVIAState;
-#define MAC_VIA(obj)   OBJECT_CHECK(MacVIAState, (obj), TYPE_MAC_VIA)
+DECLARE_INSTANCE_CHECKER(MacVIAState, MAC_VIA,
+                         TYPE_MAC_VIA)
 
 struct MacVIAState {
     SysBusDevice busdev;
include/hw/misc/macio/cuda.h +4 -3
index f2b0069262..e738b6376f 100644
@@ -66,13 +66,14 @@ struct MOS6522CUDAState {
 typedef struct MOS6522CUDAState MOS6522CUDAState;
 
 #define TYPE_MOS6522_CUDA "mos6522-cuda"
-#define MOS6522_CUDA(obj) OBJECT_CHECK(MOS6522CUDAState, (obj), \
-                                       TYPE_MOS6522_CUDA)
+DECLARE_INSTANCE_CHECKER(MOS6522CUDAState, MOS6522_CUDA,
+                         TYPE_MOS6522_CUDA)
 
 /* Cuda */
 #define TYPE_CUDA "cuda"
 typedef struct CUDAState CUDAState;
-#define CUDA(obj) OBJECT_CHECK(CUDAState, (obj), TYPE_CUDA)
+DECLARE_INSTANCE_CHECKER(CUDAState, CUDA,
+                         TYPE_CUDA)
 
 struct CUDAState {
     /*< private >*/
include/hw/misc/macio/gpio.h +2 -1
index 2234873250..1d0c8434ae 100644
@@ -32,7 +32,8 @@
 
 #define TYPE_MACIO_GPIO "macio-gpio"
 typedef struct MacIOGPIOState MacIOGPIOState;
-#define MACIO_GPIO(obj) OBJECT_CHECK(MacIOGPIOState, (obj), TYPE_MACIO_GPIO)
+DECLARE_INSTANCE_CHECKER(MacIOGPIOState, MACIO_GPIO,
+                         TYPE_MACIO_GPIO)
 
 struct MacIOGPIOState {
     /*< private >*/
include/hw/misc/macio/macio.h +10 -7
index 81c28eeef7..02dbf37630 100644
@@ -41,7 +41,8 @@
 /* MacIO virtual bus */
 #define TYPE_MACIO_BUS "macio-bus"
 typedef struct MacIOBusState MacIOBusState;
-#define MACIO_BUS(obj) OBJECT_CHECK(MacIOBusState, (obj), TYPE_MACIO_BUS)
+DECLARE_INSTANCE_CHECKER(MacIOBusState, MACIO_BUS,
+                         TYPE_MACIO_BUS)
 
 struct MacIOBusState {
     /*< private >*/
@@ -51,7 +52,8 @@ struct MacIOBusState {
 /* MacIO IDE */
 #define TYPE_MACIO_IDE "macio-ide"
 typedef struct MACIOIDEState MACIOIDEState;
-#define MACIO_IDE(obj) OBJECT_CHECK(MACIOIDEState, (obj), TYPE_MACIO_IDE)
+DECLARE_INSTANCE_CHECKER(MACIOIDEState, MACIO_IDE,
+                         TYPE_MACIO_IDE)
 
 struct MACIOIDEState {
     /*< private >*/
@@ -78,7 +80,8 @@ void macio_ide_register_dma(MACIOIDEState *ide);
 
 #define TYPE_MACIO "macio"
 typedef struct MacIOState MacIOState;
-#define MACIO(obj) OBJECT_CHECK(MacIOState, (obj), TYPE_MACIO)
+DECLARE_INSTANCE_CHECKER(MacIOState, MACIO,
+                         TYPE_MACIO)
 
 struct MacIOState {
     /*< private >*/
@@ -96,8 +99,8 @@ struct MacIOState {
 
 #define TYPE_OLDWORLD_MACIO "macio-oldworld"
 typedef struct OldWorldMacIOState OldWorldMacIOState;
-#define OLDWORLD_MACIO(obj) \
-    OBJECT_CHECK(OldWorldMacIOState, (obj), TYPE_OLDWORLD_MACIO)
+DECLARE_INSTANCE_CHECKER(OldWorldMacIOState, OLDWORLD_MACIO,
+                         TYPE_OLDWORLD_MACIO)
 
 struct OldWorldMacIOState {
     /*< private >*/
@@ -112,8 +115,8 @@ struct OldWorldMacIOState {
 
 #define TYPE_NEWWORLD_MACIO "macio-newworld"
 typedef struct NewWorldMacIOState NewWorldMacIOState;
-#define NEWWORLD_MACIO(obj) \
-    OBJECT_CHECK(NewWorldMacIOState, (obj), TYPE_NEWWORLD_MACIO)
+DECLARE_INSTANCE_CHECKER(NewWorldMacIOState, NEWWORLD_MACIO,
+                         TYPE_NEWWORLD_MACIO)
 
 struct NewWorldMacIOState {
     /*< private >*/
include/hw/misc/macio/pmu.h +4 -3
index b3982f6f32..0d1a5c1406 100644
@@ -181,8 +181,8 @@ struct MOS6522PMUState {
 typedef struct MOS6522PMUState MOS6522PMUState;
 
 #define TYPE_MOS6522_PMU "mos6522-pmu"
-#define MOS6522_PMU(obj) OBJECT_CHECK(MOS6522PMUState, (obj), \
-                                      TYPE_MOS6522_PMU)
+DECLARE_INSTANCE_CHECKER(MOS6522PMUState, MOS6522_PMU,
+                         TYPE_MOS6522_PMU)
 /**
  * PMUState:
  * @last_b: last value of B register
@@ -234,6 +234,7 @@ struct PMUState {
 typedef struct PMUState PMUState;
 
 #define TYPE_VIA_PMU "via-pmu"
-#define VIA_PMU(obj) OBJECT_CHECK(PMUState, (obj), TYPE_VIA_PMU)
+DECLARE_INSTANCE_CHECKER(PMUState, VIA_PMU,
+                         TYPE_VIA_PMU)
 
 #endif /* PMU_H */
include/hw/misc/max111x.h +2 -2
index e903a1af9c..6350a3f7c0 100644
@@ -49,8 +49,8 @@ typedef struct MAX111xState MAX111xState;
 
 #define TYPE_MAX_111X "max111x"
 
-#define MAX_111X(obj) \
-    OBJECT_CHECK(MAX111xState, (obj), TYPE_MAX_111X)
+DECLARE_INSTANCE_CHECKER(MAX111xState, MAX_111X,
+                         TYPE_MAX_111X)
 
 #define TYPE_MAX_1110 "max1110"
 #define TYPE_MAX_1111 "max1111"
include/hw/misc/mips_cmgcr.h +2 -1
index a334be8edd..923df4f112 100644
@@ -15,7 +15,8 @@
 
 #define TYPE_MIPS_GCR "mips-gcr"
 typedef struct MIPSGCRState MIPSGCRState;
-#define MIPS_GCR(obj) OBJECT_CHECK(MIPSGCRState, (obj), TYPE_MIPS_GCR)
+DECLARE_INSTANCE_CHECKER(MIPSGCRState, MIPS_GCR,
+                         TYPE_MIPS_GCR)
 
 #define GCR_BASE_ADDR           0x1fbf8000ULL
 #define GCR_ADDRSPACE_SZ        0x8000
include/hw/misc/mips_cpc.h +2 -1
index b0131e4a54..7dc188e8a2 100644
@@ -36,7 +36,8 @@
 
 #define TYPE_MIPS_CPC "mips-cpc"
 typedef struct MIPSCPCState MIPSCPCState;
-#define MIPS_CPC(obj) OBJECT_CHECK(MIPSCPCState, (obj), TYPE_MIPS_CPC)
+DECLARE_INSTANCE_CHECKER(MIPSCPCState, MIPS_CPC,
+                         TYPE_MIPS_CPC)
 
 struct MIPSCPCState {
     SysBusDevice parent_obj;
include/hw/misc/mips_itu.h +2 -1
index 9ddb04708a..7c19f61fbb 100644
@@ -25,7 +25,8 @@
 
 #define TYPE_MIPS_ITU "mips-itu"
 typedef struct MIPSITUState MIPSITUState;
-#define MIPS_ITU(obj) OBJECT_CHECK(MIPSITUState, (obj), TYPE_MIPS_ITU)
+DECLARE_INSTANCE_CHECKER(MIPSITUState, MIPS_ITU,
+                         TYPE_MIPS_ITU)
 
 #define ITC_CELL_DEPTH_SHIFT 2
 #define ITC_CELL_DEPTH (1u << ITC_CELL_DEPTH_SHIFT)
include/hw/misc/mos6522.h +2 -5
index b099814879..f73271ba67 100644
@@ -126,7 +126,8 @@ typedef struct MOS6522State MOS6522State;
 
 #define TYPE_MOS6522 "mos6522"
 typedef struct MOS6522DeviceClass MOS6522DeviceClass;
-#define MOS6522(obj) OBJECT_CHECK(MOS6522State, (obj), TYPE_MOS6522)
+DECLARE_OBJ_CHECKERS(MOS6522State, MOS6522DeviceClass,
+                     MOS6522, TYPE_MOS6522)
 
 struct MOS6522DeviceClass {
     DeviceClass parent_class;
@@ -143,10 +144,6 @@ struct MOS6522DeviceClass {
     uint64_t (*get_timer2_load_time)(MOS6522State *dev, MOS6522Timer *ti);
 };
 
-#define MOS6522_CLASS(cls) \
-    OBJECT_CLASS_CHECK(MOS6522DeviceClass, (cls), TYPE_MOS6522)
-#define MOS6522_GET_CLASS(obj) \
-    OBJECT_GET_CLASS(MOS6522DeviceClass, (obj), TYPE_MOS6522)
 
 extern const VMStateDescription vmstate_mos6522;
 
include/hw/misc/mps2-fpgaio.h +2 -1
index e844041bb0..991f5b731e 100644
@@ -26,7 +26,8 @@
 
 #define TYPE_MPS2_FPGAIO "mps2-fpgaio"
 typedef struct MPS2FPGAIO MPS2FPGAIO;
-#define MPS2_FPGAIO(obj) OBJECT_CHECK(MPS2FPGAIO, (obj), TYPE_MPS2_FPGAIO)
+DECLARE_INSTANCE_CHECKER(MPS2FPGAIO, MPS2_FPGAIO,
+                         TYPE_MPS2_FPGAIO)
 
 struct MPS2FPGAIO {
     /*< private >*/
include/hw/misc/mps2-scc.h +2 -1
index 10393c4e3a..445e268b1f 100644
@@ -17,7 +17,8 @@
 
 #define TYPE_MPS2_SCC "mps2-scc"
 typedef struct MPS2SCC MPS2SCC;
-#define MPS2_SCC(obj) OBJECT_CHECK(MPS2SCC, (obj), TYPE_MPS2_SCC)
+DECLARE_INSTANCE_CHECKER(MPS2SCC, MPS2_SCC,
+                         TYPE_MPS2_SCC)
 
 #define NUM_OSCCLK 3
 
include/hw/misc/msf2-sysreg.h +2 -1
index 6b5d03608a..625932354a 100644
@@ -63,7 +63,8 @@ enum {
 
 #define TYPE_MSF2_SYSREG          "msf2-sysreg"
 typedef struct MSF2SysregState MSF2SysregState;
-#define MSF2_SYSREG(obj)  OBJECT_CHECK(MSF2SysregState, (obj), TYPE_MSF2_SYSREG)
+DECLARE_INSTANCE_CHECKER(MSF2SysregState, MSF2_SYSREG,
+                         TYPE_MSF2_SYSREG)
 
 struct MSF2SysregState {
     SysBusDevice parent_obj;
include/hw/misc/nrf51_rng.h +2 -1
index 247f167100..7f2263a906 100644
@@ -39,7 +39,8 @@
 #include "qom/object.h"
 #define TYPE_NRF51_RNG "nrf51_soc.rng"
 typedef struct NRF51RNGState NRF51RNGState;
-#define NRF51_RNG(obj) OBJECT_CHECK(NRF51RNGState, (obj), TYPE_NRF51_RNG)
+DECLARE_INSTANCE_CHECKER(NRF51RNGState, NRF51_RNG,
+                         TYPE_NRF51_RNG)
 
 #define NRF51_RNG_SIZE         0x1000
 
include/hw/misc/pca9552.h +2 -1
index ebf8425903..b6f4e264fe 100644
@@ -15,7 +15,8 @@
 #define TYPE_PCA9552 "pca9552"
 #define TYPE_PCA955X "pca955x"
 typedef struct PCA955xState PCA955xState;
-#define PCA955X(obj) OBJECT_CHECK(PCA955xState, (obj), TYPE_PCA955X)
+DECLARE_INSTANCE_CHECKER(PCA955xState, PCA955X,
+                         TYPE_PCA955X)
 
 #define PCA955X_NR_REGS 10
 #define PCA955X_PIN_COUNT_MAX 16
include/hw/misc/stm32f2xx_syscfg.h +2 -2
index ff7c976d66..82ccd7cc24 100644
@@ -38,8 +38,8 @@
 
 #define TYPE_STM32F2XX_SYSCFG "stm32f2xx-syscfg"
 typedef struct STM32F2XXSyscfgState STM32F2XXSyscfgState;
-#define STM32F2XX_SYSCFG(obj) \
-    OBJECT_CHECK(STM32F2XXSyscfgState, (obj), TYPE_STM32F2XX_SYSCFG)
+DECLARE_INSTANCE_CHECKER(STM32F2XXSyscfgState, STM32F2XX_SYSCFG,
+                         TYPE_STM32F2XX_SYSCFG)
 
 struct STM32F2XXSyscfgState {
     /* <private> */
include/hw/misc/stm32f4xx_exti.h +2 -2
index 7132615785..4987c286ed 100644
@@ -38,8 +38,8 @@
 
 #define TYPE_STM32F4XX_EXTI "stm32f4xx-exti"
 typedef struct STM32F4xxExtiState STM32F4xxExtiState;
-#define STM32F4XX_EXTI(obj) \
-    OBJECT_CHECK(STM32F4xxExtiState, (obj), TYPE_STM32F4XX_EXTI)
+DECLARE_INSTANCE_CHECKER(STM32F4xxExtiState, STM32F4XX_EXTI,
+                         TYPE_STM32F4XX_EXTI)
 
 #define NUM_GPIO_EVENT_IN_LINES 16
 #define NUM_INTERRUPT_OUT_LINES 16
include/hw/misc/stm32f4xx_syscfg.h +2 -2
index 78130cb9c3..c3d89d4536 100644
@@ -39,8 +39,8 @@
 
 #define TYPE_STM32F4XX_SYSCFG "stm32f4xx-syscfg"
 typedef struct STM32F4xxSyscfgState STM32F4xxSyscfgState;
-#define STM32F4XX_SYSCFG(obj) \
-    OBJECT_CHECK(STM32F4xxSyscfgState, (obj), TYPE_STM32F4XX_SYSCFG)
+DECLARE_INSTANCE_CHECKER(STM32F4xxSyscfgState, STM32F4XX_SYSCFG,
+                         TYPE_STM32F4XX_SYSCFG)
 
 #define SYSCFG_NUM_EXTICR 4
 
include/hw/misc/tz-mpc.h +2 -1
index 2d3eae0834..34e45fdb97 100644
@@ -36,7 +36,8 @@
 
 #define TYPE_TZ_MPC "tz-mpc"
 typedef struct TZMPC TZMPC;
-#define TZ_MPC(obj) OBJECT_CHECK(TZMPC, (obj), TYPE_TZ_MPC)
+DECLARE_INSTANCE_CHECKER(TZMPC, TZ_MPC,
+                         TYPE_TZ_MPC)
 
 #define TZ_NUM_PORTS 16
 
include/hw/misc/tz-msc.h +2 -1
index 3f719833a9..7169f330ff 100644
@@ -56,7 +56,8 @@
 
 #define TYPE_TZ_MSC "tz-msc"
 typedef struct TZMSC TZMSC;
-#define TZ_MSC(obj) OBJECT_CHECK(TZMSC, (obj), TYPE_TZ_MSC)
+DECLARE_INSTANCE_CHECKER(TZMSC, TZ_MSC,
+                         TYPE_TZ_MSC)
 
 struct TZMSC {
     /*< private >*/
include/hw/misc/tz-ppc.h +2 -1
index 4646005fa5..b5251b715e 100644
@@ -70,7 +70,8 @@
 
 #define TYPE_TZ_PPC "tz-ppc"
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

include/hw/misc/unimp.h +2 -2
index 6c04c8a923..7c724bab94 100644

Lines of this file are not shown. View the raw message.

include/hw/misc/vmcoreinfo.h +2 -1
index cf0e51f863..ebada6617a 100644

Lines of this file are not shown. View the raw message.

include/hw/misc/zynq-xadc.h +2 -2
index 7e9767c74f..052f47954f 100644

Lines of this file are not shown. View the raw message.

include/hw/net/allwinner-sun8i-emac.h +2 -2
index bd38588885..89e56b815b 100644

Lines of this file are not shown. View the raw message.

include/hw/net/allwinner_emac.h +2 -1
index e927082580..f5f5b67939 100644

Lines of this file are not shown. View the raw message.

include/hw/net/cadence_gem.h +2 -1
index 04fd59a525..dff1083738 100644

Lines of this file are not shown. View the raw message.

include/hw/net/ftgmac100.h +4 -2
index 6371bf60ab..c6b1c11fca 100644

Lines of this file are not shown. View the raw message.

include/hw/net/imx_fec.h +2 -1
index 4d6ac5e408..ffdbc304b6 100644

Lines of this file are not shown. View the raw message.

include/hw/net/lance.h +2 -2
index fe459ffea7..f645d6af67 100644

Lines of this file are not shown. View the raw message.

include/hw/net/lasi_82596.h +2 -2
index 141e0cc17a..7b62b04833 100644

Lines of this file are not shown. View the raw message.

include/hw/net/msf2-emac.h +2 -2
index 6aef711007..68194d798c 100644

Lines of this file are not shown. View the raw message.

include/hw/nmi.h +2 -4
index 47fc036e74..fff41bebc6 100644

Lines of this file are not shown. View the raw message.

include/hw/nubus/mac-nubus-bridge.h +2 -2
index 8407ad21f6..6856d7e095 100644

Lines of this file are not shown. View the raw message.

include/hw/nubus/nubus.h +4 -3
index 226efb2ff7..9370f0d8f0 100644

Lines of this file are not shown. View the raw message.

include/hw/nvram/fw_cfg.h +7 -8
index 5e00fdc21e..f85393400c 100644

Lines of this file are not shown. View the raw message.

include/hw/nvram/nrf51_nvm.h +2 -1
index 48871667f1..ab99b09206 100644

Lines of this file are not shown. View the raw message.

include/hw/or-irq.h +2 -1
index 0038bfbe3d..f2f0a27381 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-bridge/simba.h +2 -2
index 300379b94d..675aa5a990 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/designware.h +4 -4
index 43ee5b3a12..551eec3107 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/gpex.h +4 -4
index d70e1c69dc..e8432eced8 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/i440fx.h +2 -2
index 74fe300bff..046c64576d 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/pnv_phb3.h +6 -3
index 43f9e873ae..182f29d681 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/pnv_phb4.h +6 -9
index 450602cb72..15a4633178 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/q35.h +4 -4
index 5db5a763d4..0f5a534f77 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/sabre.h +4 -4
index 5fb508e9ce..597bf70d69 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/spapr.h +2 -2
index 783e8905df..0431ce1048 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/uninorth.h +10 -10
index a1f3aaaecd..d10c598298 100644

Lines of this file are not shown. View the raw message.

include/hw/pci-host/xilinx-pcie.h +4 -4
index 1cbd6d2f79..6058c8c9e2 100644

Lines of this file are not shown. View the raw message.

include/hw/pci/pci.h +4 -9
index be9e298dba..c13ae1f858 100644

Lines of this file are not shown. View the raw message.

include/hw/pci/pci_bridge.h +2 -1
index b46d37faa8..7ab145955a 100644

Lines of this file are not shown. View the raw message.

include/hw/pci/pci_host.h +2 -6
index 51ea53908f..d1fc1c3604 100644

Lines of this file are not shown. View the raw message.

include/hw/pci/pcie_host.h +2 -2
index c7d2ae5bf4..f512646c0c 100644

Lines of this file are not shown. View the raw message.

include/hw/pci/pcie_port.h +6 -6
index 765399159f..2463c07fa7 100644

Lines of this file are not shown. View the raw message.

include/hw/pcmcia.h +2 -6
index 0f9e41db02..fb40ae7e09 100644

Lines of this file are not shown. View the raw message.

include/hw/platform-bus.h +2 -2
index cda1346a4f..0d035e1b71 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/mac_dbdma.h +2 -1
index e1f42cdbd3..9166d5f758 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/openpic.h +2 -1
index 81a0b3b1ee..61908c7858 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/pnv.h +20 -24

44 lines not on this page · raw message

include/hw/ppc/pnv_core.h +4 -8
index 2d91a7d519..fd17a236e3 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/pnv_homer.h +6 -7
index bedba94e18..7aadcab03c 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/pnv_lpc.h +8 -9
index 50d92517f2..cd3c13c2a8 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/pnv_occ.h +6 -7
index 30a9faea78..4fcfb32417 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/pnv_pnor.h +2 -1
index 8b27bf111c..1ec4098bb9 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/pnv_psi.h +6 -10
index 060a7a110c..a33195df17 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/pnv_xive.h +2 -5
index 24c37de184..a014e2a726 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/pnv_xscom.h +1 -4
index fb9b97f5be..7e3b189c07 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/spapr.h +8 -12
index c0be8980c7..c8cd63bc06 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/spapr_cpu_core.h +2 -6
index adcf74dbc3..fba6a01050 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/spapr_irq.h +2 -4
index 83addd0a0b..c22a72c9e2 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/spapr_tpm_proxy.h +2 -2
index 1e9890d978..300c81b1f0 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/spapr_vio.h +4 -7
index 9c9d14e63b..e289028634 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/xics.h +8 -15
index e5f48faba0..bcb584b90d 100644

Lines of this file are not shown. View the raw message.

include/hw/ppc/xive.h +14 -22
index 8ef9af1969..48595ab641 100644

Lines of this file are not shown. View the raw message.

include/hw/qdev-core.h +4 -6
index 479377f37b..e025ba9653 100644

Lines of this file are not shown. View the raw message.

include/hw/rdma/rdma.h +1 -5
index aef82e58db..e77e43a170 100644

Lines of this file are not shown. View the raw message.

include/hw/register.h +2 -1
index 29c669e901..03c8926d27 100644

Lines of this file are not shown. View the raw message.

include/hw/resettable.h +2 -4
index bcd36bce06..bdcd1276b6 100644

Lines of this file are not shown. View the raw message.

include/hw/riscv/opentitan.h +2 -2
index b42599ff54..8c15b6325f 100644

Lines of this file are not shown. View the raw message.

include/hw/riscv/riscv_hart.h +2 -2
index 617b977214..9be1fd80ed 100644

Lines of this file are not shown. View the raw message.

include/hw/riscv/spike.h +2 -2
index 121396d07a..cddeca2e77 100644

Lines of this file are not shown. View the raw message.

include/hw/riscv/virt.h +2 -2
index 3069379c84..b4ed9a32eb 100644

Lines of this file are not shown. View the raw message.

include/hw/rtc/allwinner-rtc.h +2 -6
index 1126e05f23..5a6e9fff32 100644

Lines of this file are not shown. View the raw message.

include/hw/rtc/aspeed_rtc.h +2 -1
index 295f4a7d30..d7691ab88f 100644

Lines of this file are not shown. View the raw message.

include/hw/rtc/goldfish_rtc.h +2 -2
index f31b0cbb89..b710c21c94 100644

Lines of this file are not shown. View the raw message.

include/hw/rtc/m48t59.h +2 -4
index 78aae2c072..04abedf3b2 100644

Lines of this file are not shown. View the raw message.

include/hw/rtc/mc146818rtc.h +2 -1
index 7b42d9c534..e58e006d0d 100644

Lines of this file are not shown. View the raw message.

include/hw/rtc/pl031.h +2 -1
index 3ddf48cc76..3897b424d4 100644

Lines of this file are not shown. View the raw message.

include/hw/rtc/xlnx-zynqmp-rtc.h +2 -2
index 95c85d3bf1..209de85ae6 100644

Lines of this file are not shown. View the raw message.

include/hw/rx/rx62n.h +2 -1
index 4451a9e006..3ed80dba0d 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/3270-ccw.h +2 -6
index ac254f95ed..9a11093192 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/ap-device.h +2 -2
index b3b3e98a67..fb250a20f3 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/css-bridge.h +4 -4
index 05786b38de..9fd4484204 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/event-facility.h +4 -14
index dd1a6a44c0..eccf6e924b 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/s390-ccw.h +2 -6
index f0f96952f1..2c807ee3a1 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/s390-virtio-ccw.h +2 -4
index f20c503b19..54d14da0a6 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/s390_flic.h +6 -10
index 2ae7cca85b..a6a123598d 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/sclp.h +2 -3
index 2a5bdc6dfe..5038a45612 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/storage-attributes.h +6 -10
index b5d9663f7c..efb28c48be 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/storage-keys.h +4 -8
index e94a201f71..40f042f54e 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/tod.h +2 -5
index e240faf11c..c02498f65e 100644

Lines of this file are not shown. View the raw message.

include/hw/s390x/vfio-ccw.h +2 -2
index 7bd4640ac3..9c9c8944ad 100644

Lines of this file are not shown. View the raw message.

include/hw/scsi/esp.h +2 -1
index d4a4e2930c..f281625dd5 100644

Lines of this file are not shown. View the raw message.

include/hw/scsi/scsi.h +4 -7
index bad4dfb223..3818e3fa46 100644

Lines of this file are not shown. View the raw message.

include/hw/sd/allwinner-sdhost.h +2 -6
index b23de2c548..7bccc06d1c 100644

Lines of this file are not shown. View the raw message.

include/hw/sd/aspeed_sdhci.h +2 -2
index 527075476b..783ccc2956 100644

Lines of this file are not shown. View the raw message.

include/hw/sd/bcm2835_sdhost.h +2 -2
index 233e74b002..751ba531d6 100644

Lines of this file are not shown. View the raw message.

include/hw/sd/sd.h +4 -8
index 850740ea92..31ccbeab0e 100644

Lines of this file are not shown. View the raw message.

include/hw/sd/sdhci.h +4 -3
index 67b01fcb28..01a64c5442 100644

Lines of this file are not shown. View the raw message.

include/hw/southbridge/piix.h +2 -2
index 21ad6327d2..6387f2b612 100644

Lines of this file are not shown. View the raw message.

include/hw/sparc/sparc32_dma.h +8 -8
index 9c80ef54ff..a402665a9c 100644

Lines of this file are not shown. View the raw message.

include/hw/sparc/sun4m_iommu.h +2 -1
index 6095eed0af..4e2ab34cde 100644

Lines of this file are not shown. View the raw message.

include/hw/sparc/sun4u_iommu.h +2 -1
index dfe10459e5..f94566a72c 100644

Lines of this file are not shown. View the raw message.

include/hw/ssi/aspeed_smc.h +2 -5
index a2072ffeea..8e023d8ff6 100644

Lines of this file are not shown. View the raw message.

include/hw/ssi/imx_spi.h +2 -1
index 3a966af0ec..874fea492d 100644

Lines of this file are not shown. View the raw message.

include/hw/ssi/mss-spi.h +2 -1
index 40e1a5ac90..7c16cf6b49 100644

Lines of this file are not shown. View the raw message.

include/hw/ssi/pl022.h +2 -1
index 64aeb61eef..1f5da7cc44 100644

Lines of this file are not shown. View the raw message.

include/hw/ssi/ssi.h +2 -6
index b42765f415..b9286989fc 100644

Lines of this file are not shown. View the raw message.

include/hw/ssi/stm32f2xx_spi.h +2 -2
index 1c8ff7d724..4bb36d04ed 100644

Lines of this file are not shown. View the raw message.

include/hw/ssi/xilinx_spips.h +8 -12
index 2171018601..b1ab347617 100644

Lines of this file are not shown. View the raw message.

include/hw/stream.h +2 -4
index bd41750e94..e39d5a5b55 100644

Lines of this file are not shown. View the raw message.

include/hw/sysbus.h +4 -7
index 3537e43f23..77e21bba18 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/a9gtimer.h +2 -1
index 88811c6c8f..f6fcc4bfc6 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/allwinner-a10-pit.h +2 -1
index fa060c684d..9638e3c84c 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/arm_mptimer.h +2 -2
index 643a256ecf..47d5e51686 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/armv7m_systick.h +2 -1
index 33df057958..b605688fee 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/aspeed_timer.h +2 -6
index c890aaa949..4c76f955c9 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/avr_timer16.h +2 -2
index 9efe75ce5e..d454bb31cb 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/bcm2835_systmr.h +2 -2
index 796f62cf88..64166bd712 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/cmsdk-apb-dualtimer.h +2 -2
index 8a1137aec7..7a5b9df5e5 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/cmsdk-apb-timer.h +2 -2
index a7ca523529..0912bc0f3c 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/digic-timer.h +2 -1
index 543bf8c6be..84a0ef473a 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/i8254.h +2 -6
index 6adbc31e7e..1a522a2457 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/imx_epit.h +2 -1
index 1ca110caf5..39bcf81331 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/imx_gpt.h +2 -1
index b96633d8b2..ff5c8a351a 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/mss-timer.h +2 -2
index 011c5f1ba9..d207bae2c0 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/nrf51_timer.h +2 -1
index b4eb29bd76..4261a03b95 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/renesas_cmt.h +2 -1
index 313f9e1965..1c0b65c1d5 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/renesas_tmr.h +2 -1
index e2abcb13ad..caf7eec0dc 100644

Lines of this file are not shown. View the raw message.

include/hw/timer/stm32f2xx_timer.h +2 -2
index 9eb9201085..90f40f1746 100644

Lines of this file are not shown. View the raw message.

include/hw/usb.h +4 -7
index e6ec0c891c..5783635491 100644

Lines of this file are not shown. View the raw message.

include/hw/usb/chipidea.h +2 -1
index 1db449e1c4..f0303b8721 100644

Lines of this file are not shown. View the raw message.

include/hw/usb/imx-usb-phy.h +2 -1
index 9861acb5ac..f7f92fc462 100644

Lines of this file are not shown. View the raw message.

include/hw/vfio/vfio-amd-xgbe.h +2 -8
index b860ac0446..a894546c02 100644

Lines of this file are not shown. View the raw message.

include/hw/vfio/vfio-calxeda-xgmac.h +2 -8
index b19dc2160b..8482f151dd 100644

Lines of this file are not shown. View the raw message.

include/hw/vfio/vfio-platform.h +2 -6
index 248c23dba7..c414c3dffc 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/vhost-scsi-common.h +2 -2
index f198f25119..5f0bf73d9d 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/vhost-scsi.h +2 -2
index 72ae842646..7a77644150 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/vhost-user-blk.h +2 -2
index 9d38877907..dc40ab6f11 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/vhost-user-fs.h +2 -2
index fa82be0e8a..9033e6f902 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/vhost-user-scsi.h +2 -2
index c4c4c29bf9..342d67ee9e 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/vhost-user-vsock.h +2 -2
index d7eda986b6..b3c40c16a3 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/vhost-vsock-common.h +2 -2
index a181396215..60bfb68db1 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/vhost-vsock.h +2 -2
index e13ff85d12..c561cc427a 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-balloon.h +2 -2
index a5b869a4d4..0d08f496d9 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-blk.h +2 -2
index d299b55cb9..29c9f32353 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-bus.h +2 -5
index f3e9096370..ef8abe49c5 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-crypto.h +2 -2
index 4134e1b7ca..7969695983 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-gpu-pci.h +2 -2
index d727c8cada..5201792ede 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-gpu.h +6 -10
index f464004bc2..72f8689e2e 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-input.h +8 -12
index c15e983d36..c54aa6aa72 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-iommu.h +2 -2
index d852980b30..ae9dc566c7 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-mem.h +2 -6
index 08e37d8e84..5f0b81a967 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-mmio.h +2 -2
index 947fb02d3e..dca651fd14 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-net.h +2 -2
index 2e81b5bfcb..929ed232dd 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-pmem.h +2 -6
index 56bce2be7a..6c15abad70 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-rng.h +2 -2
index 34fb5f695f..3671c9ba19 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-scsi.h +4 -4
index bbf4b9a356..9a8a06fdd1 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio-serial.h +6 -10
index 94da09ec34..bbc76d5032 100644

Lines of this file are not shown. View the raw message.

include/hw/virtio/virtio.h +2 -6
index 261d087de8..807280451b 100644

Lines of this file are not shown. View the raw message.

include/hw/vmstate-if.h +2 -4
index eabf5b05ad..52df571d17 100644

Lines of this file are not shown. View the raw message.

include/hw/watchdog/cmsdk-apb-watchdog.h +2 -2
index be2983eefa..63f4becf86 100644

Lines of this file are not shown. View the raw message.

include/hw/watchdog/wdt_aspeed.h +2 -6
index ba9a0a1fd8..2ca1eb5432 100644

Lines of this file are not shown. View the raw message.

include/hw/watchdog/wdt_diag288.h +2 -6
index e611163821..f72c1d3318 100644

Lines of this file are not shown. View the raw message.

include/hw/watchdog/wdt_imx2.h +2 -1
index 8757418b46..7665d93640 100644

Lines of this file are not shown. View the raw message.

include/hw/xen/xen-block.h +6 -10
index 54f2e35122..8ff5421dc3 100644

Lines of this file are not shown. View the raw message.

include/hw/xen/xen-bus.h +4 -12
index 910cf49161..35fec7c905 100644

Lines of this file are not shown. View the raw message.

include/hw/xen/xen-legacy-backend.h +2 -2
index 89b51e05fc..ba7a3c59bb 100644

Lines of this file are not shown. View the raw message.

include/io/channel-buffer.h +2 -2
index 344d5957fd..89632ef437 100644

Lines of this file are not shown. View the raw message.

include/io/channel-command.h +2 -2
index b1671062d0..4b64ff011b 100644

Lines of this file are not shown. View the raw message.

include/io/channel-file.h +2 -2
index d91c9f5bc1..c6caf179d9 100644

Lines of this file are not shown. View the raw message.

include/io/channel-socket.h +2 -2
index ee898d991b..62e3e2e970 100644

Lines of this file are not shown. View the raw message.

include/io/channel-tls.h +2 -2
index ebd42f981e..036bf54195 100644

Lines of this file are not shown. View the raw message.

include/io/channel-websock.h +2 -2
index 5ab8811306..b07eddabe1 100644

Lines of this file are not shown. View the raw message.

include/io/channel.h +2 -6
index 67b9768eff..3ebdc7954f 100644

Lines of this file are not shown. View the raw message.

include/io/dns-resolver.h +2 -6
index 5e720bf267..96a3186b6b 100644

Lines of this file are not shown. View the raw message.

include/io/net-listener.h +2 -6
index fbdd2dbf9a..93367db291 100644

Lines of this file are not shown. View the raw message.

include/net/can_emu.h +2 -2
index 7e90fd8a45..150f91a657 100644

Lines of this file are not shown. View the raw message.

include/net/can_host.h +2 -6
index 13b6a191dd..18979c2e2d 100644

Lines of this file are not shown. View the raw message.

include/net/filter.h +2 -6
index 0d4f011bc0..e7e593128a 100644

Lines of this file are not shown. View the raw message.

include/qom/object_interfaces.h +2 -6
index 2be985f86e..f118fb516b 100644

Lines of this file are not shown. View the raw message.

include/scsi/pr-manager.h +2 -6
index 2c699e4030..f801fe9533 100644

Lines of this file are not shown. View the raw message.

include/sysemu/cryptodev.h +2 -9
index e11526271a..65c017cf81 100644

Lines of this file are not shown. View the raw message.

include/sysemu/hostmem.h +2 -6
index 7b775b6687..1e6078f872 100644

Lines of this file are not shown. View the raw message.

include/sysemu/hvf.h +2 -2
index 566b5f52fc..1398679458 100644

Lines of this file are not shown. View the raw message.

include/sysemu/iothread.h +2 -2
index 42902ffb9f..0c5284dbbc 100644

Lines of this file are not shown. View the raw message.

include/sysemu/kvm.h +2 -2
index 3e89884c54..5bbea53883 100644

Lines of this file are not shown. View the raw message.

include/sysemu/rng-random.h +2 -1
index 87e82dd7a3..58033ac3fe 100644

Lines of this file are not shown. View the raw message.

include/sysemu/rng.h +2 -6
index c38da7d342..f8fc948109 100644

Lines of this file are not shown. View the raw message.

include/sysemu/tpm.h +2 -4
index 04673cab53..1a85564e47 100644

Lines of this file are not shown. View the raw message.

include/sysemu/tpm_backend.h +2 -6
index 740c94c6cd..e038b79d34 100644

Lines of this file are not shown. View the raw message.

include/sysemu/vhost-user-backend.h +2 -6
index 89eb5eaf65..e4c85e33c0 100644

Lines of this file are not shown. View the raw message.

include/ui/console.h +2 -6
index 2a74a27d50..8602203523 100644

Lines of this file are not shown. View the raw message.

migration/migration.h +2 -6
index 4103e549bb..bdc7450da3 100644

Lines of this file are not shown. View the raw message.

target/alpha/cpu-qom.h +2 -6
index 1124668cf0..45350318c9 100644

Lines of this file are not shown. View the raw message.

target/arm/cpu-qom.h +4 -10
index d0c68b01c5..92d58f84fe 100644

Lines of this file are not shown. View the raw message.

target/arm/idau.h +2 -4
index 2f09bbb34f..0ef5251971 100644

Lines of this file are not shown. View the raw message.

target/avr/cpu-qom.h +2 -6
index fac8430253..1bbfbb2087 100644

Lines of this file are not shown. View the raw message.

target/cris/cpu-qom.h +2 -6
index cac3e9af1b..eced6ef7c9 100644

Lines of this file are not shown. View the raw message.

target/hppa/cpu-qom.h +2 -6
index 295b2aaf19..5c5aa0c053 100644

Lines of this file are not shown. View the raw message.

target/i386/cpu-qom.h +2 -6
index 6b0bf476e5..05b52ba74c 100644

Lines of this file are not shown. View the raw message.

target/lm32/cpu-qom.h +2 -6
index 2c0654b695..9bf2f82ffe 100644

Lines of this file are not shown. View the raw message.

target/m68k/cpu-qom.h +2 -6
index 3b199be545..241a3b19af 100644

Lines of this file are not shown. View the raw message.

target/microblaze/cpu-qom.h +2 -6
index 564fa18ccb..73c2237f98 100644

Lines of this file are not shown. View the raw message.

target/mips/cpu-qom.h +2 -6
index 3a5fd9561e..82f45a828c 100644

Lines of this file are not shown. View the raw message.

target/moxie/cpu.h +2 -6
index af4d6abf16..a9832a2d85 100644

Lines of this file are not shown. View the raw message.

target/nios2/cpu.h +2 -6
index 7162cbdf5c..0b91a3634b 100644

Lines of this file are not shown. View the raw message.

target/openrisc/cpu.h +2 -6
index ab0dd55358..5e6d8a40d6 100644

Lines of this file are not shown. View the raw message.

target/ppc/cpu-qom.h +2 -6
index 017f0efc7b..f7e600c7b3 100644

Lines of this file are not shown. View the raw message.

target/ppc/cpu.h +2 -8
index 1c6fbfcfdb..766e9c5c26 100644

Lines of this file are not shown. View the raw message.

target/riscv/cpu.h +2 -6
index ff86613d94..04ccb78738 100644

Lines of this file are not shown. View the raw message.

target/rx/cpu-qom.h +2 -6
index dd96469e04..05f5773ab1 100644

Lines of this file are not shown. View the raw message.

target/s390x/cpu-qom.h +2 -6
index 13f1f2659e..5f0dccdac1 100644

Lines of this file are not shown. View the raw message.

target/sh4/cpu-qom.h +2 -6
index bf71c0f8e5..b04b2bb4bf 100644

Lines of this file are not shown. View the raw message.

target/sparc/cpu-qom.h +2 -6
index b7cc81e5f3..42cb631d45 100644

Lines of this file are not shown. View the raw message.

target/tilegx/cpu.h +2 -6
index d6cc1d2982..d4cf70dc15 100644

Lines of this file are not shown. View the raw message.

target/tricore/cpu-qom.h +2 -6
index cef466da74..1988c26093 100644

Lines of this file are not shown. View the raw message.

target/unicore32/cpu-qom.h +2 -6
index 6a1cb1c82d..5b67ac532d 100644

Lines of this file are not shown. View the raw message.

target/xtensa/cpu-qom.h +2 -6
index cd9f31dc84..ef13262b42 100644

Lines of this file are not shown. View the raw message.

accel/tcg/tcg-all.c +2 -2
index 7dba29cc48..7098ad96c3 100644

Lines of this file are not shown. View the raw message.

backends/cryptodev-builtin.c +2 -3
index 84bd84efe7..f047ad0362 100644

Lines of this file are not shown. View the raw message.

backends/cryptodev-vhost-user.c +2 -3
index 5e903f6507..41089dede1 100644

Lines of this file are not shown. View the raw message.

backends/dbus-vmstate.c +2 -6
index 0473c5c335..bfbd4f09f1 100644

Lines of this file are not shown. View the raw message.

backends/hostmem-file.c +2 -2
index 2c3bcb8291..a3b2e8209e 100644

Lines of this file are not shown. View the raw message.

backends/hostmem-memfd.c +2 -2
index 45114bd641..8cf6bcbda2 100644

Lines of this file are not shown. View the raw message.

backends/rng-builtin.c +2 -1
index 4bf073c963..459be97a5a 100644

Lines of this file are not shown. View the raw message.

backends/rng-egd.c +2 -1
index ee1854f31c..d905fe657c 100644

Lines of this file are not shown. View the raw message.

backends/tpm/tpm_emulator.c +2 -2
index 2509c8d327..13657d9aba 100644

Lines of this file are not shown. View the raw message.

backends/tpm/tpm_passthrough.c +2 -2
index b703f7e412..10722e0a41 100644

Lines of this file are not shown. View the raw message.

chardev/baum.c +2 -1
index cb906060d9..5deca778bc 100644

Lines of this file are not shown. View the raw message.

chardev/char-parallel.c +2 -4
index bebe050705..66e4589b2b 100644

Lines of this file are not shown. View the raw message.

chardev/char-pty.c +2 -1
index 963fe4f0ca..a2d1e7c985 100644

Lines of this file are not shown. View the raw message.

chardev/char-ringbuf.c +2 -2
index 301a5d8634..d40d21d3cf 100644

Lines of this file are not shown. View the raw message.

chardev/char-socket.c +2 -2
index 9435b7d643..95e45812d5 100644

Lines of this file are not shown. View the raw message.

chardev/char-udp.c +2 -1
index 58be3487e6..16b5dbce58 100644

Lines of this file are not shown. View the raw message.

chardev/char-win-stdio.c +2 -2
index 980e0d1356..a4771ab82e 100644

Lines of this file are not shown. View the raw message.

chardev/msmouse.c +2 -2
index 0a7926697c..eb9231dcdb 100644

Lines of this file are not shown. View the raw message.

chardev/testdev.c +2 -2
index bbae59c941..a92caca3c3 100644

Lines of this file are not shown. View the raw message.

chardev/wctablet.c +2 -2
index 361a12fdd4..95e005f5a5 100644

Lines of this file are not shown. View the raw message.

hw/acpi/piix4.c +2 -2
index ba39184650..1574f7db3e 100644

Lines of this file are not shown. View the raw message.

hw/alpha/typhoon.c +2 -2
index bd484e42bd..d02b14d89f 100644

Lines of this file are not shown. View the raw message.

hw/arm/collie.c +2 -2
index 82ffc82dc7..a49f4a1c7c 100644

Lines of this file are not shown. View the raw message.

hw/arm/highbank.c +2 -2
index cbf6e72ad6..e2ace803ef 100644

Lines of this file are not shown. View the raw message.

hw/arm/integratorcp.c +6 -6
index 75e608e68e..19989b61b9 100644

Lines of this file are not shown. View the raw message.

hw/arm/microbit.c +2 -2
index e94f711e89..9a4a3d357a 100644

Lines of this file are not shown. View the raw message.

hw/arm/mps2-tz.c +2 -6
index 8870aea814..dbf7d63dc8 100644

Lines of this file are not shown. View the raw message.

hw/arm/mps2.c +2 -6
index b5173e398d..4ee5c38459 100644

Lines of this file are not shown. View the raw message.

hw/arm/musca.c +2 -6
index 7fd8634ac5..16015255c8 100644

Lines of this file are not shown. View the raw message.

hw/arm/musicpal.c +16 -16
index 695699e01e..2117a04171 100644

Lines of this file are not shown. View the raw message.

hw/arm/palm.c +2 -2
index ddabb0e2d6..abc6495489 100644

Lines of this file are not shown. View the raw message.

hw/arm/pxa2xx.c +6 -6
index a48a32ee09..701baa84ca 100644

Lines of this file are not shown. View the raw message.

hw/arm/pxa2xx_gpio.c +2 -2
index 2cd6dd929e..16bbe4fb70 100644

Lines of this file are not shown. View the raw message.

hw/arm/pxa2xx_pic.c +2 -2
index 00e72fde4e..cb52a9dff3 100644

Lines of this file are not shown. View the raw message.

hw/arm/raspi.c +2 -6
index d9f7eeb06b..d2f674587d 100644

Lines of this file are not shown. View the raw message.

hw/arm/sbsa-ref.c +2 -2
index a638fb369e..ac68b4640d 100644

Lines of this file are not shown. View the raw message.

hw/arm/spitz.c +12 -13
index 0bf5745eb2..a7ad667f06 100644

Lines of this file are not shown. View the raw message.

hw/arm/stellaris.c +6 -6
index d8d7d3a43b..d6fc4a4681 100644

Lines of this file are not shown. View the raw message.

hw/arm/strongarm.c +12 -12
index 8faeaf8079..0fe829b868 100644

Lines of this file are not shown. View the raw message.

hw/arm/tosa.c +4 -3
index 6ec83a2e2d..2ef6c7b288 100644

Lines of this file are not shown. View the raw message.

hw/arm/versatilepb.c +2 -2
index 0e2d74cef2..2ba69f24b7 100644

Lines of this file are not shown. View the raw message.

hw/arm/vexpress.c +2 -6
index 4c2c377823..01bb4bba1e 100644

Lines of this file are not shown. View the raw message.

hw/arm/xilinx_zynq.c +2 -2
index bce99ef7be..9eb9cea8d4 100644

Lines of this file are not shown. View the raw message.

hw/arm/xlnx-versal-virt.c +2 -2
index ffa9dd476b..5a01e856fd 100644

Lines of this file are not shown. View the raw message.

hw/arm/xlnx-zcu102.c +2 -2
index 74f48325ac..19d5a4d4e0 100644

Lines of this file are not shown. View the raw message.

hw/arm/z2.c +4 -2
index 9c69481269..72ecb6df29 100644

Lines of this file are not shown. View the raw message.

hw/audio/ac97.c +2 -2
index 9614419b7a..eb8a7f032d 100644

Lines of this file are not shown. View the raw message.

hw/audio/adlib.c +2 -1
index a216fe1925..870116e324 100644

Lines of this file are not shown. View the raw message.

hw/audio/cs4231.c +2 -2
index 2b868051c3..8e9554ce9b 100644

Lines of this file are not shown. View the raw message.

hw/audio/cs4231a.c +2 -1
index fc064a93d7..7d60ce6f0e 100644

Lines of this file are not shown. View the raw message.

hw/audio/es1370.c +2 -2
index bd620d5ee2..a824f8949e 100644

Lines of this file are not shown. View the raw message.

hw/audio/gus.c +2 -1
index 3cd62d43d7..307fd48315 100644

Lines of this file are not shown. View the raw message.

hw/audio/hda-codec.c +2 -1
index 8dee2915be..77d31b91a4 100644

Lines of this file are not shown. View the raw message.

hw/audio/intel-hda.c +2 -2
index de30443c2e..4330213fff 100644

Lines of this file are not shown. View the raw message.

hw/audio/marvell_88w8618.c +2 -2
index 5f2e7f3b73..c8641562cc 100644

Lines of this file are not shown. View the raw message.

hw/audio/milkymist-ac97.c +2 -2
index 4eacd4071a..7893539019 100644

Lines of this file are not shown. View the raw message.

hw/audio/pcspk.c +2 -1
index 57edbe652c..cbee8855fb 100644

Lines of this file are not shown. View the raw message.

hw/audio/pl041.c +2 -1
index e514a8cd70..570a234b72 100644

Lines of this file are not shown. View the raw message.

hw/audio/sb16.c +2 -1
index 840f743e41..6aa2c0fb93 100644

Lines of this file are not shown. View the raw message.

hw/audio/wm8750.c +2 -1
index dae23f43a4..7d6fcfec03 100644

Lines of this file are not shown. View the raw message.

hw/avr/arduino.c +2 -6
index c24183c07f..3c8388490d 100644

Lines of this file are not shown. View the raw message.

hw/avr/atmega.c +2 -4
index c3b8e05110..44c6afebbb 100644

Lines of this file are not shown. View the raw message.

hw/block/fdc.c +8 -5
index 70bfb136e4..224bac504f 100644

Lines of this file are not shown. View the raw message.

hw/block/m25p80.c +2 -6
index 9de4f9b274..8dae779c76 100644

Lines of this file are not shown. View the raw message.

hw/block/nand.c +2 -2
index 7c7a08b7aa..5c8112ed5a 100644

Lines of this file are not shown. View the raw message.

hw/block/onenand.c +2 -1
index 5fe235d11d..19f55aba66 100644

Lines of this file are not shown. View the raw message.

hw/char/debugcon.c +2 -2
index 219e88efee..daaaca0f39 100644

Lines of this file are not shown. View the raw message.

hw/char/etraxfs_ser.c +2 -2
index 9ca9f21c4d..d9fba2ae6c 100644

Lines of this file are not shown. View the raw message.

hw/char/exynos4210_uart.c +2 -2
index e3a21dfdb8..b8ea34edbd 100644

Lines of this file are not shown. View the raw message.

hw/char/grlib_apbuart.c +2 -2
index f48ad21c7c..6fd88d83ad 100644

Lines of this file are not shown. View the raw message.

hw/char/ipoctal232.c +2 -2
index c7ea7f8da9..2c987df8ad 100644

Lines of this file are not shown. View the raw message.

hw/char/lm32_juart.c +2 -1
index e7af76ad1a..5723f2e189 100644

Lines of this file are not shown. View the raw message.

hw/char/lm32_uart.c +2 -1
index 8aff78592b..624bc83c5f 100644

Lines of this file are not shown. View the raw message.

hw/char/mcf_uart.c +2 -1
index d6745da72a..f6baa3ce77 100644

Lines of this file are not shown. View the raw message.

hw/char/milkymist-uart.c +2 -2
index 300a9150cf..41204a0e28 100644

Lines of this file are not shown. View the raw message.

hw/char/parallel.c +2 -2
index 73ac5ee9e3..ddb14f3197 100644

Lines of this file are not shown. View the raw message.

hw/char/sclpconsole-lm.c +2 -2
index 0b77af68a4..81f6d0ed4f 100644

Lines of this file are not shown. View the raw message.

hw/char/sclpconsole.c +2 -2
index 3919368570..aa72ab40b9 100644

Lines of this file are not shown. View the raw message.

hw/char/serial-isa.c +2 -1
index 3d1c9a2d75..d4aad81a85 100644

Lines of this file are not shown. View the raw message.

hw/char/serial-pci.c +2 -1
index 649f08c20e..f68948154e 100644

Lines of this file are not shown. View the raw message.

hw/char/spapr_vty.c +2 -2
index 9944933c16..dd6dd2d8c3 100644

Lines of this file are not shown. View the raw message.

hw/char/terminal3270.c +2 -2
index 4efd6a9433..d77981bb6d 100644

Lines of this file are not shown. View the raw message.

hw/char/virtio-console.c +2 -2
index 31144c68b6..bc752cf90f 100644

Lines of this file are not shown. View the raw message.

hw/char/xilinx_uartlite.c +2 -2
index e7ab97d58d..8e9f9cd9ec 100644

Lines of this file are not shown. View the raw message.

hw/core/irq.c +2 -1
index fb3045b912..8a9cbdd556 100644

Lines of this file are not shown. View the raw message.

hw/cpu/realview_mpcore.c +2 -2
index 1f1df08cfa..fb547aceef 100644

Lines of this file are not shown. View the raw message.

hw/display/ads7846.c +2 -1
index 59bbce3979..4b87ee7135 100644

Lines of this file are not shown. View the raw message.

hw/display/artist.c +2 -1
index c030894e7b..80cd66e41d 100644

Lines of this file are not shown. View the raw message.

hw/display/bochs-display.c +2 -2
index ef92f3a4e7..41587388c4 100644

Lines of this file are not shown. View the raw message.

hw/display/cg3.c +2 -1
index 49d7e777f9..d66ba9ad6a 100644

Lines of this file are not shown. View the raw message.

hw/display/cirrus_vga.c +2 -2
index 9602cea4cc..c088f38cf8 100644

Lines of this file are not shown. View the raw message.

hw/display/cirrus_vga_isa.c +2 -2
index 28d1fa41e7..e6adee1df4 100644

Lines of this file are not shown. View the raw message.

hw/display/exynos4210_fimd.c +2 -2
index 993b7e9dae..3ef8698eb7 100644

Lines of this file are not shown. View the raw message.

hw/display/g364fb.c +2 -1
index df674c3c01..4a32fe4c94 100644

Lines of this file are not shown. View the raw message.

hw/display/jazz_led.c +2 -1
index 97ec36878b..647d05f602 100644

Lines of this file are not shown. View the raw message.

hw/display/milkymist-tmu2.c +2 -2
index 66cb8e6a60..8a9e7c23fb 100644

Lines of this file are not shown. View the raw message.

hw/display/milkymist-vgafb.c +2 -2
index bbf412d9a0..2c879129fb 100644

Lines of this file are not shown. View the raw message.

hw/display/next-fb.c +2 -1
index 068dc0656f..94db0202a3 100644

Lines of this file are not shown. View the raw message.

hw/display/pl110.c +2 -1
index 4cf953c2f4..af51a2b9e7 100644

Lines of this file are not shown. View the raw message.

hw/display/ramfb-standalone.c +2 -1
index dae32b9fda..8c0094397f 100644

Lines of this file are not shown. View the raw message.

hw/display/sii9022.c +2 -1
index 4bf2c559cd..d88166f449 100644

Lines of this file are not shown. View the raw message.

hw/display/sm501.c +4 -3
index f886c1e51b..51120c6c3e 100644

Lines of this file are not shown. View the raw message.

hw/display/ssd0303.c +2 -1
index 8804567c1f..0378573a42 100644

Lines of this file are not shown. View the raw message.

hw/display/ssd0323.c +2 -1
index c9d79cfcd3..037da81127 100644

Lines of this file are not shown. View the raw message.

hw/display/tcx.c +2 -1
index 5c75589919..69e901a800 100644

Lines of this file are not shown. View the raw message.

hw/display/vga-isa.c +2 -1
index 50efc3760a..0ebfcca9d1 100644

Lines of this file are not shown. View the raw message.

hw/display/vga-pci.c +2 -1
index 852cbf36e9..3b45fa3bad 100644

Lines of this file are not shown. View the raw message.

hw/display/vhost-user-gpu-pci.c +2 -2
index 678b762bbb..a02b23ecaf 100644

Lines of this file are not shown. View the raw message.

hw/display/vhost-user-vga.c +2 -2
index 2cc9616bea..7110ea6231 100644

Lines of this file are not shown. View the raw message.

hw/display/virtio-gpu-pci.c +2 -2
index 7248ec30c7..d742a30aec 100644

Lines of this file are not shown. View the raw message.

hw/display/virtio-vga.c +2 -2
index 0bb98ede75..17e5658d43 100644

Lines of this file are not shown. View the raw message.

hw/display/vmware_vga.c +2 -2
index 076dfcedd7..bef0d7d69a 100644

Lines of this file are not shown. View the raw message.

hw/dma/i82374.c +2 -1
index c12946aaef..5b7ff635f7 100644

Lines of this file are not shown. View the raw message.

hw/dma/pl330.c +2 -1
index 380d45db8f..859586fd2f 100644

Lines of this file are not shown. View the raw message.

hw/dma/puv3_dma.c +2 -1
index 72e7b395b0..825e3dc0ac 100644

Lines of this file are not shown. View the raw message.

hw/dma/pxa2xx_dma.c +2 -1
index 6ae8035831..4f6c0e5e5e 100644

Lines of this file are not shown. View the raw message.

hw/dma/rc4030.c +2 -2
index 7d6eaf5e96..c584815d06 100644

Lines of this file are not shown. View the raw message.

hw/dma/xilinx_axidma.c +6 -8
index 6d48fea8fe..f313453495 100644

Lines of this file are not shown. View the raw message.

hw/gpio/gpio_key.c +2 -1
index 2500a23c6e..86aa78aae4 100644

Lines of this file are not shown. View the raw message.

hw/gpio/max7310.c +2 -1
index dd7e7f293d..5511047f35 100644

Lines of this file are not shown. View the raw message.

hw/gpio/mpc8xxx.c +2 -1
index b33462e4db..dac8b1be38 100644

Lines of this file are not shown. View the raw message.

hw/gpio/pl061.c +2 -1
index 6c36407079..3420df0d1f 100644

Lines of this file are not shown. View the raw message.

hw/gpio/puv3_gpio.c +2 -1
index 5e0ee783dc..98ea2b4c2e 100644

Lines of this file are not shown. View the raw message.

hw/gpio/zaurus.c +2 -1
index 048e40c072..3d25c55d06 100644

Lines of this file are not shown. View the raw message.

hw/hppa/dino.c +2 -2
index fa739adc7b..c0c9b8a2b8 100644

Lines of this file are not shown. View the raw message.

hw/hppa/lasi.c +2 -2
index 1acb9ce631..c0b970f55c 100644

Lines of this file are not shown. View the raw message.

hw/hyperv/hyperv.c +2 -1
index 5dfa9d77e1..aa5a2a9bd8 100644

Lines of this file are not shown. View the raw message.

hw/hyperv/hyperv_testdev.c +2 -2
index 8f78fce088..f6ee98e00c 100644

Lines of this file are not shown. View the raw message.

hw/i2c/bitbang_i2c.c +2 -1
index 4ff3c0b4ec..c1b9f298d9 100644

Lines of this file are not shown. View the raw message.

hw/i2c/exynos4210_i2c.c +2 -2
index 9d2f780d2a..ff82226e9f 100644

Lines of this file are not shown. View the raw message.

hw/i2c/mpc_i2c.c +2 -2
index 232a277da4..156a25a8e9 100644

Lines of this file are not shown. View the raw message.

hw/i2c/smbus_eeprom.c +2 -2
index 4f98012f1c..c6777844cf 100644

Lines of this file are not shown. View the raw message.

hw/i2c/smbus_ich9.c +2 -2
index 44d26fcf39..2d4578511d 100644

Lines of this file are not shown. View the raw message.

hw/i2c/versatile_i2c.c +2 -2
index 3ab386d671..3a04ba3969 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvm/clock.c +2 -1
index 94ece445af..37f47540e5 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvm/i8254.c +2 -5
index d3e4142b16..e18fd337fa 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvm/i8259.c +2 -4
index b256f97c83..3f8bf69e9c 100644

Lines of this file are not shown. View the raw message.

hw/i386/kvmvapic.c +2 -1
index 857d9f4a61..a4e05f086e 100644

Lines of this file are not shown. View the raw message.

hw/i386/port92.c +2 -1
index 48200def5d..c00dcb261b 100644

Lines of this file are not shown. View the raw message.

hw/i386/vmmouse.c +2 -1
index d187de3745..ae4cbc7add 100644

Lines of this file are not shown. View the raw message.

hw/i386/vmport.c +2 -1
index 3720834630..df52b6f903 100644

Lines of this file are not shown. View the raw message.

hw/i386/xen/xen_platform.c +2 -2
index e8dbd580c5..a8bbe8c833 100644

Lines of this file are not shown. View the raw message.

hw/i386/xen/xen_pvdevice.c +2 -2
index 518c66d0bf..67f83616d3 100644

Lines of this file are not shown. View the raw message.

hw/ide/isa.c +2 -1
index 438f74e67c..9a3489691b 100644

Lines of this file are not shown. View the raw message.

hw/ide/microdrive.c +2 -1
index 28f171bf15..6e7f5df901 100644

Lines of this file are not shown. View the raw message.

hw/ide/mmio.c +2 -1
index 501afdfaaa..4bf6e3a8b7 100644

Lines of this file are not shown. View the raw message.

hw/ide/sii3112.c +1 -1
index 11c5b88bbf..968c239ab8 100644

Lines of this file are not shown. View the raw message.

hw/input/adb-kbd.c +2 -5
index a439bf6361..fe0c363d64 100644

Lines of this file are not shown. View the raw message.

hw/input/adb-mouse.c +2 -5
index 8e4cf470d4..f5750909b4 100644

Lines of this file are not shown. View the raw message.

hw/input/lm832x.c +2 -1
index aab94d2815..70245fd817 100644

Lines of this file are not shown. View the raw message.

hw/input/milkymist-softusb.c +2 -2
index 8b5ffd28f2..eaaf8adde4 100644

Lines of this file are not shown. View the raw message.

hw/input/pl050.c +2 -1
index 8eb6866953..7c53ae97da 100644

Lines of this file are not shown. View the raw message.

hw/intc/arm_gicv2m.c +2 -1
index 8fb566d187..04d7a6d68b 100644

Lines of this file are not shown. View the raw message.

hw/intc/etraxfs_pic.c +2 -2
index cf4b3c5850..54ed4c77f7 100644

Lines of this file are not shown. View the raw message.

hw/intc/exynos4210_combiner.c +2 -2
index 8e54f156c4..7b01481ab8 100644

Lines of this file are not shown. View the raw message.

hw/intc/exynos4210_gic.c +4 -4
index ded31466ce..f9487673fc 100644

Lines of this file are not shown. View the raw message.

hw/intc/grlib_irqmp.c +2 -1
index 5a60396390..9b34a8ae03 100644

Lines of this file are not shown. View the raw message.

hw/intc/i8259.c +2 -2
index 9663207d34..344fd04db1 100644

Lines of this file are not shown. View the raw message.

hw/intc/lm32_pic.c +2 -1
index b08d9822ab..e8b4015efd 100644

Lines of this file are not shown. View the raw message.

hw/intc/loongson_liointc.c +2 -2
index e11ca68647..30fb375b72 100644

Lines of this file are not shown. View the raw message.

hw/intc/nios2_iic.c +2 -2
index 2594381a95..aa26f059a1 100644

Lines of this file are not shown. View the raw message.

hw/intc/ompic.c +2 -1
index 8dd763d6c5..a8ea621d9e 100644

Lines of this file are not shown. View the raw message.

hw/intc/openpic_kvm.c +2 -2
index 3f5891a8a1..8c8fbeddfe 100644

Lines of this file are not shown. View the raw message.

hw/intc/pl190.c +2 -1
index 4f2aa58642..ee3206132f 100644

Lines of this file are not shown. View the raw message.

hw/intc/puv3_intc.c +2 -1
index 3a8bc154ba..8bceede256 100644

Lines of this file are not shown. View the raw message.

hw/intc/s390_flic_kvm.c +2 -4
index c4ae10d978..35d91afa55 100644

Lines of this file are not shown. View the raw message.

hw/intc/slavio_intctl.c +2 -2
index 7675556868..4a72ef5d0d 100644

Lines of this file are not shown. View the raw message.

hw/intc/xilinx_intc.c +2 -1
index ed1c2bcfb8..4c4397b3d2 100644

Lines of this file are not shown. View the raw message.

hw/ipack/tpci200.c +2 -2
index 81d3521d8f..b35e1d2ac4 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/ipmi_bmc_extern.c +2 -2
index 018667e0ca..159831cbc5 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/isa_ipmi_bt.c +2 -2
index 90b3ba1232..0b69acc2e9 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/isa_ipmi_kcs.c +2 -2
index ac7caa26ec..af69e9a008 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/pci_ipmi_bt.c +2 -2
index cfc7275042..7e5ecea6cc 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/pci_ipmi_kcs.c +2 -2
index e4a1603d4e..c2a283a982 100644

Lines of this file are not shown. View the raw message.

hw/ipmi/smbus_ipmi.c +2 -1
index baa8389331..cd4c05dd1b 100644

Lines of this file are not shown. View the raw message.

hw/isa/i82378.c +2 -2
index 4060d22c07..1dcf525f3f 100644

Lines of this file are not shown. View the raw message.

hw/isa/piix4.c +2 -2
index fdbc20e30a..8e3ac845b8 100644

Lines of this file are not shown. View the raw message.

hw/isa/vt82c686.c +8 -8
index 24047538d0..1e6b48b2a2 100644

Lines of this file are not shown. View the raw message.

hw/m68k/mcf_intc.c +2 -1
index e628567cf3..7ee447240b 100644

Lines of this file are not shown. View the raw message.

hw/m68k/next-cube.c +2 -1
index 25168c449f..cbd913b0a2 100644

Lines of this file are not shown. View the raw message.

hw/m68k/next-kbd.c +2 -1
index a6316314ea..c7ca3fbbc9 100644

Lines of this file are not shown. View the raw message.

hw/microblaze/xlnx-zynqmp-pmu.c +2 -2
index f679aeee0d..ab9924bf20 100644

Lines of this file are not shown. View the raw message.

hw/mips/boston.c +2 -1
index e2c35b4fd8..1b3f69e949 100644

Lines of this file are not shown. View the raw message.

hw/mips/gt64xxx_pci.c +2 -2
index bd7ec182fb..b613e1e011 100644

Lines of this file are not shown. View the raw message.

hw/mips/malta.c +2 -1
index 86ae544104..5b73ea4692 100644

Lines of this file are not shown. View the raw message.

hw/misc/applesmc.c +2 -1
index e3c7b1765c..dca3fba028 100644

Lines of this file are not shown. View the raw message.

hw/misc/arm_integrator_debug.c +2 -2
index 4ad2b6a98b..822deffc0c 100644

Lines of this file are not shown. View the raw message.

hw/misc/arm_l2x0.c +2 -1
index f75d7988cc..93948c3bd8 100644

Lines of this file are not shown. View the raw message.

hw/misc/arm_sysctl.c +2 -2
index a3faa516d6..f0f49e76e8 100644

Lines of this file are not shown. View the raw message.

hw/misc/debugexit.c +2 -2
index 6c1f9adc38..c6b0cffd77 100644

Lines of this file are not shown. View the raw message.

hw/misc/eccmemctl.c +2 -1
index 47bec04c8e..468c2a491d 100644

Lines of this file are not shown. View the raw message.

hw/misc/edu.c +2 -1
index 2db9d63eeb..0ff9d1ac78 100644

Lines of this file are not shown. View the raw message.

hw/misc/empty_slot.c +2 -1
index ec3e510b3e..57dcdfbe14 100644

Lines of this file are not shown. View the raw message.

hw/misc/exynos4210_clk.c +2 -2
index c54f360aa8..4b469f6419 100644

Lines of this file are not shown. View the raw message.

hw/misc/exynos4210_pmu.c +2 -2
index e6bbb1f7c8..b19b82a88c 100644

Lines of this file are not shown. View the raw message.

hw/misc/exynos4210_rng.c +2 -2
index 3e2ec4f543..13ec6e188b 100644

Lines of this file are not shown. View the raw message.

hw/misc/ivshmem.c +8 -8
index 1f65f6f2ac..e321e5cb69 100644

Lines of this file are not shown. View the raw message.

hw/misc/milkymist-hpdmc.c +2 -2
index cf3ed5a49c..f25715e09e 100644

Lines of this file are not shown. View the raw message.

hw/misc/milkymist-pfpu.c +2 -2
index 81251792c1..489bb8873f 100644

Lines of this file are not shown. View the raw message.

hw/misc/mst_fpga.c +2 -2
index 314dd5fcbd..f74d8cdd4a 100644

Lines of this file are not shown. View the raw message.

hw/misc/pc-testdev.c +2 -2
index b7f3fcb254..577a15bf58 100644

Lines of this file are not shown. View the raw message.

hw/misc/pca9552.c +2 -4
index 9cd51b1afd..b7686e27d7 100644

Lines of this file are not shown. View the raw message.

hw/misc/pci-testdev.c +2 -2
index db6d0d5a71..86d4816769 100644

Lines of this file are not shown. View the raw message.

hw/misc/puv3_pm.c +2 -1
index e549c0ff21..cac8497f81 100644

Lines of this file are not shown. View the raw message.

hw/misc/pvpanic.c +2 -2
index 894c67e6cc..598d5471a4 100644

Lines of this file are not shown. View the raw message.

hw/misc/sga.c +2 -1
index e5cc2da3d3..477f587ef3 100644

Lines of this file are not shown. View the raw message.

hw/misc/slavio_misc.c +4 -2
index f1a039b5a9..ab27ad462e 100644

Lines of this file are not shown. View the raw message.

hw/misc/tmp421.c +2 -5
index a289c83360..212d6e0e83 100644

Lines of this file are not shown. View the raw message.

hw/misc/zynq_slcr.c +2 -1
index 223f533ce8..bedf09a6f5 100644

Lines of this file are not shown. View the raw message.

hw/net/can/can_kvaser_pci.c +2 -2
index a84d98817c..168b3a620d 100644

Lines of this file are not shown. View the raw message.

hw/net/can/can_mioe3680_pci.c +2 -2
index 8ded64c9b8..7a79e2605a 100644

Lines of this file are not shown. View the raw message.

hw/net/can/can_pcm3680_pci.c +2 -2
index f39228da89..8ef4e74af0 100644

Lines of this file are not shown. View the raw message.

hw/net/dp8393x.c +2 -1
index b065d428ee..56b96e9b0f 100644

Lines of this file are not shown. View the raw message.

hw/net/e1000.c +2 -6
index f8925a10e6..83347cbd87 100644

Lines of this file are not shown. View the raw message.

hw/net/e1000e.c +2 -1
index d631765f2a..938d44f198 100644

Lines of this file are not shown. View the raw message.

hw/net/etraxfs_eth.c +2 -2
index 2bd37f6d0f..36d898ad16 100644

Lines of this file are not shown. View the raw message.

hw/net/lan9118.c +2 -1
index 5d7f966aea..57a59accd0 100644

Lines of this file are not shown. View the raw message.

hw/net/milkymist-minimac2.c +2 -2
index 0ed01fec90..41a8543edf 100644

Lines of this file are not shown. View the raw message.

hw/net/mipsnet.c +2 -1
index 094951abb3..61dbd575da 100644

Lines of this file are not shown. View the raw message.

hw/net/ne2000-isa.c +2 -1
index 716f3b6618..688a0cc4f6 100644

Lines of this file are not shown. View the raw message.

hw/net/opencores_eth.c +2 -1
index 6e3257d2f7..5cd204c30c 100644

Lines of this file are not shown. View the raw message.

hw/net/pcnet-pci.c +2 -2
index 27f6566d5f..449970bc52 100644

Lines of this file are not shown. View the raw message.

hw/net/rtl8139.c +2 -2
index 69d7f36e98..9246388f58 100644

Lines of this file are not shown. View the raw message.

hw/net/smc91c111.c +2 -1
index 12da4b1f73..9fad904321 100644

Lines of this file are not shown. View the raw message.

hw/net/spapr_llan.c +2 -2
index 94b61a646c..d34cb29607 100644

Lines of this file are not shown. View the raw message.

hw/net/stellaris_enet.c +2 -2
index 786dc9a6c6..9f13afa4e4 100644

Lines of this file are not shown. View the raw message.

hw/net/sungem.c +2 -1
index 103a4e19d9..91753830a7 100644

Lines of this file are not shown. View the raw message.

hw/net/sunhme.c +2 -1
index 43fb8da97c..7364ba1019 100644

Lines of this file are not shown. View the raw message.

hw/net/vmxnet3.c +2 -4
index ca3dddad92..eff299f629 100644

Lines of this file are not shown. View the raw message.

hw/net/xgmac.c +2 -1
index 10eebebe52..a066550023 100644

Lines of this file are not shown. View the raw message.

hw/net/xilinx_axienet.c +6 -8
index 18f28a386e..10a33cb4a5 100644

Lines of this file are not shown. View the raw message.

hw/net/xilinx_ethlite.c +2 -2
index adf477960e..6e09f7e422 100644

Lines of this file are not shown. View the raw message.

hw/nvram/ds1225y.c +2 -1
index 99e27e9174..44fb7a94d3 100644

Lines of this file are not shown. View the raw message.

hw/nvram/eeprom_at24c.c +2 -1
index 4bf7519bc7..3e93dbbffb 100644

Lines of this file are not shown. View the raw message.

hw/nvram/spapr_nvram.c +2 -2
index b9218e0b89..57ccc174f2 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/dec.c +2 -1
index b35866d8d1..e88998d88c 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/gen_pcie_root_port.c +2 -2
index b62e20a648..67c71d566b 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/pci_bridge_dev.c +2 -2
index bd1b10c848..b86d76caf3 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/pci_expander_bridge.c +8 -4
index 4a31ee3748..aedded1064 100644

Lines of this file are not shown. View the raw message.

hw/pci-bridge/pcie_pci_bridge.c +2 -2
index 1178cd8620..abc98f8cd9 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/bonito.c +4 -4
index 3b37f4f542..d10fbd39d3 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/grackle.c +2 -2
index 48a16269ad..fd7d6dcc06 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/i440fx.c +2 -2
index ead7b7ef1c..93c62235ca 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/pnv_phb3.c +2 -2
index 180a91a846..a7f9685005 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/pnv_phb4.c +2 -2
index ec85de5c74..03daf40a23 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/ppce500.c +4 -4
index b29e2be9ae..f376374e24 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/prep.c +4 -4
index af0c2eb941..b234fd7c8a 100644

Lines of this file are not shown. View the raw message.

hw/pci-host/versatile.c +4 -4
index e0d00baf94..3553277f94 100644

Lines of this file are not shown. View the raw message.

hw/ppc/mpc8544_guts.c +2 -1
index f74bcdca16..b76b5e4701 100644

Lines of this file are not shown. View the raw message.

hw/ppc/ppc440_pcix.c +2 -2
index f82d520d25..a564fcd600 100644

Lines of this file are not shown. View the raw message.

hw/ppc/ppc440_uc.c +2 -2
index 73cb93a3a5..d9ca6bba9b 100644

Lines of this file are not shown. View the raw message.

hw/ppc/ppc4xx_pci.c +2 -2
index 6ee7eeed98..c24bac96c3 100644

Lines of this file are not shown. View the raw message.

hw/ppc/ppce500_spin.c +2 -1
index b1b6d559c4..cd8000ad73 100644

Lines of this file are not shown. View the raw message.

hw/ppc/prep_systemio.c +2 -2
index d13044acce..d1e2fb3f8b 100644

Lines of this file are not shown. View the raw message.

hw/ppc/rs6000_mc.c +2 -2
index ec25a701dc..56e96010b8 100644

Lines of this file are not shown. View the raw message.

hw/ppc/spapr_rng.c +2 -2
index b400438394..6c99633faa 100644

Lines of this file are not shown. View the raw message.

hw/rtc/ds1338.c +2 -1
index 8b2b7973d8..10fac3d9c9 100644

Lines of this file are not shown. View the raw message.

hw/rtc/exynos4210_rtc.c +2 -2
index a95f07ef0b..f8a4fe8a47 100644

Lines of this file are not shown. View the raw message.

hw/rtc/m41t80.c +2 -1
index 31445e9691..0b7048c3f4 100644

Lines of this file are not shown. View the raw message.

hw/rtc/m48t59-isa.c +2 -6
index dc608e0b02..cae315e488 100644

Lines of this file are not shown. View the raw message.

hw/rtc/m48t59.c +2 -6
index 9f5a96af82..6525206976 100644

Lines of this file are not shown. View the raw message.

hw/rtc/sun4v-rtc.c +2 -1
index b5ebefd1b2..18979d25d0 100644

Lines of this file are not shown. View the raw message.

hw/rtc/twl92230.c +2 -1
index d46f21430c..4f83eff5c3 100644

Lines of this file are not shown. View the raw message.

hw/rx/rx-gdbsim.c +2 -6
index ed7f695c2a..417ec0564b 100644

Lines of this file are not shown. View the raw message.

hw/rx/rx62n.c +2 -4
index d2935c5429..6eb4eea700 100644

Lines of this file are not shown. View the raw message.

hw/scsi/esp-pci.c +4 -4
index 544f5f19b3..2ce96dc56e 100644

Lines of this file are not shown. View the raw message.

hw/scsi/lsi53c895a.c +2 -2
index 0e40587c18..e8354a47da 100644

Lines of this file are not shown. View the raw message.

hw/scsi/megasas.c +2 -6
index aab0b36598..e90c00823a 100644

Lines of this file are not shown. View the raw message.

hw/scsi/scsi-disk.c +2 -6
index ea66422c2b..1f0388a755 100644

Lines of this file are not shown. View the raw message.

hw/scsi/spapr_vscsi.c +2 -2
index 3c64f45bdb..c3e6d1ecef 100644

Lines of this file are not shown. View the raw message.

hw/scsi/vmw_pvscsi.c +2 -5
index aa0d57b970..40095bed09 100644

Lines of this file are not shown. View the raw message.

hw/sd/milkymist-memcard.c +2 -2
index 0da5b84398..4d3ec28f5d 100644

Lines of this file are not shown. View the raw message.

hw/sd/pl181.c +2 -1
index cb2ef0fb39..7829e933a5 100644

Lines of this file are not shown. View the raw message.

hw/sd/ssi-sd.c +2 -1
index 517c17a2c4..dd07258d4e 100644

Lines of this file are not shown. View the raw message.

hw/sh4/sh_pci.c +2 -2
index 378d44b946..dc73845125 100644

Lines of this file are not shown. View the raw message.

hw/sparc/sun4m.c +8 -5
index 1bc3edec25..256033b9a0 100644

Lines of this file are not shown. View the raw message.

hw/sparc64/sun4u.c +8 -4
index 7aab59dea9..67985414e2 100644

Lines of this file are not shown. View the raw message.

hw/ssi/ssi.c +2 -1
index 5366a80d45..faf7633e70 100644

Lines of this file are not shown. View the raw message.

hw/ssi/xilinx_spi.c +2 -1
index 8ed83bec8a..34fc8da69a 100644

Lines of this file are not shown. View the raw message.

hw/timer/altera_timer.c +2 -2
index 93bd5b9587..c694c98d08 100644

Lines of this file are not shown. View the raw message.

hw/timer/arm_timer.c +4 -3
index d728a80937..79117f45b0 100644

Lines of this file are not shown. View the raw message.

hw/timer/cadence_ttc.c +2 -2
index 24de679d9c..52e637545a 100644

Lines of this file are not shown. View the raw message.

hw/timer/etraxfs_timer.c +2 -2
index 92b8999b79..48f2e3ade2 100644

Lines of this file are not shown. View the raw message.

hw/timer/exynos4210_mct.c +2 -2
index aa8753ded8..0329cae3d9 100644

Lines of this file are not shown. View the raw message.

hw/timer/exynos4210_pwm.c +2 -2
index 34224020c0..5340fc0425 100644

Lines of this file are not shown. View the raw message.

hw/timer/grlib_gptimer.c +2 -2
index 91d42837c9..e539fc24f0 100644

Lines of this file are not shown. View the raw message.

hw/timer/hpet.c +2 -1
index 07b3c0f9be..44bbe3a536 100644

Lines of this file are not shown. View the raw message.

hw/timer/i8254.c +2 -2
index 54639d13d8..c01ee2c72a 100644

Lines of this file are not shown. View the raw message.

hw/timer/lm32_timer.c +2 -1
index 807ceb514c..93ecb51a97 100644

Lines of this file are not shown. View the raw message.

hw/timer/milkymist-sysctl.c +2 -2
index 3667a09c99..29500e0457 100644

Lines of this file are not shown. View the raw message.

hw/timer/puv3_ost.c +2 -1
index 8d61c670de..3a35ac2b0a 100644

Lines of this file are not shown. View the raw message.

hw/timer/pxa2xx_timer.c +2 -2
index c73cc721e1..8c3a1f5489 100644

Lines of this file are not shown. View the raw message.

hw/timer/slavio_timer.c +2 -2
index 28d612372b..08d6888015 100644

Lines of this file are not shown. View the raw message.

hw/timer/xilinx_timer.c +2 -2
index c262f6d96f..1eb927eb84 100644

Lines of this file are not shown. View the raw message.

hw/tpm/tpm_crb.c +2 -1
index 53e89b43e5..aa9c00aad3 100644

Lines of this file are not shown. View the raw message.

hw/tpm/tpm_spapr.c +2 -2
index 08db85baea..e3775adc57 100644

Lines of this file are not shown. View the raw message.

hw/tpm/tpm_tis_isa.c +2 -1
index 9a0ab24a27..fafdcffa9c 100644

Lines of this file are not shown. View the raw message.

hw/tpm/tpm_tis_sysbus.c +2 -1
index 46a92182fc..20b28eeb28 100644

Lines of this file are not shown. View the raw message.

hw/usb/ccid-card-emulated.c +2 -2
index a84f5783dc..5e4649d367 100644

Lines of this file are not shown. View the raw message.

hw/usb/ccid-card-passthru.c +2 -2
index 9c9d6857da..e8e9d37e88 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-audio.c +2 -1
index 3fc8addae1..65247ca799 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-hid.c +2 -1
index 4d1de647bc..05cfe6baca 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-hub.c +2 -1
index 07e395aa5f..7a182f9bec 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-mtp.c +2 -1
index 6df70a0844..c61c0e0878 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-network.c +2 -1
index b60f8e52f5..cd32f57685 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-serial.c +2 -1
index 8f13f2fd31..1a58851d4b 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-smartcard-reader.c +4 -2
index a9898187b8..432508c478 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-storage.c +2 -1
index 55a04293a4..648340323f 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-uas.c +2 -1
index 1d27bb942b..c36c8e7820 100644

Lines of this file are not shown. View the raw message.

hw/usb/dev-wacom.c +2 -1
index e2dae6a86d..85c4d827bf 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-ohci-pci.c +2 -1
index 82fe967196..f8168a06a3 100644

Lines of this file are not shown. View the raw message.

hw/usb/hcd-uhci.c +2 -1
index 31ec5f4702..27ca237d71 100644

Lines of this file are not shown. View the raw message.

hw/usb/host-libusb.c +2 -2
index 30779c8ff4..2ba1de68df 100644

Lines of this file are not shown. View the raw message.

hw/usb/redirect.c +2 -1
index 344fdc3d66..a079ecd50c 100644

Lines of this file are not shown. View the raw message.

hw/usb/tusb6010.c +2 -1
index a15ee515d7..2bee3ae59f 100644

Lines of this file are not shown. View the raw message.

hw/vfio/ap.c +2 -2
index eb74e57b23..f399ec0a31 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-scsi-pci.c +2 -2
index b30a04d7cd..cb71a294fa 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-user-blk-pci.c +2 -2
index 51d0858281..33b404d8a2 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-user-fs-pci.c +2 -2
index 6b01561c2f..8bb389bd28 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-user-input-pci.c +2 -2
index b072fb576a..c9d3e9113a 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-user-scsi-pci.c +2 -2
index 773104e351..d5343412a1 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-user-vsock-pci.c +2 -2
index 65bfc91d2d..763f89984e 100644

Lines of this file are not shown. View the raw message.

hw/virtio/vhost-vsock-pci.c +2 -2
index 49fcddcb5a..e56067b427 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-9p-pci.c +2 -2
index 8ea357b868..e07adcd9ea 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-balloon-pci.c +2 -2
index 35378c7309..a2c5cc7207 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-blk-pci.c +2 -2
index a2aa614ef4..9d5795810c 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-crypto-pci.c +2 -2
index 518a87a36e..0783dc2f7e 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-input-host-pci.c +2 -2
index 4d8479c92e..0ac360de4f 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-input-pci.c +4 -4
index 429dd4d7ab..85acd3d2eb 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-iommu-pci.c +2 -2
index 17451f5a78..76540e57b1 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-net-pci.c +2 -2
index 498fc02d8f..292d13d278 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-rng-pci.c +2 -2
index 8f953dff83..c1f916268b 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-scsi-pci.c +2 -2
index 7a7ffa43f8..97fab74236 100644

Lines of this file are not shown. View the raw message.

hw/virtio/virtio-serial-pci.c +2 -2
index 1bd769e88d..35bcd961c9 100644

Lines of this file are not shown. View the raw message.

hw/watchdog/wdt_i6300esb.c +2 -2
index eaa2b39ab8..4f64899a56 100644

Lines of this file are not shown. View the raw message.

hw/watchdog/wdt_ib700.c +2 -1
index 1a7a8f695f..177aaa503f 100644

Lines of this file are not shown. View the raw message.

iothread.c +2 -4
index 263ec6e5bc..3a3860a09c 100644

Lines of this file are not shown. View the raw message.

migration/rdma.c +2 -2
index 0a90f0d420..1dc563ec3f 100644

Lines of this file are not shown. View the raw message.

net/can/can_socketcan.c +2 -2
index 0082aa6c3e..f933bd2db2 100644

Lines of this file are not shown. View the raw message.

net/colo-compare.c +2 -2
index be3ca5f8c5..bc3808fb4d 100644

Lines of this file are not shown. View the raw message.

net/dump.c +2 -2
index 454672d73d..42e64a6f29 100644

Lines of this file are not shown. View the raw message.

net/filter-buffer.c +2 -2
index 78f7f0b36b..6ade7a19b8 100644

Lines of this file are not shown. View the raw message.

net/filter-mirror.c +4 -4
index 3fd3b90d1d..088d4dcace 100644

Lines of this file are not shown. View the raw message.

net/filter-replay.c +2 -2
index a0b99aaf86..78696c162e 100644

Lines of this file are not shown. View the raw message.

net/filter-rewriter.c +2 -2
index c28d959942..113e293207 100644

Lines of this file are not shown. View the raw message.

scsi/pr-manager-helper.c +2 -3
index 59ba4b70ae..d735b1e7f6 100644

Lines of this file are not shown. View the raw message.

target/i386/sev.c +2 -2
index d452e73c18..d976634b8f 100644

Lines of this file are not shown. View the raw message.

tests/check-qom-interface.c +2 -4
index bfa9ad5d19..c99be97ed8 100644

Lines of this file are not shown. View the raw message.

tests/check-qom-proplist.c +8 -8
index e1e0a96661..1571606c1c 100644

Lines of this file are not shown. View the raw message.

tests/test-qdev-global-props.c +4 -4
index c3e210a9ef..8a3c14d92c 100644

Lines of this file are not shown. View the raw message.

ui/console.c +2 -1
index 37972cb5e0..f8d7643fe4 100644

Lines of this file are not shown. View the raw message.

ui/gtk.c +2 -1
index 84ac289e57..1c59de2af4 100644

Lines of this file are not shown. View the raw message.

ui/input-barrier.c +2 -6
index 477f6cd70e..67d52afbea 100644

Lines of this file are not shown. View the raw message.

ui/input-linux.c +2 -6
index 1b35c044e6..bfdbd38c86 100644

Lines of this file are not shown. View the raw message.

ui/spice-app.c +2 -1
index d68a35c3b1..93e105c6ee 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.26.2

Part of the diff is not shown here. View the raw message.

#31 lore raw

[PULL 19/34] vmgenid: Rename VMGENID_DEVICE to TYPE_VMGENID

In reply to Eduardo Habkost

This will make the type name constant consistent with the name of the type checking macro.

Message-Id: <[email protected]>

---
 include/hw/acpi/vmgenid.h | 6 +++---
 hw/acpi/vmgenid.c         | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
include/hw/acpi/vmgenid.h +3 -3
index 86cd1da605..aff574df5f 100644
@@ -6,7 +6,7 @@
 #include "qemu/uuid.h"
 #include "qom/object.h"
 
-#define VMGENID_DEVICE           "vmgenid"
+#define TYPE_VMGENID           "vmgenid"
 #define VMGENID_GUID             "guid"
 #define VMGENID_GUID_FW_CFG_FILE      "etc/vmgenid_guid"
 #define VMGENID_ADDR_FW_CFG_FILE      "etc/vmgenid_addr"
@@ -18,7 +18,7 @@
 
 typedef struct VmGenIdState VmGenIdState;
 DECLARE_INSTANCE_CHECKER(VmGenIdState, VMGENID,
-                         VMGENID_DEVICE)
+                         TYPE_VMGENID)
 
 struct VmGenIdState {
     DeviceClass parent_obj;
@@ -29,7 +29,7 @@ struct VmGenIdState {
 /* returns NULL unless there is exactly one device */
 static inline Object *find_vmgenid_dev(void)
 {
-    return object_resolve_path_type("", VMGENID_DEVICE, NULL);
+    return object_resolve_path_type("", TYPE_VMGENID, NULL);
 }
 
 void vmgenid_build_acpi(VmGenIdState *vms, GArray *table_data, GArray *guid,
hw/acpi/vmgenid.c +3 -3
index 2df7623d74..53db6af75d 100644
@@ -198,7 +198,7 @@ static void vmgenid_realize(DeviceState *dev, Error **errp)
 
     if (!bios_linker_loader_can_write_pointer()) {
         error_setg(errp, "%s requires DMA write support in fw_cfg, "
-                   "which this machine type does not provide", VMGENID_DEVICE);
+                   "which this machine type does not provide", TYPE_VMGENID);
         return;
     }
 
@@ -206,7 +206,7 @@ static void vmgenid_realize(DeviceState *dev, Error **errp)
      * device. Check if there are several.
      */
     if (!find_vmgenid_dev()) {
-        error_setg(errp, "at most one %s device is permitted", VMGENID_DEVICE);
+        error_setg(errp, "at most one %s device is permitted", TYPE_VMGENID);
         return;
     }
 
@@ -232,7 +232,7 @@ static void vmgenid_device_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo vmgenid_device_info = {
-    .name          = VMGENID_DEVICE,
+    .name          = TYPE_VMGENID,
     .parent        = TYPE_DEVICE,
     .instance_size = sizeof(VmGenIdState),
     .class_init    = vmgenid_device_class_init,
Signature · 1 line
2.26.2
#32 lore raw

[PULL 31/34] lpc_ich9: Use typedef name for instance_size

In reply to Eduardo Habkost

This makes the code consistent with the rest of QOM code in QEMU, and will make automated conversion to type declaration macros simpler.

Message-Id: <[email protected]>

---
 hw/isa/lpc_ich9.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/isa/lpc_ich9.c +1 -1
index cd6e169d47..3303d2eab6 100644
@@ -792,7 +792,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data)
 static const TypeInfo ich9_lpc_info = {
     .name       = TYPE_ICH9_LPC_DEVICE,
     .parent     = TYPE_PCI_DEVICE,
-    .instance_size = sizeof(struct ICH9LPCState),
+    .instance_size = sizeof(ICH9LPCState),
     .instance_init = ich9_lpc_initfn,
     .class_init  = ich9_lpc_class_init,
     .interfaces = (InterfaceInfo[]) {
Signature · 1 line
2.26.2
#33 lore raw

[PULL 33/34] vhost-user-vga: Use typedef name for instance_size

In reply to Eduardo Habkost

This makes the code consistent with the rest of QOM code in QEMU, and will make automated conversion to type declaration macros simpler.

Message-Id: <[email protected]>

---
 hw/display/vhost-user-vga.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/vhost-user-vga.c +1 -1
index 7110ea6231..a34a99856d 100644
@@ -41,7 +41,7 @@ static void vhost_user_vga_inst_initfn(Object *obj)
 static const VirtioPCIDeviceTypeInfo vhost_user_vga_info = {
     .generic_name  = TYPE_VHOST_USER_VGA,
     .parent        = TYPE_VIRTIO_VGA_BASE,
-    .instance_size = sizeof(struct VhostUserVGA),
+    .instance_size = sizeof(VhostUserVGA),
     .instance_init = vhost_user_vga_inst_initfn,
 };
 
Signature · 1 line
2.26.2