Use OBJECT_DECLARE_TYPE when possible
authorEduardo Habkost <ehabkost@redhat.com>
Wed, 16 Sep 2020 18:25:18 +0000 (14:25 -0400)
committerEduardo Habkost <ehabkost@redhat.com>
Fri, 18 Sep 2020 18:12:32 +0000 (14:12 -0400)
This converts existing DECLARE_OBJ_CHECKERS usage to
OBJECT_DECLARE_TYPE when possible.

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

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Paul Durrant <paul@xen.org>
Message-Id: <20200916182519.415636-5-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
69 files changed:
hw/arm/mps2-tz.c
hw/arm/mps2.c
hw/arm/musca.c
hw/arm/spitz.c
hw/arm/vexpress.c
hw/block/m25p80.c
hw/input/adb-kbd.c
hw/input/adb-mouse.c
hw/misc/tmp421.c
hw/ppc/e500.h
hw/s390x/ccw-device.h
hw/s390x/virtio-ccw.h
hw/scsi/scsi-disk.c
hw/scsi/vmw_pvscsi.c
hw/usb/ccid.h
hw/usb/hcd-dwc2.h
hw/usb/hcd-ehci.h
hw/virtio/virtio-pci.h
include/chardev/char.h
include/hw/arm/aspeed_soc.h
include/hw/arm/bcm2836.h
include/hw/arm/smmu-common.h
include/hw/arm/smmuv3.h
include/hw/arm/virt.h
include/hw/boards.h
include/hw/display/macfb.h
include/hw/gpio/aspeed_gpio.h
include/hw/i2c/aspeed_i2c.h
include/hw/i386/ioapic_internal.h
include/hw/i386/microvm.h
include/hw/i386/pc.h
include/hw/i386/x86-iommu.h
include/hw/i386/x86.h
include/hw/ide/internal.h
include/hw/input/adb.h
include/hw/isa/i8259_internal.h
include/hw/isa/isa.h
include/hw/mem/nvdimm.h
include/hw/misc/aspeed_scu.h
include/hw/misc/aspeed_sdmc.h
include/hw/misc/imx_ccm.h
include/hw/misc/mos6522.h
include/hw/pci-host/pnv_phb4.h
include/hw/pci/pci.h
include/hw/pci/pci_host.h
include/hw/pcmcia.h
include/hw/ppc/spapr.h
include/hw/qdev-core.h
include/hw/rtc/allwinner-rtc.h
include/hw/s390x/3270-ccw.h
include/hw/s390x/s390-virtio-ccw.h
include/hw/s390x/storage-attributes.h
include/hw/s390x/storage-keys.h
include/hw/s390x/tod.h
include/hw/scsi/scsi.h
include/hw/sd/allwinner-sdhost.h
include/hw/sd/sd.h
include/hw/ssi/aspeed_smc.h
include/hw/ssi/xilinx_spips.h
include/hw/timer/aspeed_timer.h
include/hw/timer/i8254.h
include/hw/usb.h
include/hw/virtio/virtio.h
include/hw/watchdog/wdt_aspeed.h
include/hw/xen/xen-block.h
include/hw/xen/xen-bus.h
include/net/can_host.h
include/net/filter.h
include/ui/console.h

index dbf7d63dc83f71446151c156fcd2cadc76be7c1a..3707876d6d487680754d5a360e62f8d403f0d1b4 100644 (file)
@@ -77,7 +77,6 @@ struct MPS2TZMachineClass {
     uint32_t scc_id;
     const char *armsse_type;
 };
-typedef struct MPS2TZMachineClass MPS2TZMachineClass;
 
 struct MPS2TZMachineState {
     MachineState parent;
@@ -102,14 +101,12 @@ struct MPS2TZMachineState {
     DeviceState *lan9118;
     SplitIRQ cpu_irq_splitter[MPS2TZ_NUMIRQ];
 };
-typedef struct MPS2TZMachineState MPS2TZMachineState;
 
 #define TYPE_MPS2TZ_MACHINE "mps2tz"
 #define TYPE_MPS2TZ_AN505_MACHINE MACHINE_TYPE_NAME("mps2-an505")
 #define TYPE_MPS2TZ_AN521_MACHINE MACHINE_TYPE_NAME("mps2-an521")
 
-DECLARE_OBJ_CHECKERS(MPS2TZMachineState, MPS2TZMachineClass,
-                     MPS2TZ_MACHINE, TYPE_MPS2TZ_MACHINE)
+OBJECT_DECLARE_TYPE(MPS2TZMachineState, MPS2TZMachineClass, MPS2TZ_MACHINE)
 
 /* Main SYSCLK frequency in Hz */
 #define SYSCLK_FRQ 20000000
index 5d471608503cb012a6c3551623f6ded805d432e6..9a8b23c64ce70f7eac5ca1b4ae8ca778aa09a9ba 100644 (file)
@@ -63,7 +63,6 @@ struct MPS2MachineClass {
     hwaddr ethernet_base;
     hwaddr psram_base;
 };
-typedef struct MPS2MachineClass MPS2MachineClass;
 
 struct MPS2MachineState {
     MachineState parent;
@@ -85,7 +84,6 @@ struct MPS2MachineState {
     CMSDKAPBDualTimer dualtimer;
     CMSDKAPBWatchdog watchdog;
 };
-typedef struct MPS2MachineState MPS2MachineState;
 
 #define TYPE_MPS2_MACHINE "mps2"
 #define TYPE_MPS2_AN385_MACHINE MACHINE_TYPE_NAME("mps2-an385")
@@ -93,8 +91,7 @@ typedef struct MPS2MachineState MPS2MachineState;
 #define TYPE_MPS2_AN500_MACHINE MACHINE_TYPE_NAME("mps2-an500")
 #define TYPE_MPS2_AN511_MACHINE MACHINE_TYPE_NAME("mps2-an511")
 
-DECLARE_OBJ_CHECKERS(MPS2MachineState, MPS2MachineClass,
-                     MPS2_MACHINE, TYPE_MPS2_MACHINE)
+OBJECT_DECLARE_TYPE(MPS2MachineState, MPS2MachineClass, MPS2_MACHINE)
 
 /* Main SYSCLK frequency in Hz */
 #define SYSCLK_FRQ 25000000
index 16015255c8990fbd8f3dcad409175df42d4fee1a..b50157f63a684c65be319b3f864cb57c15abdfae 100644 (file)
@@ -55,7 +55,6 @@ struct MuscaMachineClass {
     const MPCInfo *mpc_info;
     int num_mpcs;
 };
-typedef struct MuscaMachineClass MuscaMachineClass;
 
 struct MuscaMachineState {
     MachineState parent;
@@ -84,14 +83,12 @@ struct MuscaMachineState {
     UnimplementedDeviceState gpio;
     UnimplementedDeviceState cryptoisland;
 };
-typedef struct MuscaMachineState MuscaMachineState;
 
 #define TYPE_MUSCA_MACHINE "musca"
 #define TYPE_MUSCA_A_MACHINE MACHINE_TYPE_NAME("musca-a")
 #define TYPE_MUSCA_B1_MACHINE MACHINE_TYPE_NAME("musca-b1")
 
-DECLARE_OBJ_CHECKERS(MuscaMachineState, MuscaMachineClass,
-                     MUSCA_MACHINE, TYPE_MUSCA_MACHINE)
+OBJECT_DECLARE_TYPE(MuscaMachineState, MuscaMachineClass, MUSCA_MACHINE)
 
 /*
  * Main SYSCLK frequency in Hz
index a7ad667f06b52c80e495f2c366e73ef72bea714e..b5b867e6ed2598f3e3d8042f6f591417ef406292 100644 (file)
@@ -43,7 +43,6 @@ struct SpitzMachineClass {
     enum spitz_model_e model;
     int arm_id;
 };
-typedef struct SpitzMachineClass SpitzMachineClass;
 
 struct SpitzMachineState {
     MachineState parent;
@@ -56,11 +55,9 @@ struct SpitzMachineState {
     DeviceState *scp1;
     DeviceState *misc_gpio;
 };
-typedef struct SpitzMachineState SpitzMachineState;
 
 #define TYPE_SPITZ_MACHINE "spitz-common"
-DECLARE_OBJ_CHECKERS(SpitzMachineState, SpitzMachineClass,
-                     SPITZ_MACHINE, TYPE_SPITZ_MACHINE)
+OBJECT_DECLARE_TYPE(SpitzMachineState, SpitzMachineClass, SPITZ_MACHINE)
 
 #define zaurus_printf(format, ...)                              \
     fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__)
index 01bb4bba1ec05362c1cf717cdf7a1df92b594044..94ff094ab3ebe090840a8cffc44b0992a7e2c278 100644 (file)
@@ -171,20 +171,17 @@ struct VexpressMachineClass {
     MachineClass parent;
     VEDBoardInfo *daughterboard;
 };
-typedef struct VexpressMachineClass VexpressMachineClass;
 
 struct VexpressMachineState {
     MachineState parent;
     bool secure;
     bool virt;
 };
-typedef struct VexpressMachineState VexpressMachineState;
 
 #define TYPE_VEXPRESS_MACHINE   "vexpress"
 #define TYPE_VEXPRESS_A9_MACHINE   MACHINE_TYPE_NAME("vexpress-a9")
 #define TYPE_VEXPRESS_A15_MACHINE   MACHINE_TYPE_NAME("vexpress-a15")
-DECLARE_OBJ_CHECKERS(VexpressMachineState, VexpressMachineClass,
-                     VEXPRESS_MACHINE, TYPE_VEXPRESS_MACHINE)
+OBJECT_DECLARE_TYPE(VexpressMachineState, VexpressMachineClass, VEXPRESS_MACHINE)
 
 typedef void DBoardInitFn(const VexpressMachineState *machine,
                           ram_addr_t ram_size,
index 8dae779c76dec1df4b25e78af0d50887deb5300d..483925f57a9023f349bd70e8db9af24a9b54d3ac 100644 (file)
@@ -456,17 +456,14 @@ struct Flash {
     const FlashPartInfo *pi;
 
 };
-typedef struct Flash Flash;
 
 struct M25P80Class {
     SSISlaveClass parent_class;
     FlashPartInfo *pi;
 };
-typedef struct M25P80Class M25P80Class;
 
 #define TYPE_M25P80 "m25p80-generic"
-DECLARE_OBJ_CHECKERS(Flash, M25P80Class,
-                     M25P80, TYPE_M25P80)
+OBJECT_DECLARE_TYPE(Flash, M25P80Class, M25P80)
 
 static inline Manufacturer get_man(Flash *s)
 {
index fe0c363d6496a255017a684dd4322253c3adb3fc..a9088c910cc7a88257d8a70f7159944f99edfc4c 100644 (file)
 #include "trace.h"
 #include "qom/object.h"
 
-typedef struct ADBKeyboardClass ADBKeyboardClass;
-typedef struct KBDState KBDState;
-DECLARE_OBJ_CHECKERS(KBDState, ADBKeyboardClass,
-                     ADB_KEYBOARD, TYPE_ADB_KEYBOARD)
+OBJECT_DECLARE_TYPE(KBDState, ADBKeyboardClass, ADB_KEYBOARD)
 
 struct KBDState {
     /*< private >*/
index f5750909b45d6976a8c62c6039827b6e6258dac6..e6b341f0280809caab87dc6d61316dd979df442a 100644 (file)
 #include "trace.h"
 #include "qom/object.h"
 
-typedef struct ADBMouseClass ADBMouseClass;
-typedef struct MouseState MouseState;
-DECLARE_OBJ_CHECKERS(MouseState, ADBMouseClass,
-                     ADB_MOUSE, TYPE_ADB_MOUSE)
+OBJECT_DECLARE_TYPE(MouseState, ADBMouseClass, ADB_MOUSE)
 
 struct MouseState {
     /*< public >*/
index 212d6e0e831c130888ce2f83d0b84865300ccea0..ef3c682e328f1c09b68a9570a8516188a50e1cde 100644 (file)
@@ -65,17 +65,14 @@ struct TMP421State {
     uint8_t pointer;
 
 };
-typedef struct TMP421State TMP421State;
 
 struct TMP421Class {
     I2CSlaveClass parent_class;
     DeviceInfo *dev;
 };
-typedef struct TMP421Class TMP421Class;
 
 #define TYPE_TMP421 "tmp421-generic"
-DECLARE_OBJ_CHECKERS(TMP421State, TMP421Class,
-                     TMP421, TYPE_TMP421)
+OBJECT_DECLARE_TYPE(TMP421State, TMP421Class, TMP421)
 
 
 /* the TMP421 registers */
index 63870751ffce19deaa47b04cf5c0109194c85b71..1e5853b032b71aebb628d75b0a98b31758e3204a 100644 (file)
@@ -14,7 +14,6 @@ struct PPCE500MachineState {
      */
     PlatformBusDevice *pbus_dev;
 };
-typedef struct PPCE500MachineState PPCE500MachineState;
 
 struct PPCE500MachineClass {
     /*< private >*/
@@ -39,14 +38,12 @@ struct PPCE500MachineClass {
     hwaddr pci_mmio_bus_base;
     hwaddr spin_base;
 };
-typedef struct PPCE500MachineClass PPCE500MachineClass;
 
 void ppce500_init(MachineState *machine);
 
 hwaddr booke206_page_size_to_tlb(uint64_t size);
 
 #define TYPE_PPCE500_MACHINE      "ppce500-base-machine"
-DECLARE_OBJ_CHECKERS(PPCE500MachineState, PPCE500MachineClass,
-                     PPCE500_MACHINE, TYPE_PPCE500_MACHINE)
+OBJECT_DECLARE_TYPE(PPCE500MachineState, PPCE500MachineClass, PPCE500_MACHINE)
 
 #endif
index cf7d492084ea713c2f5220cc5131eb63f4b839b0..832c78cd4213194794e14df60278d042bfad2d2c 100644 (file)
@@ -38,7 +38,6 @@ struct CCWDeviceClass {
     void (*realize)(CcwDevice *, Error **);
     void (*refill_ids)(CcwDevice *);
 };
-typedef struct CCWDeviceClass CCWDeviceClass;
 
 static inline CcwDevice *to_ccw_dev_fast(DeviceState *d)
 {
@@ -47,7 +46,6 @@ static inline CcwDevice *to_ccw_dev_fast(DeviceState *d)
 
 #define TYPE_CCW_DEVICE "ccw-device"
 
-DECLARE_OBJ_CHECKERS(CcwDevice, CCWDeviceClass,
-                     CCW_DEVICE, TYPE_CCW_DEVICE)
+OBJECT_DECLARE_TYPE(CcwDevice, CCWDeviceClass, CCW_DEVICE)
 
 #endif
index cea259685d9cf01f01c065a9330404051056124a..21790608b462b788d60b009a9b9a5779c4c2c738 100644 (file)
 #define CCW_CMD_SET_VIRTIO_REV 0x83
 
 #define TYPE_VIRTIO_CCW_DEVICE "virtio-ccw-device"
-typedef struct VirtIOCCWDeviceClass VirtIOCCWDeviceClass;
-typedef struct VirtioCcwDevice VirtioCcwDevice;
-DECLARE_OBJ_CHECKERS(VirtioCcwDevice, VirtIOCCWDeviceClass,
-                     VIRTIO_CCW_DEVICE, TYPE_VIRTIO_CCW_DEVICE)
+OBJECT_DECLARE_TYPE(VirtioCcwDevice, VirtIOCCWDeviceClass, VIRTIO_CCW_DEVICE)
 
 typedef struct VirtioBusState VirtioCcwBusState;
 typedef struct VirtioBusClass VirtioCcwBusClass;
index 1f0388a755af9677f76b3b061e0e5d35f6f51910..e859534eaf3469438587e5a47de0b9049e2b0310 100644 (file)
 
 #define TYPE_SCSI_DISK_BASE         "scsi-disk-base"
 
-typedef struct SCSIDiskClass SCSIDiskClass;
-typedef struct SCSIDiskState SCSIDiskState;
-DECLARE_OBJ_CHECKERS(SCSIDiskState, SCSIDiskClass,
-                     SCSI_DISK_BASE, TYPE_SCSI_DISK_BASE)
+OBJECT_DECLARE_TYPE(SCSIDiskState, SCSIDiskClass, SCSI_DISK_BASE)
 
 struct SCSIDiskClass {
     SCSIDeviceClass parent_class;
index 40095bed0908feabcedb617608dec8d56018502c..a63d25de48b887414678e15e7f1ebb76903023c1 100644 (file)
@@ -61,12 +61,9 @@ struct PVSCSIClass {
     PCIDeviceClass parent_class;
     DeviceRealize parent_dc_realize;
 };
-typedef struct PVSCSIClass PVSCSIClass;
 
 #define TYPE_PVSCSI "pvscsi"
-typedef struct PVSCSIState PVSCSIState;
-DECLARE_OBJ_CHECKERS(PVSCSIState, PVSCSIClass,
-                     PVSCSI, TYPE_PVSCSI)
+OBJECT_DECLARE_TYPE(PVSCSIState, PVSCSIClass, PVSCSI)
 
 
 /* Compatibility flags for migration */
index ef2bb3462dbc7b0b01a15ef2f53ad9cc44ab0a2f..6b82a55bd4cca63b6f9ef27cfd13a8fc8cefebc5 100644 (file)
 #include "hw/qdev-core.h"
 #include "qom/object.h"
 
-typedef struct CCIDCardState CCIDCardState;
 typedef struct CCIDCardInfo CCIDCardInfo;
 
 #define TYPE_CCID_CARD "ccid-card"
-typedef struct CCIDCardClass CCIDCardClass;
-DECLARE_OBJ_CHECKERS(CCIDCardState, CCIDCardClass,
-                     CCID_CARD, TYPE_CCID_CARD)
+OBJECT_DECLARE_TYPE(CCIDCardState, CCIDCardClass, CCID_CARD)
 
 /*
  * callbacks to be used by the CCID device (hw/usb-ccid.c) to call
index 919e3e43b1b6096e2938d99ca0485731ef82cd6e..6998b04706dac1e0c70726282bde36d9476d04f7 100644 (file)
@@ -181,7 +181,6 @@ struct DWC2Class {
 };
 
 #define TYPE_DWC2_USB   "dwc2-usb"
-DECLARE_OBJ_CHECKERS(DWC2State, DWC2Class,
-                     DWC2_USB, TYPE_DWC2_USB)
+OBJECT_DECLARE_TYPE(DWC2State, DWC2Class, DWC2_USB)
 
 #endif
index 1301ce0be798dae63583f210ad734f4a0892fadf..199913bca5078f69e1ab11d06920e5a511ec946f 100644 (file)
@@ -350,10 +350,7 @@ struct EHCIPCIState {
 #define TYPE_PPC4xx_EHCI "ppc4xx-ehci-usb"
 #define TYPE_FUSBH200_EHCI "fusbh200-ehci-usb"
 
-typedef struct EHCISysBusState EHCISysBusState;
-typedef struct SysBusEHCIClass SysBusEHCIClass;
-DECLARE_OBJ_CHECKERS(EHCISysBusState, SysBusEHCIClass,
-                     SYS_BUS_EHCI, TYPE_SYS_BUS_EHCI)
+OBJECT_DECLARE_TYPE(EHCISysBusState, SysBusEHCIClass, SYS_BUS_EHCI)
 
 struct EHCISysBusState {
     /*< private >*/
index 47b6bb4e263c8e4f0c03ccdb487f3721da732266..06e2af12de64c32f8c26c7f9e8585d09ce8838f3 100644 (file)
@@ -19,7 +19,6 @@
 #include "hw/virtio/virtio-bus.h"
 #include "qom/object.h"
 
-typedef struct VirtIOPCIProxy VirtIOPCIProxy;
 
 /* virtio-pci-bus */
 
@@ -91,9 +90,7 @@ typedef struct {
  * virtio-pci: This is the PCIDevice which has a virtio-pci-bus.
  */
 #define TYPE_VIRTIO_PCI "virtio-pci"
-typedef struct VirtioPCIClass VirtioPCIClass;
-DECLARE_OBJ_CHECKERS(VirtIOPCIProxy, VirtioPCIClass,
-                     VIRTIO_PCI, TYPE_VIRTIO_PCI)
+OBJECT_DECLARE_TYPE(VirtIOPCIProxy, VirtioPCIClass, VIRTIO_PCI)
 
 struct VirtioPCIClass {
     PCIDeviceClass parent_class;
index 5874de57ea00eedf474fc98f0828e9b28ee9acf7..db42f0a8c6310ac22c7c059f33a4a4470dde4111 100644 (file)
@@ -226,9 +226,7 @@ int qemu_chr_write(Chardev *s, const uint8_t *buf, int len, bool write_all);
 int qemu_chr_wait_connected(Chardev *chr, Error **errp);
 
 #define TYPE_CHARDEV "chardev"
-typedef struct ChardevClass ChardevClass;
-DECLARE_OBJ_CHECKERS(Chardev, ChardevClass,
-                     CHARDEV, TYPE_CHARDEV)
+OBJECT_DECLARE_TYPE(Chardev, ChardevClass, CHARDEV)
 
 #define TYPE_CHARDEV_NULL "chardev-null"
 #define TYPE_CHARDEV_MUX "chardev-mux"
index 05c7d53df330589a887211a80fa0f332c2d9fe08..11cfe6e3585b55b4fcce78b99fcb8e169934de2e 100644 (file)
@@ -62,12 +62,9 @@ struct AspeedSoCState {
     AspeedSDHCIState sdhci;
     AspeedSDHCIState emmc;
 };
-typedef struct AspeedSoCState AspeedSoCState;
 
 #define TYPE_ASPEED_SOC "aspeed-soc"
-typedef struct AspeedSoCClass AspeedSoCClass;
-DECLARE_OBJ_CHECKERS(AspeedSoCState, AspeedSoCClass,
-                     ASPEED_SOC, TYPE_ASPEED_SOC)
+OBJECT_DECLARE_TYPE(AspeedSoCState, AspeedSoCClass, ASPEED_SOC)
 
 struct AspeedSoCClass {
     DeviceClass parent_class;
index 181d9563d079781fcf752a3ce93b1026b133b4b9..428c15d316ee060454a3c03cffea6da6415df126 100644 (file)
 #include "qom/object.h"
 
 #define TYPE_BCM283X "bcm283x"
-typedef struct BCM283XClass BCM283XClass;
-typedef struct BCM283XState BCM283XState;
-DECLARE_OBJ_CHECKERS(BCM283XState, BCM283XClass,
-                     BCM283X, TYPE_BCM283X)
+OBJECT_DECLARE_TYPE(BCM283XState, BCM283XClass, BCM283X)
 
 #define BCM283X_NCPUS 4
 
index 54d0872fd8911deb470f0bded7562bfa4f8e80c0..706be3c6d0a4f0b8fc4ecd6c16b2a2f642d7d89c 100644 (file)
@@ -118,7 +118,6 @@ struct SMMUState {
     uint8_t bus_num;
     PCIBus *primary_bus;
 };
-typedef struct SMMUState SMMUState;
 
 struct SMMUBaseClass {
     /* <private> */
@@ -129,11 +128,9 @@ struct SMMUBaseClass {
     DeviceRealize parent_realize;
 
 };
-typedef struct SMMUBaseClass SMMUBaseClass;
 
 #define TYPE_ARM_SMMU "arm-smmu"
-DECLARE_OBJ_CHECKERS(SMMUState, SMMUBaseClass,
-                     ARM_SMMU, TYPE_ARM_SMMU)
+OBJECT_DECLARE_TYPE(SMMUState, SMMUBaseClass, ARM_SMMU)
 
 /* Return the SMMUPciBus handle associated to a PCI bus number */
 SMMUPciBus *smmu_find_smmu_pcibus(SMMUState *s, uint8_t bus_num);
index 2a3f6dd1974bf32423100e6c0d88f51f26ad9597..c641e60735e06272fbdb8ce8840ca79fce117283 100644 (file)
@@ -63,7 +63,6 @@ struct SMMUv3State {
     qemu_irq     irq[4];
     QemuMutex mutex;
 };
-typedef struct SMMUv3State SMMUv3State;
 
 typedef enum {
     SMMU_IRQ_EVTQ,
@@ -80,10 +79,8 @@ struct SMMUv3Class {
     DeviceRealize parent_realize;
     DeviceReset   parent_reset;
 };
-typedef struct SMMUv3Class SMMUv3Class;
 
 #define TYPE_ARM_SMMUV3   "arm-smmuv3"
-DECLARE_OBJ_CHECKERS(SMMUv3State, SMMUv3Class,
-                     ARM_SMMUV3, TYPE_ARM_SMMUV3)
+OBJECT_DECLARE_TYPE(SMMUv3State, SMMUv3Class, ARM_SMMUV3)
 
 #endif
index 392b0bd57188162c6b4cd9d1c9657bfd84feb0ac..d018a4f29788d22704824e5ffa8e50ae57977647 100644 (file)
@@ -128,7 +128,6 @@ struct VirtMachineClass {
     bool kvm_no_adjvtime;
     bool acpi_expose_flash;
 };
-typedef struct VirtMachineClass VirtMachineClass;
 
 struct VirtMachineState {
     MachineState parent;
@@ -165,13 +164,11 @@ struct VirtMachineState {
     DeviceState *acpi_dev;
     Notifier powerdown_notifier;
 };
-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")
-DECLARE_OBJ_CHECKERS(VirtMachineState, VirtMachineClass,
-                     VIRT_MACHINE, TYPE_VIRT_MACHINE)
+OBJECT_DECLARE_TYPE(VirtMachineState, VirtMachineClass, VIRT_MACHINE)
 
 void virt_acpi_setup(VirtMachineState *vms);
 bool virt_is_acpi_enabled(VirtMachineState *vms);
index 795910d01b9be7519e56dbf53e091d5c64882253..56aa1ca3353f05def430da5261c3cd558deb9ecc 100644 (file)
@@ -21,8 +21,7 @@
 
 #define TYPE_MACHINE "machine"
 #undef MACHINE  /* BSD defines it and QEMU does not use it */
-DECLARE_OBJ_CHECKERS(MachineState, MachineClass,
-                     MACHINE, TYPE_MACHINE)
+OBJECT_DECLARE_TYPE(MachineState, MachineClass, MACHINE)
 
 extern MachineState *current_machine;
 
index 0960480b7571c5508b2f923b62786350e04a47be..4adfaa725a27d81aabe7dd9d7a5bd392eee0831c 100644 (file)
@@ -43,10 +43,7 @@ struct MacfbSysBusState {
 };
 
 #define TYPE_NUBUS_MACFB "nubus-macfb"
-typedef struct MacfbNubusDeviceClass MacfbNubusDeviceClass;
-typedef struct MacfbNubusState MacfbNubusState;
-DECLARE_OBJ_CHECKERS(MacfbNubusState, MacfbNubusDeviceClass,
-                     NUBUS_MACFB, TYPE_NUBUS_MACFB)
+OBJECT_DECLARE_TYPE(MacfbNubusState, MacfbNubusDeviceClass, NUBUS_MACFB)
 
 struct MacfbNubusDeviceClass {
     DeviceClass parent_class;
index 2582e6e0dc66bb78b29fa1c8688a329f84e16811..e1636ce7fea98617dee7de58e6c4be02b660d522 100644 (file)
 #include "qom/object.h"
 
 #define TYPE_ASPEED_GPIO "aspeed.gpio"
-typedef struct AspeedGPIOClass AspeedGPIOClass;
-typedef struct AspeedGPIOState AspeedGPIOState;
-DECLARE_OBJ_CHECKERS(AspeedGPIOState, AspeedGPIOClass,
-                     ASPEED_GPIO, TYPE_ASPEED_GPIO)
+OBJECT_DECLARE_TYPE(AspeedGPIOState, AspeedGPIOClass, ASPEED_GPIO)
 
 #define ASPEED_GPIO_MAX_NR_SETS 8
 #define ASPEED_REGS_PER_BANK 14
index 695e1c09289cbe045f07d1e74e41535229e3b184..565f83306624eca8a946d83b2884a43d34433946 100644 (file)
 #define TYPE_ASPEED_2400_I2C TYPE_ASPEED_I2C "-ast2400"
 #define TYPE_ASPEED_2500_I2C TYPE_ASPEED_I2C "-ast2500"
 #define TYPE_ASPEED_2600_I2C TYPE_ASPEED_I2C "-ast2600"
-typedef struct AspeedI2CClass AspeedI2CClass;
-typedef struct AspeedI2CState AspeedI2CState;
-DECLARE_OBJ_CHECKERS(AspeedI2CState, AspeedI2CClass,
-                     ASPEED_I2C, TYPE_ASPEED_I2C)
+OBJECT_DECLARE_TYPE(AspeedI2CState, AspeedI2CClass, ASPEED_I2C)
 
 #define ASPEED_I2C_NR_BUSSES 16
 #define ASPEED_I2C_MAX_POOL_SIZE 0x800
index e9cc2eaf5493ab5f77922a378eb03b9dfb2c3f97..0ac9e2400d6b72d605462a951a16d4a7eafb91c8 100644 (file)
 
 #define IOAPIC_VER_ENTRIES_SHIFT        16
 
-typedef struct IOAPICCommonState IOAPICCommonState;
 
 #define TYPE_IOAPIC_COMMON "ioapic-common"
-typedef struct IOAPICCommonClass IOAPICCommonClass;
-DECLARE_OBJ_CHECKERS(IOAPICCommonState, IOAPICCommonClass,
-                     IOAPIC_COMMON, TYPE_IOAPIC_COMMON)
+OBJECT_DECLARE_TYPE(IOAPICCommonState, IOAPICCommonClass, IOAPIC_COMMON)
 
 struct IOAPICCommonClass {
     SysBusDeviceClass parent_class;
index be2d95af4d7493cec1105f08a883e0374904c05b..3b9fd4ff17fd178e5e622f31d922a5b74666cac4 100644 (file)
@@ -50,7 +50,6 @@ struct MicrovmMachineClass {
     HotplugHandler *(*orig_hotplug_handler)(MachineState *machine,
                                            DeviceState *dev);
 };
-typedef struct MicrovmMachineClass MicrovmMachineClass;
 
 struct MicrovmMachineState {
     X86MachineState parent;
@@ -69,10 +68,8 @@ struct MicrovmMachineState {
     Notifier machine_done;
     Notifier powerdown_req;
 };
-typedef struct MicrovmMachineState MicrovmMachineState;
 
 #define TYPE_MICROVM_MACHINE   MACHINE_TYPE_NAME("microvm")
-DECLARE_OBJ_CHECKERS(MicrovmMachineState, MicrovmMachineClass,
-                     MICROVM_MACHINE, TYPE_MICROVM_MACHINE)
+OBJECT_DECLARE_TYPE(MicrovmMachineState, MicrovmMachineClass, MICROVM_MACHINE)
 
 #endif
index c14e14dfe0c7a11e98898390f5747cb1ab6f2049..b2da2c8d2b3d63c3fed34293f7f51d7e5217112b 100644 (file)
@@ -119,11 +119,9 @@ struct PCMachineClass {
     /* use PVH to load kernels that support this feature */
     bool pvh_enabled;
 };
-typedef struct PCMachineClass PCMachineClass;
 
 #define TYPE_PC_MACHINE "generic-pc-machine"
-DECLARE_OBJ_CHECKERS(PCMachineState, PCMachineClass,
-                     PC_MACHINE, TYPE_PC_MACHINE)
+OBJECT_DECLARE_TYPE(PCMachineState, PCMachineClass, PC_MACHINE)
 
 /* ioapic.c */
 
index bbfaf44e7929c3a76c2bfe15572ee6359d0018dd..9de92d33a11e9624223881804c9a3b30e05cd78e 100644 (file)
 #include "qom/object.h"
 
 #define  TYPE_X86_IOMMU_DEVICE  ("x86-iommu")
-typedef struct X86IOMMUClass X86IOMMUClass;
-typedef struct X86IOMMUState X86IOMMUState;
-DECLARE_OBJ_CHECKERS(X86IOMMUState, X86IOMMUClass,
-                     X86_IOMMU_DEVICE, TYPE_X86_IOMMU_DEVICE)
+OBJECT_DECLARE_TYPE(X86IOMMUState, X86IOMMUClass, X86_IOMMU_DEVICE)
 
 #define X86_IOMMU_SID_INVALID             (0xffff)
 
index 0eef9fb0c0d718e28df09cc9985ece3de68c1c7f..d5dcf7a07fdcc8a6d03eb1af5437ea4b424c0618 100644 (file)
@@ -39,7 +39,6 @@ struct X86MachineClass {
     /* Enables contiguous-apic-ID mode */
     bool compat_apic_id_mode;
 };
-typedef struct X86MachineClass X86MachineClass;
 
 struct X86MachineState {
     /*< private >*/
@@ -72,14 +71,12 @@ struct X86MachineState {
      */
     AddressSpace *ioapic_as;
 };
-typedef struct X86MachineState X86MachineState;
 
 #define X86_MACHINE_SMM              "smm"
 #define X86_MACHINE_ACPI             "acpi"
 
 #define TYPE_X86_MACHINE   MACHINE_TYPE_NAME("x86")
-DECLARE_OBJ_CHECKERS(X86MachineState, X86MachineClass,
-                     X86_MACHINE, TYPE_X86_MACHINE)
+OBJECT_DECLARE_TYPE(X86MachineState, X86MachineClass, X86_MACHINE)
 
 void init_topo_info(X86CPUTopoInfo *topo_info, const X86MachineState *x86ms);
 
index eb9eb4e0ae150f028036d54f7fb5616d0494f72e..77c9372c27c31cda4b2a4dd6632832dd81aecd94 100644 (file)
@@ -488,9 +488,7 @@ struct IDEBus {
 };
 
 #define TYPE_IDE_DEVICE "ide-device"
-typedef struct IDEDeviceClass IDEDeviceClass;
-DECLARE_OBJ_CHECKERS(IDEDevice, IDEDeviceClass,
-                     IDE_DEVICE, TYPE_IDE_DEVICE)
+OBJECT_DECLARE_TYPE(IDEDevice, IDEDeviceClass, IDE_DEVICE)
 
 struct IDEDeviceClass {
     DeviceClass parent_class;
index 285f70db55e5f83c4af9c993460265e65fe2b1e6..3d1c2f4b105e46c86dcb7b0362133abb14462df0 100644 (file)
@@ -43,9 +43,7 @@ typedef int ADBDeviceRequest(ADBDevice *d, uint8_t *buf_out,
 typedef bool ADBDeviceHasData(ADBDevice *d);
 
 #define TYPE_ADB_DEVICE "adb-device"
-typedef struct ADBDeviceClass ADBDeviceClass;
-DECLARE_OBJ_CHECKERS(ADBDevice, ADBDeviceClass,
-                     ADB_DEVICE, TYPE_ADB_DEVICE)
+OBJECT_DECLARE_TYPE(ADBDevice, ADBDeviceClass, ADB_DEVICE)
 
 struct ADBDevice {
     /*< private >*/
index cd050bb9f253d3aadcd9ead6392c92ef57b87d7f..a6ae8a583feb65b982e7a8b7221eadeceb17db03 100644 (file)
 #include "hw/intc/i8259.h"
 #include "qom/object.h"
 
-typedef struct PICCommonState PICCommonState;
 
 #define TYPE_PIC_COMMON "pic-common"
-typedef struct PICCommonClass PICCommonClass;
-DECLARE_OBJ_CHECKERS(PICCommonState, PICCommonClass,
-                     PIC_COMMON, TYPE_PIC_COMMON)
+OBJECT_DECLARE_TYPE(PICCommonState, PICCommonClass, PIC_COMMON)
 
 struct PICCommonClass {
     ISADeviceClass parent_class;
index ddb6a2d1681c0905f4d2001a6b0d2e8abbe191ca..5f7943fa6797be259c8a69c3747ae526a04a55f7 100644 (file)
@@ -11,9 +11,7 @@
 #define ISA_NUM_IRQS 16
 
 #define TYPE_ISA_DEVICE "isa-device"
-typedef struct ISADeviceClass ISADeviceClass;
-DECLARE_OBJ_CHECKERS(ISADevice, ISADeviceClass,
-                     ISA_DEVICE, TYPE_ISA_DEVICE)
+OBJECT_DECLARE_TYPE(ISADevice, ISADeviceClass, ISA_DEVICE)
 
 #define TYPE_ISA_BUS "ISA"
 DECLARE_INSTANCE_CHECKER(ISABus, ISA_BUS,
index 19e3d3092d0a74f73ab336536bfd9be03fb0db10..c699842dd05f920baa777fbf1db47bf7e6c131b2 100644 (file)
 #define MIN_NAMESPACE_LABEL_SIZE      (128UL << 10)
 
 #define TYPE_NVDIMM      "nvdimm"
-typedef struct NVDIMMClass NVDIMMClass;
-typedef struct NVDIMMDevice NVDIMMDevice;
-DECLARE_OBJ_CHECKERS(NVDIMMDevice, NVDIMMClass,
-                     NVDIMM, TYPE_NVDIMM)
+OBJECT_DECLARE_TYPE(NVDIMMDevice, NVDIMMClass, NVDIMM)
 
 #define NVDIMM_LABEL_SIZE_PROP "label-size"
 #define NVDIMM_UUID_PROP       "uuid"
index 8d3b14acd479553a29f718a82fe94114c30f649e..d49bfb02fbdb433cc40020562cd9f9d05a410ca4 100644 (file)
 #include "qom/object.h"
 
 #define TYPE_ASPEED_SCU "aspeed.scu"
-typedef struct AspeedSCUClass AspeedSCUClass;
-typedef struct AspeedSCUState AspeedSCUState;
-DECLARE_OBJ_CHECKERS(AspeedSCUState, AspeedSCUClass,
-                     ASPEED_SCU, TYPE_ASPEED_SCU)
+OBJECT_DECLARE_TYPE(AspeedSCUState, AspeedSCUClass, 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"
index 3375afc89b7da75189ce074c1639beabe21a2d5b..ec2d59a14f57d0d72f2e751d573e7a8296144375 100644 (file)
 #include "qom/object.h"
 
 #define TYPE_ASPEED_SDMC "aspeed.sdmc"
-typedef struct AspeedSDMCClass AspeedSDMCClass;
-typedef struct AspeedSDMCState AspeedSDMCState;
-DECLARE_OBJ_CHECKERS(AspeedSDMCState, AspeedSDMCClass,
-                     ASPEED_SDMC, TYPE_ASPEED_SDMC)
+OBJECT_DECLARE_TYPE(AspeedSDMCState, AspeedSDMCClass, 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"
index e9d82a2a508444cf4251131cdb1968368f530b14..7e5678e9726045e39de5f4b0e35de131f7eeeff6 100644 (file)
 #define PLL_MFN(x)              (((x) & 0x3ff) << 0)
 
 #define TYPE_IMX_CCM "imx.ccm"
-typedef struct IMXCCMClass IMXCCMClass;
-typedef struct IMXCCMState IMXCCMState;
-DECLARE_OBJ_CHECKERS(IMXCCMState, IMXCCMClass,
-                     IMX_CCM, TYPE_IMX_CCM)
+OBJECT_DECLARE_TYPE(IMXCCMState, IMXCCMClass, IMX_CCM)
 
 struct IMXCCMState {
     /* <private> */
index f73271ba67bb681b55488dca33b78ae2fe63ceb1..fc95d22b0fd04bf46ae0b6ce87f11323d6128324 100644 (file)
@@ -122,12 +122,9 @@ struct MOS6522State {
 
     qemu_irq irq;
 };
-typedef struct MOS6522State MOS6522State;
 
 #define TYPE_MOS6522 "mos6522"
-typedef struct MOS6522DeviceClass MOS6522DeviceClass;
-DECLARE_OBJ_CHECKERS(MOS6522State, MOS6522DeviceClass,
-                     MOS6522, TYPE_MOS6522)
+OBJECT_DECLARE_TYPE(MOS6522State, MOS6522DeviceClass, MOS6522)
 
 struct MOS6522DeviceClass {
     DeviceClass parent_class;
index 15a46331786952a7fa6c52c9d48c615b94b6e4dc..05efb4e6b9e178839aba57b99874d66023df36ca 100644 (file)
@@ -15,7 +15,6 @@
 #include "hw/ppc/xive.h"
 #include "qom/object.h"
 
-typedef struct PnvPhb4PecState PnvPhb4PecState;
 typedef struct PnvPhb4PecStack PnvPhb4PecStack;
 typedef struct PnvPHB4 PnvPHB4;
 typedef struct PnvChip PnvChip;
@@ -142,9 +141,7 @@ extern const MemoryRegionOps pnv_phb4_xscom_ops;
  * PHB4 PEC (PCI Express Controller)
  */
 #define TYPE_PNV_PHB4_PEC "pnv-phb4-pec"
-typedef struct PnvPhb4PecClass PnvPhb4PecClass;
-DECLARE_OBJ_CHECKERS(PnvPhb4PecState, PnvPhb4PecClass,
-                     PNV_PHB4_PEC, TYPE_PNV_PHB4_PEC)
+OBJECT_DECLARE_TYPE(PnvPhb4PecState, PnvPhb4PecClass, PNV_PHB4_PEC)
 
 #define TYPE_PNV_PHB4_PEC_STACK "pnv-phb4-pec-stack"
 DECLARE_INSTANCE_CHECKER(PnvPhb4PecStack, PNV_PHB4_PEC_STACK,
index c13ae1f8580b9f2b60123e214ad032ffcf97fbfe..0a59a06b149d7c9254bcf391a5dbd806f2d37ee7 100644 (file)
@@ -394,9 +394,7 @@ typedef int (*pci_map_irq_fn)(PCIDevice *pci_dev, int irq_num);
 typedef PCIINTxRoute (*pci_route_irq_fn)(void *opaque, int pin);
 
 #define TYPE_PCI_BUS "PCI"
-typedef struct PCIBusClass PCIBusClass;
-DECLARE_OBJ_CHECKERS(PCIBus, PCIBusClass,
-                     PCI_BUS, TYPE_PCI_BUS)
+OBJECT_DECLARE_TYPE(PCIBus, PCIBusClass, PCI_BUS)
 #define TYPE_PCIE_BUS "PCIE"
 
 bool pci_bus_is_express(PCIBus *bus);
index d1fc1c3604a21b390f6bc2bb12078c035fd405a8..52e038c0196fd6dcc5f5dc115a268e9796ebcdcf 100644 (file)
@@ -32,9 +32,7 @@
 #include "qom/object.h"
 
 #define TYPE_PCI_HOST_BRIDGE "pci-host-bridge"
-typedef struct PCIHostBridgeClass PCIHostBridgeClass;
-DECLARE_OBJ_CHECKERS(PCIHostState, PCIHostBridgeClass,
-                     PCI_HOST_BRIDGE, TYPE_PCI_HOST_BRIDGE)
+OBJECT_DECLARE_TYPE(PCIHostState, PCIHostBridgeClass, PCI_HOST_BRIDGE)
 
 struct PCIHostState {
     SysBusDevice busdev;
index fb40ae7e0949575845fb2e1ea8c3798e7ab05194..e3ba44e0bf69f9a1a8124f7c26df7c50fba957e8 100644 (file)
@@ -12,10 +12,7 @@ typedef struct PCMCIASocket {
 } PCMCIASocket;
 
 #define TYPE_PCMCIA_CARD "pcmcia-card"
-typedef struct PCMCIACardClass PCMCIACardClass;
-typedef struct PCMCIACardState PCMCIACardState;
-DECLARE_OBJ_CHECKERS(PCMCIACardState, PCMCIACardClass,
-                     PCMCIA_CARD, TYPE_PCMCIA_CARD)
+OBJECT_DECLARE_TYPE(PCMCIACardState, PCMCIACardClass, PCMCIA_CARD)
 
 struct PCMCIACardState {
     /*< private >*/
index c8cd63bc06673702612b8c83442ae3701359a0ac..eea7ac862442b8b4b5cc5035984f4f9314774c6f 100644 (file)
@@ -39,12 +39,9 @@ struct SpaprRtcState {
 };
 
 typedef struct SpaprDimmState SpaprDimmState;
-typedef struct SpaprMachineClass SpaprMachineClass;
 
 #define TYPE_SPAPR_MACHINE      "spapr-machine"
-typedef struct SpaprMachineState SpaprMachineState;
-DECLARE_OBJ_CHECKERS(SpaprMachineState, SpaprMachineClass,
-                     SPAPR_MACHINE, TYPE_SPAPR_MACHINE)
+OBJECT_DECLARE_TYPE(SpaprMachineState, SpaprMachineClass, SPAPR_MACHINE)
 
 typedef enum {
     SPAPR_RESIZE_HPT_DEFAULT = 0,
index e025ba9653f67e9b5ef2387914377d9bd7872d4e..72064f4dd4a4f76371e614475940586e89f1c81d 100644 (file)
@@ -12,9 +12,7 @@ enum {
 };
 
 #define TYPE_DEVICE "device"
-typedef struct DeviceClass DeviceClass;
-DECLARE_OBJ_CHECKERS(DeviceState, DeviceClass,
-                     DEVICE, TYPE_DEVICE)
+OBJECT_DECLARE_TYPE(DeviceState, DeviceClass, DEVICE)
 
 typedef enum DeviceCategory {
     DEVICE_CATEGORY_BRIDGE,
index 5a6e9fff323ec33a89a9c08dab2063a5638daa6f..bf415431cd79250ef87f7ef445994aa9c1e901e6 100644 (file)
  * @{
  */
 
-typedef struct AwRtcClass AwRtcClass;
-typedef struct AwRtcState AwRtcState;
-DECLARE_OBJ_CHECKERS(AwRtcState, AwRtcClass,
-                     AW_RTC, TYPE_AW_RTC)
+OBJECT_DECLARE_TYPE(AwRtcState, AwRtcClass, AW_RTC)
 
 /** @} */
 
index 9a11093192a97691fb8a7b2666986da85a4fcdc9..14398822944213b04a3f45f51276afe8604aee10 100644 (file)
 #define TC_EWRITEA 0x0d         /* Erase write alternate */
 #define TC_WRITESF 0x11         /* Write structured field */
 
-typedef struct EmulatedCcw3270Class EmulatedCcw3270Class;
-typedef struct EmulatedCcw3270Device EmulatedCcw3270Device;
-DECLARE_OBJ_CHECKERS(EmulatedCcw3270Device, EmulatedCcw3270Class,
-                     EMULATED_CCW_3270, TYPE_EMULATED_CCW_3270)
+OBJECT_DECLARE_TYPE(EmulatedCcw3270Device, EmulatedCcw3270Class, EMULATED_CCW_3270)
 
 struct EmulatedCcw3270Device {
     CcwDevice parent_obj;
index 54d14da0a65f10c45eb25a4355dd8e064d30d236..3331990e02bf42017fb1fb6e8d12568211844931 100644 (file)
 
 #define TYPE_S390_CCW_MACHINE               "s390-ccw-machine"
 
-typedef struct S390CcwMachineClass S390CcwMachineClass;
-typedef struct S390CcwMachineState S390CcwMachineState;
-DECLARE_OBJ_CHECKERS(S390CcwMachineState, S390CcwMachineClass,
-                     S390_CCW_MACHINE, TYPE_S390_CCW_MACHINE)
+OBJECT_DECLARE_TYPE(S390CcwMachineState, S390CcwMachineClass, S390_CCW_MACHINE)
 
 
 struct S390CcwMachineState {
index efb28c48be307204a2ba70113ee57432fe39979f..5239eb538c1b087797867a247abfc14551af6a4d 100644 (file)
 #define TYPE_QEMU_S390_STATTRIB "s390-storage_attributes-qemu"
 #define TYPE_KVM_S390_STATTRIB "s390-storage_attributes-kvm"
 
-typedef struct S390StAttribClass S390StAttribClass;
-typedef struct S390StAttribState S390StAttribState;
-DECLARE_OBJ_CHECKERS(S390StAttribState, S390StAttribClass,
-                     S390_STATTRIB, TYPE_S390_STATTRIB)
+OBJECT_DECLARE_TYPE(S390StAttribState, S390StAttribClass, S390_STATTRIB)
 
 struct S390StAttribState {
     DeviceState parent_obj;
index 40f042f54e3c32f4cda41b21848d8589faa05c39..2888d42d0b4a3d12e65057abd139a3f490d6a518 100644 (file)
 #include "qom/object.h"
 
 #define TYPE_S390_SKEYS "s390-skeys"
-typedef struct S390SKeysClass S390SKeysClass;
-typedef struct S390SKeysState S390SKeysState;
-DECLARE_OBJ_CHECKERS(S390SKeysState, S390SKeysClass,
-                     S390_SKEYS, TYPE_S390_SKEYS)
+OBJECT_DECLARE_TYPE(S390SKeysState, S390SKeysClass, S390_SKEYS)
 
 struct S390SKeysState {
     DeviceState parent_obj;
index c02498f65e2f01ade7c1cee83ad0136b1e527339..ff3195a4bf8a584f2c25a0758570d437ddd02708 100644 (file)
@@ -21,10 +21,7 @@ typedef struct S390TOD {
 } S390TOD;
 
 #define TYPE_S390_TOD "s390-tod"
-typedef struct S390TODClass S390TODClass;
-typedef struct S390TODState S390TODState;
-DECLARE_OBJ_CHECKERS(S390TODState, S390TODClass,
-                     S390_TOD, TYPE_S390_TOD)
+OBJECT_DECLARE_TYPE(S390TODState, S390TODClass, S390_TOD)
 #define TYPE_KVM_S390_TOD TYPE_S390_TOD "-kvm"
 #define TYPE_QEMU_S390_TOD TYPE_S390_TOD "-qemu"
 
index 3818e3fa46bbf1d8dfc8491f499ac851ff4e0a53..b1e2ed7c35124599d1e6198271498c9447ae9325 100644 (file)
@@ -50,9 +50,7 @@ struct SCSIRequest {
 };
 
 #define TYPE_SCSI_DEVICE "scsi-device"
-typedef struct SCSIDeviceClass SCSIDeviceClass;
-DECLARE_OBJ_CHECKERS(SCSIDevice, SCSIDeviceClass,
-                     SCSI_DEVICE, TYPE_SCSI_DEVICE)
+OBJECT_DECLARE_TYPE(SCSIDevice, SCSIDeviceClass, SCSI_DEVICE)
 
 struct SCSIDeviceClass {
     DeviceClass parent_class;
index 7bccc06d1cb0dcf254c13ab647e57e32cfd8d6ca..bfe08ff4ef21db87906174473219c633f8ec03c3 100644 (file)
  * @{
  */
 
-typedef struct AwSdHostClass AwSdHostClass;
-typedef struct AwSdHostState AwSdHostState;
-DECLARE_OBJ_CHECKERS(AwSdHostState, AwSdHostClass,
-                     AW_SDHOST, TYPE_AW_SDHOST)
+OBJECT_DECLARE_TYPE(AwSdHostState, AwSdHostClass, AW_SDHOST)
 
 /** @} */
 
index 8dd4c363f5a77860bcbf4f7dadb901643931123c..59d108d453534620ec95671b9c4100754f3dcc40 100644 (file)
@@ -89,12 +89,9 @@ typedef struct {
     uint8_t crc;
 } SDRequest;
 
-typedef struct SDState SDState;
 
 #define TYPE_SD_CARD "sd-card"
-typedef struct SDCardClass SDCardClass;
-DECLARE_OBJ_CHECKERS(SDState, SDCardClass,
-                     SD_CARD, TYPE_SD_CARD)
+OBJECT_DECLARE_TYPE(SDState, SDCardClass, SD_CARD)
 
 struct SDCardClass {
     /*< private >*/
index 8e023d8ff616618c074e20fb8c854838dbbbc3af..3dd354b52ecc612a41c7f7afb1a9b9c7d5946624 100644 (file)
@@ -68,10 +68,7 @@ typedef struct AspeedSMCFlash {
 } AspeedSMCFlash;
 
 #define TYPE_ASPEED_SMC "aspeed.smc"
-typedef struct AspeedSMCClass AspeedSMCClass;
-typedef struct AspeedSMCState AspeedSMCState;
-DECLARE_OBJ_CHECKERS(AspeedSMCState, AspeedSMCClass,
-                     ASPEED_SMC, TYPE_ASPEED_SMC)
+OBJECT_DECLARE_TYPE(AspeedSMCState, AspeedSMCClass, ASPEED_SMC)
 
 struct AspeedSMCClass {
     SysBusDevice parent_obj;
index b1ab34761765ece28791276e9afd2e716c844889..a2bf2cf3c7a8cc42d74cd7560d483a62dce81272 100644 (file)
@@ -130,14 +130,12 @@ struct XilinxSPIPSClass {
     uint32_t rx_fifo_size;
     uint32_t tx_fifo_size;
 };
-typedef struct XilinxSPIPSClass XilinxSPIPSClass;
 
 #define TYPE_XILINX_SPIPS "xlnx.ps7-spi"
 #define TYPE_XILINX_QSPIPS "xlnx.ps7-qspi"
 #define TYPE_XLNX_ZYNQMP_QSPIPS "xlnx.usmp-gqspi"
 
-DECLARE_OBJ_CHECKERS(XilinxSPIPS, XilinxSPIPSClass,
-                     XILINX_SPIPS, TYPE_XILINX_SPIPS)
+OBJECT_DECLARE_TYPE(XilinxSPIPS, XilinxSPIPSClass, XILINX_SPIPS)
 
 DECLARE_INSTANCE_CHECKER(XilinxQSPIPS, XILINX_QSPIPS,
                          TYPE_XILINX_QSPIPS)
index 4c76f955c9bf34c41f695b3264f5a6c0f0b3e868..d36034a10c209a4bde9b09c00b15921dd987ad3d 100644 (file)
 #include "qom/object.h"
 
 #define TYPE_ASPEED_TIMER "aspeed.timer"
-typedef struct AspeedTimerClass AspeedTimerClass;
-typedef struct AspeedTimerCtrlState AspeedTimerCtrlState;
-DECLARE_OBJ_CHECKERS(AspeedTimerCtrlState, AspeedTimerClass,
-                     ASPEED_TIMER, TYPE_ASPEED_TIMER)
+OBJECT_DECLARE_TYPE(AspeedTimerCtrlState, AspeedTimerClass, ASPEED_TIMER)
 #define TYPE_ASPEED_2400_TIMER TYPE_ASPEED_TIMER "-ast2400"
 #define TYPE_ASPEED_2500_TIMER TYPE_ASPEED_TIMER "-ast2500"
 #define TYPE_ASPEED_2600_TIMER TYPE_ASPEED_TIMER "-ast2600"
index 1a522a24570b33bf5c2fd778b40f6a306dc781ba..3e569f42b635c9452646142d2964785efc772ec4 100644 (file)
@@ -40,10 +40,7 @@ typedef struct PITChannelInfo {
 } PITChannelInfo;
 
 #define TYPE_PIT_COMMON "pit-common"
-typedef struct PITCommonState PITCommonState;
-typedef struct PITCommonClass PITCommonClass;
-DECLARE_OBJ_CHECKERS(PITCommonState, PITCommonClass,
-                     PIT_COMMON, TYPE_PIT_COMMON)
+OBJECT_DECLARE_TYPE(PITCommonState, PITCommonClass, PIT_COMMON)
 
 #define TYPE_I8254 "isa-pit"
 #define TYPE_KVM_I8254 "kvm-pit"
index 57836354917eb9463945ceeac98d05f6dc955976..355745c23a677f440435514fb6219617e0df3abf 100644 (file)
@@ -265,9 +265,7 @@ struct USBDevice {
 };
 
 #define TYPE_USB_DEVICE "usb-device"
-typedef struct USBDeviceClass USBDeviceClass;
-DECLARE_OBJ_CHECKERS(USBDevice, USBDeviceClass,
-                     USB_DEVICE, TYPE_USB_DEVICE)
+OBJECT_DECLARE_TYPE(USBDevice, USBDeviceClass, USB_DEVICE)
 
 typedef void (*USBDeviceRealize)(USBDevice *dev, Error **errp);
 typedef void (*USBDeviceUnrealize)(USBDevice *dev);
index 807280451b398897d24e97c0dac7b5690aaafa5b..28cf3b912096dacc2e3230584862c82595813a63 100644 (file)
@@ -68,9 +68,7 @@ typedef struct VirtQueueElement
 #define VIRTIO_NO_VECTOR 0xffff
 
 #define TYPE_VIRTIO_DEVICE "virtio-device"
-typedef struct VirtioDeviceClass VirtioDeviceClass;
-DECLARE_OBJ_CHECKERS(VirtIODevice, VirtioDeviceClass,
-                     VIRTIO_DEVICE, TYPE_VIRTIO_DEVICE)
+OBJECT_DECLARE_TYPE(VirtIODevice, VirtioDeviceClass, VIRTIO_DEVICE)
 
 enum virtio_device_endian {
     VIRTIO_DEVICE_ENDIAN_UNKNOWN,
index 2ca1eb5432c5a6153fc6c45a37b14e19389216cd..80b03661e303cc877ebc6581cb1e6f5a8b3f0a4d 100644 (file)
 #include "qom/object.h"
 
 #define TYPE_ASPEED_WDT "aspeed.wdt"
-typedef struct AspeedWDTClass AspeedWDTClass;
-typedef struct AspeedWDTState AspeedWDTState;
-DECLARE_OBJ_CHECKERS(AspeedWDTState, AspeedWDTClass,
-                     ASPEED_WDT, TYPE_ASPEED_WDT)
+OBJECT_DECLARE_TYPE(AspeedWDTState, AspeedWDTClass, ASPEED_WDT)
 #define TYPE_ASPEED_2400_WDT TYPE_ASPEED_WDT "-ast2400"
 #define TYPE_ASPEED_2500_WDT TYPE_ASPEED_WDT "-ast2500"
 #define TYPE_ASPEED_2600_WDT TYPE_ASPEED_WDT "-ast2600"
index 8ff5421dc3439f9369fcb5ba15c91f709dd1b507..a74fd9384f1431c2d501b0d7fc4987d5922c976e 100644 (file)
@@ -68,11 +68,9 @@ struct XenBlockDeviceClass {
     XenBlockDeviceRealize realize;
     XenBlockDeviceUnrealize unrealize;
 };
-typedef struct XenBlockDeviceClass XenBlockDeviceClass;
 
 #define TYPE_XEN_BLOCK_DEVICE  "xen-block"
-DECLARE_OBJ_CHECKERS(XenBlockDevice, XenBlockDeviceClass,
-                     XEN_BLOCK_DEVICE, TYPE_XEN_BLOCK_DEVICE)
+OBJECT_DECLARE_TYPE(XenBlockDevice, XenBlockDeviceClass, XEN_BLOCK_DEVICE)
 
 struct XenDiskDevice {
     XenBlockDevice blockdev;
index 1924d93c6c10ffb4862b5e460ec14f4d188bfe3a..3df696136f7b7b1620dcb9f62343124342f8d5ee 100644 (file)
@@ -57,11 +57,9 @@ struct XenDeviceClass {
     XenDeviceFrontendChanged frontend_changed;
     XenDeviceUnrealize unrealize;
 };
-typedef struct XenDeviceClass XenDeviceClass;
 
 #define TYPE_XEN_DEVICE "xen-device"
-DECLARE_OBJ_CHECKERS(XenDevice, XenDeviceClass,
-                     XEN_DEVICE, TYPE_XEN_DEVICE)
+OBJECT_DECLARE_TYPE(XenDevice, XenDeviceClass, XEN_DEVICE)
 
 struct XenBus {
     BusState qbus;
index 18979c2e2d245209352ba0480ac256644e9cb891..4e3ce3f9541f27ccf5716ecf0bc3f7beab5d421c 100644 (file)
 #include "qom/object.h"
 
 #define TYPE_CAN_HOST "can-host"
-typedef struct CanHostClass CanHostClass;
-typedef struct CanHostState CanHostState;
-DECLARE_OBJ_CHECKERS(CanHostState, CanHostClass,
-                     CAN_HOST, TYPE_CAN_HOST)
+OBJECT_DECLARE_TYPE(CanHostState, CanHostClass, CAN_HOST)
 
 struct CanHostState {
     ObjectClass oc;
index e7e593128a565d55f0b2f55a1d4bcafb7c4737c3..27ffc630df4225d85a00687aa1120f3100dee29a 100644 (file)
@@ -15,9 +15,7 @@
 #include "net/queue.h"
 
 #define TYPE_NETFILTER "netfilter"
-typedef struct NetFilterClass NetFilterClass;
-DECLARE_OBJ_CHECKERS(NetFilterState, NetFilterClass,
-                     NETFILTER, TYPE_NETFILTER)
+OBJECT_DECLARE_TYPE(NetFilterState, NetFilterClass, NETFILTER)
 
 typedef void (FilterSetup) (NetFilterState *nf, Error **errp);
 typedef void (FilterCleanup) (NetFilterState *nf);
index 8602203523d949fc9d04bed36d2561c00b42142b..d091c2e1e2da4f3a13b206495004e6b80a6f0c40 100644 (file)
@@ -106,9 +106,7 @@ void kbd_put_keysym(int keysym);
 /* consoles */
 
 #define TYPE_QEMU_CONSOLE "qemu-console"
-typedef struct QemuConsoleClass QemuConsoleClass;
-DECLARE_OBJ_CHECKERS(QemuConsole, QemuConsoleClass,
-                     QEMU_CONSOLE, TYPE_QEMU_CONSOLE)
+OBJECT_DECLARE_TYPE(QemuConsole, QemuConsoleClass, QEMU_CONSOLE)
 
 
 struct QemuConsoleClass {