diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2020-08-31 17:07:37 -0400 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2020-09-09 09:27:11 -0400 |
commit | c821774a3b7ca991d684c3966171d8657f842aea (patch) | |
tree | 57b444ef9ee2ac18c63795d00644776ac4b8cc43 /include/hw | |
parent | fa34a3c58ae7161463aded42e70bd59c212ed9f4 (diff) |
Use OBJECT_DECLARE_TYPE where possible
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]')
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200831210740.126168-16-ehabkost@redhat.com>
Message-Id: <20200831210740.126168-17-ehabkost@redhat.com>
Message-Id: <20200831210740.126168-18-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'include/hw')
29 files changed, 58 insertions, 116 deletions
diff --git a/include/hw/arm/armsse.h b/include/hw/arm/armsse.h index 452cbb5793..b844ef6bc0 100644 --- a/include/hw/arm/armsse.h +++ b/include/hw/arm/armsse.h @@ -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 diff --git a/include/hw/hyperv/vmbus.h b/include/hw/hyperv/vmbus.h index 0fe3d3b47c..00ad8798c1 100644 --- a/include/hw/hyperv/vmbus.h +++ b/include/hw/hyperv/vmbus.h @@ -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; diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h index 2074f7c971..5b8eef62c6 100644 --- a/include/hw/i2c/i2c.h +++ b/include/hw/i2c/i2c.h @@ -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; diff --git a/include/hw/i2c/smbus_slave.h b/include/hw/i2c/smbus_slave.h index 8d16e4bcd9..cb9cb372f9 100644 --- a/include/hw/i2c/smbus_slave.h +++ b/include/hw/i2c/smbus_slave.h @@ -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 { diff --git a/include/hw/ipack/ipack.h b/include/hw/ipack/ipack.h index a2304c1b3e..a59a487853 100644 --- a/include/hw/ipack/ipack.h +++ b/include/hw/ipack/ipack.h @@ -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 >*/ diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h index 01c9d497c4..3fa5a4abd0 100644 --- a/include/hw/ipmi/ipmi.h +++ b/include/hw/ipmi/ipmi.h @@ -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; diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h index 86e3010243..1d570defc9 100644 --- a/include/hw/mem/pc-dimm.h +++ b/include/hw/mem/pc-dimm.h @@ -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" diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index f3bacb6a5c..b4b2b24d80 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -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 >*/ diff --git a/include/hw/ppc/pnv_core.h b/include/hw/ppc/pnv_core.h index fd17a236e3..5cb22c2fa9 100644 --- a/include/hw/ppc/pnv_core.h +++ b/include/hw/ppc/pnv_core.h @@ -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; diff --git a/include/hw/ppc/pnv_homer.h b/include/hw/ppc/pnv_homer.h index 7aadcab03c..0978812713 100644 --- a/include/hw/ppc/pnv_homer.h +++ b/include/hw/ppc/pnv_homer.h @@ -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) diff --git a/include/hw/ppc/pnv_occ.h b/include/hw/ppc/pnv_occ.h index 4fcfb32417..b79e3440be 100644 --- a/include/hw/ppc/pnv_occ.h +++ b/include/hw/ppc/pnv_occ.h @@ -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) diff --git a/include/hw/ppc/pnv_psi.h b/include/hw/ppc/pnv_psi.h index a33195df17..0034db44c3 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -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 diff --git a/include/hw/ppc/pnv_xive.h b/include/hw/ppc/pnv_xive.h index a014e2a726..29d5debd1c 100644 --- a/include/hw/ppc/pnv_xive.h +++ b/include/hw/ppc/pnv_xive.h @@ -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 diff --git a/include/hw/ppc/spapr_cpu_core.h b/include/hw/ppc/spapr_cpu_core.h index fba6a01050..4022917168 100644 --- a/include/hw/ppc/spapr_cpu_core.h +++ b/include/hw/ppc/spapr_cpu_core.h @@ -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 diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index e289028634..6c40da72ff 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -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; diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index bcb584b90d..c5a3cdcadc 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -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, diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index 48595ab641..482fafccfd 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -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; diff --git a/include/hw/s390x/event-facility.h b/include/hw/s390x/event-facility.h index eccf6e924b..051c1c6576 100644 --- a/include/hw/s390x/event-facility.h +++ b/include/hw/s390x/event-facility.h @@ -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" diff --git a/include/hw/s390x/s390_flic.h b/include/hw/s390x/s390_flic.h index a6a123598d..4b718c8ebf 100644 --- a/include/hw/s390x/s390_flic.h +++ b/include/hw/s390x/s390_flic.h @@ -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; diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h index 5038a45612..e9f0f7e67c 100644 --- a/include/hw/s390x/sclp.h +++ b/include/hw/s390x/sclp.h @@ -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; diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 31ccbeab0e..54f97a07cd 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -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; diff --git a/include/hw/ssi/ssi.h b/include/hw/ssi/ssi.h index b9286989fc..4fe1d85136 100644 --- a/include/hw/ssi/ssi.h +++ b/include/hw/ssi/ssi.h @@ -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" diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 77e21bba18..28a9b0f634 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -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: diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 72f8689e2e..f334b78085 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -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; diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h index c54aa6aa72..5eb9e7745e 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -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) diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h index 5f0b81a967..dfc72e14b1 100644 --- a/include/hw/virtio/virtio-mem.h +++ b/include/hw/virtio/virtio-mem.h @@ -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" diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pmem.h index 6c15abad70..56df9a03ce 100644 --- a/include/hw/virtio/virtio-pmem.h +++ b/include/hw/virtio/virtio-pmem.h @@ -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" diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-serial.h index bbc76d5032..0b7f963611 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -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; diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 35fec7c905..e0e67505b8 100644 --- a/include/hw/xen/xen-bus.h +++ b/include/hw/xen/xen-bus.h @@ -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); |