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>
This commit is contained in:
Eduardo Habkost 2020-09-16 14:25:18 -04:00
parent 30b5707c26
commit a489d1951c
69 changed files with 69 additions and 255 deletions

View 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

View 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

View 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

View 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__)

View 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,

View 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)
{

View File

@ -32,10 +32,7 @@
#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 >*/

View File

@ -31,10 +31,7 @@
#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 >*/

View 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 */

View 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

View 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

View File

@ -54,10 +54,7 @@
#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;

View File

@ -55,10 +55,7 @@
#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;

View 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 */

View File

@ -13,13 +13,10 @@
#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

View 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

View 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 >*/

View 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;

View 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"

View 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;

View File

@ -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

View 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);

View 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

View 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);

View 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;

View 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;

View File

@ -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

View File

@ -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

View File

@ -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;

View 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

View 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 */

View File

@ -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)

View 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);

View 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;

View 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 >*/

View File

@ -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;

View 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,

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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> */

View 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;

View 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,

View 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);

View 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;

View 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 >*/

View 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,

View 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,

View File

@ -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)
/** @} */

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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;

View 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"

View 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;

View File

@ -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)
/** @} */

View 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 >*/

View 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;

View 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)

View File

@ -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"

View 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"

View 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);

View 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,

View File

@ -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"

View 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;

View 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;

View File

@ -32,10 +32,7 @@
#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;

View 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);

View 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 {