diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-16 14:25:18 -0400 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-18 14:12:32 -0400 |
commit | a489d1951cd9cc91c5954214fcf6ae0f9d2d4292 (patch) | |
tree | 1b0c2f48420f830de630eae114d39dc88c3496f4 /include/hw | |
parent | 30b5707c269cac1ad80b72f777e52c8e08b2ff19 (diff) |
Use OBJECT_DECLARE_TYPE when possible
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>
Diffstat (limited to 'include/hw')
47 files changed, 47 insertions, 173 deletions
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index 05c7d53df3..11cfe6e358 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -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; diff --git a/include/hw/arm/bcm2836.h b/include/hw/arm/bcm2836.h index 181d9563d0..428c15d316 100644 --- a/include/hw/arm/bcm2836.h +++ b/include/hw/arm/bcm2836.h @@ -18,10 +18,7 @@ #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 diff --git a/include/hw/arm/smmu-common.h b/include/hw/arm/smmu-common.h index 54d0872fd8..706be3c6d0 100644 --- a/include/hw/arm/smmu-common.h +++ b/include/hw/arm/smmu-common.h @@ -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); diff --git a/include/hw/arm/smmuv3.h b/include/hw/arm/smmuv3.h index 2a3f6dd197..c641e60735 100644 --- a/include/hw/arm/smmuv3.h +++ b/include/hw/arm/smmuv3.h @@ -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 diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index 392b0bd571..d018a4f297 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -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); diff --git a/include/hw/boards.h b/include/hw/boards.h index 795910d01b..56aa1ca335 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -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; diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h index 0960480b75..4adfaa725a 100644 --- a/include/hw/display/macfb.h +++ b/include/hw/display/macfb.h @@ -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; diff --git a/include/hw/gpio/aspeed_gpio.h b/include/hw/gpio/aspeed_gpio.h index 2582e6e0dc..e1636ce7fe 100644 --- a/include/hw/gpio/aspeed_gpio.h +++ b/include/hw/gpio/aspeed_gpio.h @@ -14,10 +14,7 @@ #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 diff --git a/include/hw/i2c/aspeed_i2c.h b/include/hw/i2c/aspeed_i2c.h index 695e1c0928..565f833066 100644 --- a/include/hw/i2c/aspeed_i2c.h +++ b/include/hw/i2c/aspeed_i2c.h @@ -29,10 +29,7 @@ #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 diff --git a/include/hw/i386/ioapic_internal.h b/include/hw/i386/ioapic_internal.h index e9cc2eaf54..0ac9e2400d 100644 --- a/include/hw/i386/ioapic_internal.h +++ b/include/hw/i386/ioapic_internal.h @@ -82,12 +82,9 @@ #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; diff --git a/include/hw/i386/microvm.h b/include/hw/i386/microvm.h index be2d95af4d..3b9fd4ff17 100644 --- a/include/hw/i386/microvm.h +++ b/include/hw/i386/microvm.h @@ -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 diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index c14e14dfe0..b2da2c8d2b 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -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 */ diff --git a/include/hw/i386/x86-iommu.h b/include/hw/i386/x86-iommu.h index bbfaf44e79..9de92d33a1 100644 --- a/include/hw/i386/x86-iommu.h +++ b/include/hw/i386/x86-iommu.h @@ -26,10 +26,7 @@ #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) diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 0eef9fb0c0..d5dcf7a07f 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -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); diff --git a/include/hw/ide/internal.h b/include/hw/ide/internal.h index eb9eb4e0ae..77c9372c27 100644 --- a/include/hw/ide/internal.h +++ b/include/hw/ide/internal.h @@ -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; diff --git a/include/hw/input/adb.h b/include/hw/input/adb.h index 285f70db55..3d1c2f4b10 100644 --- a/include/hw/input/adb.h +++ b/include/hw/input/adb.h @@ -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 >*/ diff --git a/include/hw/isa/i8259_internal.h b/include/hw/isa/i8259_internal.h index cd050bb9f2..a6ae8a583f 100644 --- a/include/hw/isa/i8259_internal.h +++ b/include/hw/isa/i8259_internal.h @@ -30,12 +30,9 @@ #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; diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index ddb6a2d168..5f7943fa67 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -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, diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h index 19e3d3092d..c699842dd0 100644 --- a/include/hw/mem/nvdimm.h +++ b/include/hw/mem/nvdimm.h @@ -46,10 +46,7 @@ #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" diff --git a/include/hw/misc/aspeed_scu.h b/include/hw/misc/aspeed_scu.h index 8d3b14acd4..d49bfb02fb 100644 --- a/include/hw/misc/aspeed_scu.h +++ b/include/hw/misc/aspeed_scu.h @@ -15,10 +15,7 @@ #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" diff --git a/include/hw/misc/aspeed_sdmc.h b/include/hw/misc/aspeed_sdmc.h index 3375afc89b..ec2d59a14f 100644 --- a/include/hw/misc/aspeed_sdmc.h +++ b/include/hw/misc/aspeed_sdmc.h @@ -13,10 +13,7 @@ #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" diff --git a/include/hw/misc/imx_ccm.h b/include/hw/misc/imx_ccm.h index e9d82a2a50..7e5678e972 100644 --- a/include/hw/misc/imx_ccm.h +++ b/include/hw/misc/imx_ccm.h @@ -28,10 +28,7 @@ #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> */ diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index f73271ba67..fc95d22b0f 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -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; diff --git a/include/hw/pci-host/pnv_phb4.h b/include/hw/pci-host/pnv_phb4.h index 15a4633178..05efb4e6b9 100644 --- a/include/hw/pci-host/pnv_phb4.h +++ b/include/hw/pci-host/pnv_phb4.h @@ -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, diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index c13ae1f858..0a59a06b14 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -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); diff --git a/include/hw/pci/pci_host.h b/include/hw/pci/pci_host.h index d1fc1c3604..52e038c019 100644 --- a/include/hw/pci/pci_host.h +++ b/include/hw/pci/pci_host.h @@ -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; diff --git a/include/hw/pcmcia.h b/include/hw/pcmcia.h index fb40ae7e09..e3ba44e0bf 100644 --- a/include/hw/pcmcia.h +++ b/include/hw/pcmcia.h @@ -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 >*/ diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index c8cd63bc06..eea7ac8624 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -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, diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index e025ba9653..72064f4dd4 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -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, diff --git a/include/hw/rtc/allwinner-rtc.h b/include/hw/rtc/allwinner-rtc.h index 5a6e9fff32..bf415431cd 100644 --- a/include/hw/rtc/allwinner-rtc.h +++ b/include/hw/rtc/allwinner-rtc.h @@ -60,10 +60,7 @@ * @{ */ -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) /** @} */ diff --git a/include/hw/s390x/3270-ccw.h b/include/hw/s390x/3270-ccw.h index 9a11093192..1439882294 100644 --- a/include/hw/s390x/3270-ccw.h +++ b/include/hw/s390x/3270-ccw.h @@ -31,10 +31,7 @@ #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; diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-virtio-ccw.h index 54d14da0a6..3331990e02 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -16,10 +16,7 @@ #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 { diff --git a/include/hw/s390x/storage-attributes.h b/include/hw/s390x/storage-attributes.h index efb28c48be..5239eb538c 100644 --- a/include/hw/s390x/storage-attributes.h +++ b/include/hw/s390x/storage-attributes.h @@ -20,10 +20,7 @@ #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; diff --git a/include/hw/s390x/storage-keys.h b/include/hw/s390x/storage-keys.h index 40f042f54e..2888d42d0b 100644 --- a/include/hw/s390x/storage-keys.h +++ b/include/hw/s390x/storage-keys.h @@ -17,10 +17,7 @@ #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; diff --git a/include/hw/s390x/tod.h b/include/hw/s390x/tod.h index c02498f65e..ff3195a4bf 100644 --- a/include/hw/s390x/tod.h +++ b/include/hw/s390x/tod.h @@ -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" diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h index 3818e3fa46..b1e2ed7c35 100644 --- a/include/hw/scsi/scsi.h +++ b/include/hw/scsi/scsi.h @@ -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; diff --git a/include/hw/sd/allwinner-sdhost.h b/include/hw/sd/allwinner-sdhost.h index 7bccc06d1c..bfe08ff4ef 100644 --- a/include/hw/sd/allwinner-sdhost.h +++ b/include/hw/sd/allwinner-sdhost.h @@ -45,10 +45,7 @@ * @{ */ -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) /** @} */ diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 8dd4c363f5..59d108d453 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -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 >*/ diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h index 8e023d8ff6..3dd354b52e 100644 --- a/include/hw/ssi/aspeed_smc.h +++ b/include/hw/ssi/aspeed_smc.h @@ -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; diff --git a/include/hw/ssi/xilinx_spips.h b/include/hw/ssi/xilinx_spips.h index b1ab347617..a2bf2cf3c7 100644 --- a/include/hw/ssi/xilinx_spips.h +++ b/include/hw/ssi/xilinx_spips.h @@ -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) diff --git a/include/hw/timer/aspeed_timer.h b/include/hw/timer/aspeed_timer.h index 4c76f955c9..d36034a10c 100644 --- a/include/hw/timer/aspeed_timer.h +++ b/include/hw/timer/aspeed_timer.h @@ -27,10 +27,7 @@ #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" diff --git a/include/hw/timer/i8254.h b/include/hw/timer/i8254.h index 1a522a2457..3e569f42b6 100644 --- a/include/hw/timer/i8254.h +++ b/include/hw/timer/i8254.h @@ -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" diff --git a/include/hw/usb.h b/include/hw/usb.h index 5783635491..355745c23a 100644 --- a/include/hw/usb.h +++ b/include/hw/usb.h @@ -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); diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 807280451b..28cf3b9120 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -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, diff --git a/include/hw/watchdog/wdt_aspeed.h b/include/hw/watchdog/wdt_aspeed.h index 2ca1eb5432..80b03661e3 100644 --- a/include/hw/watchdog/wdt_aspeed.h +++ b/include/hw/watchdog/wdt_aspeed.h @@ -15,10 +15,7 @@ #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" diff --git a/include/hw/xen/xen-block.h b/include/hw/xen/xen-block.h index 8ff5421dc3..a74fd9384f 100644 --- a/include/hw/xen/xen-block.h +++ b/include/hw/xen/xen-block.h @@ -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; diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 1924d93c6c..3df696136f 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -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; |