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>
This commit is contained in:
Eduardo Habkost 2020-08-31 17:07:37 -04:00
parent fa34a3c58a
commit c821774a3b
73 changed files with 146 additions and 292 deletions

View File

@ -21,12 +21,10 @@
#include "trace.h"
#include "qom/object.h"
typedef struct DBusVMState DBusVMState;
typedef struct DBusVMStateClass DBusVMStateClass;
#define TYPE_DBUS_VMSTATE "dbus-vmstate"
DECLARE_OBJ_CHECKERS(DBusVMState, DBusVMStateClass,
DBUS_VMSTATE, TYPE_DBUS_VMSTATE)
OBJECT_DECLARE_TYPE(DBusVMState, DBusVMStateClass,
dbus_vmstate, DBUS_VMSTATE)
struct DBusVMStateClass {
ObjectClass parent_class;

View File

@ -8,10 +8,8 @@
/* hda bus */
#define TYPE_HDA_CODEC_DEVICE "hda-codec"
typedef struct HDACodecDevice HDACodecDevice;
typedef struct HDACodecDeviceClass HDACodecDeviceClass;
DECLARE_OBJ_CHECKERS(HDACodecDevice, HDACodecDeviceClass,
HDA_CODEC_DEVICE, TYPE_HDA_CODEC_DEVICE)
OBJECT_DECLARE_TYPE(HDACodecDevice, HDACodecDeviceClass,
hda_codec_device, HDA_CODEC_DEVICE)
#define TYPE_HDA_BUS "HDA"
typedef struct HDACodecBus HDACodecBus;

View File

@ -9,10 +9,8 @@
* virtio-vga-base: This extends VirtioPCIProxy.
*/
#define TYPE_VIRTIO_VGA_BASE "virtio-vga-base"
typedef struct VirtIOVGABase VirtIOVGABase;
typedef struct VirtIOVGABaseClass VirtIOVGABaseClass;
DECLARE_OBJ_CHECKERS(VirtIOVGABase, VirtIOVGABaseClass,
VIRTIO_VGA_BASE, TYPE_VIRTIO_VGA_BASE)
OBJECT_DECLARE_TYPE(VirtIOVGABase, VirtIOVGABaseClass,
virtio_vga_base, VIRTIO_VGA_BASE)
struct VirtIOVGABase {
VirtIOPCIProxy parent_obj;

View File

@ -27,10 +27,8 @@
#define TYPE_QAUTHZ "authz"
typedef struct QAuthZ QAuthZ;
typedef struct QAuthZClass QAuthZClass;
DECLARE_OBJ_CHECKERS(QAuthZ, QAuthZClass,
QAUTHZ, TYPE_QAUTHZ)
OBJECT_DECLARE_TYPE(QAuthZ, QAuthZClass,
qauthz, QAUTHZ)
/**

View File

@ -27,10 +27,8 @@
#define TYPE_QAUTHZ_LIST "authz-list"
typedef struct QAuthZList QAuthZList;
typedef struct QAuthZListClass QAuthZListClass;
DECLARE_OBJ_CHECKERS(QAuthZList, QAuthZListClass,
QAUTHZ_LIST, TYPE_QAUTHZ_LIST)
OBJECT_DECLARE_TYPE(QAuthZList, QAuthZListClass,
qauthz_list, QAUTHZ_LIST)

View File

@ -27,10 +27,8 @@
#define TYPE_QAUTHZ_LIST_FILE "authz-list-file"
typedef struct QAuthZListFile QAuthZListFile;
typedef struct QAuthZListFileClass QAuthZListFileClass;
DECLARE_OBJ_CHECKERS(QAuthZListFile, QAuthZListFileClass,
QAUTHZ_LIST_FILE, TYPE_QAUTHZ_LIST_FILE)
OBJECT_DECLARE_TYPE(QAuthZListFile, QAuthZListFileClass,
qauthz_list_file, QAUTHZ_LIST_FILE)

View File

@ -27,10 +27,8 @@
#define TYPE_QAUTHZ_PAM "authz-pam"
typedef struct QAuthZPAM QAuthZPAM;
typedef struct QAuthZPAMClass QAuthZPAMClass;
DECLARE_OBJ_CHECKERS(QAuthZPAM, QAuthZPAMClass,
QAUTHZ_PAM, TYPE_QAUTHZ_PAM)
OBJECT_DECLARE_TYPE(QAuthZPAM, QAuthZPAMClass,
qauthz_pam, QAUTHZ_PAM)

View File

@ -26,10 +26,8 @@
#define TYPE_QAUTHZ_SIMPLE "authz-simple"
typedef struct QAuthZSimple QAuthZSimple;
typedef struct QAuthZSimpleClass QAuthZSimpleClass;
DECLARE_OBJ_CHECKERS(QAuthZSimple, QAuthZSimpleClass,
QAUTHZ_SIMPLE, TYPE_QAUTHZ_SIMPLE)
OBJECT_DECLARE_TYPE(QAuthZSimple, QAuthZSimpleClass,
qauthz_simple, QAUTHZ_SIMPLE)

View File

@ -25,10 +25,8 @@
#include "qom/object.h"
#define TYPE_QCRYPTO_SECRET_COMMON "secret_common"
typedef struct QCryptoSecretCommon QCryptoSecretCommon;
typedef struct QCryptoSecretCommonClass QCryptoSecretCommonClass;
DECLARE_OBJ_CHECKERS(QCryptoSecretCommon, QCryptoSecretCommonClass,
QCRYPTO_SECRET_COMMON, TYPE_QCRYPTO_SECRET_COMMON)
OBJECT_DECLARE_TYPE(QCryptoSecretCommon, QCryptoSecretCommonClass,
qcrypto_secret_common, QCRYPTO_SECRET_COMMON)
struct QCryptoSecretCommon {

View File

@ -26,10 +26,8 @@
#include "crypto/secret_common.h"
#define TYPE_QCRYPTO_SECRET_KEYRING "secret_keyring"
typedef struct QCryptoSecretKeyring QCryptoSecretKeyring;
typedef struct QCryptoSecretKeyringClass QCryptoSecretKeyringClass;
DECLARE_OBJ_CHECKERS(QCryptoSecretKeyring, QCryptoSecretKeyringClass,
QCRYPTO_SECRET_KEYRING, TYPE_QCRYPTO_SECRET_KEYRING)
OBJECT_DECLARE_TYPE(QCryptoSecretKeyring, QCryptoSecretKeyringClass,
qcrypto_secret_keyring, QCRYPTO_SECRET_KEYRING)
struct QCryptoSecretKeyring {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,10 +26,8 @@
#include "block/aio.h"
#define TYPE_QIO_CHANNEL "qio-channel"
typedef struct QIOChannel QIOChannel;
typedef struct QIOChannelClass QIOChannelClass;
DECLARE_OBJ_CHECKERS(QIOChannel, QIOChannelClass,
QIO_CHANNEL, TYPE_QIO_CHANNEL)
OBJECT_DECLARE_TYPE(QIOChannel, QIOChannelClass,
qio_channel, QIO_CHANNEL)
#define QIO_CHANNEL_ERR_BLOCK -2

View File

@ -26,10 +26,8 @@
#include "io/task.h"
#define TYPE_QIO_DNS_RESOLVER "qio-dns-resolver"
typedef struct QIODNSResolver QIODNSResolver;
typedef struct QIODNSResolverClass QIODNSResolverClass;
DECLARE_OBJ_CHECKERS(QIODNSResolver, QIODNSResolverClass,
QIO_DNS_RESOLVER, TYPE_QIO_DNS_RESOLVER)
OBJECT_DECLARE_TYPE(QIODNSResolver, QIODNSResolverClass,
qio_dns_resolver, QIO_DNS_RESOLVER)
/**

View File

@ -25,10 +25,8 @@
#include "qom/object.h"
#define TYPE_QIO_NET_LISTENER "qio-net-listener"
typedef struct QIONetListener QIONetListener;
typedef struct QIONetListenerClass QIONetListenerClass;
DECLARE_OBJ_CHECKERS(QIONetListener, QIONetListenerClass,
QIO_NET_LISTENER, TYPE_QIO_NET_LISTENER)
OBJECT_DECLARE_TYPE(QIONetListener, QIONetListenerClass,
qio_net_listener, QIO_NET_LISTENER)
typedef void (*QIONetListenerClientFunc)(QIONetListener *listener,

View File

@ -9,10 +9,8 @@
#define TYPE_PR_MANAGER "pr-manager"
typedef struct PRManager PRManager;
typedef struct PRManagerClass PRManagerClass;
DECLARE_OBJ_CHECKERS(PRManager, PRManagerClass,
PR_MANAGER, TYPE_PR_MANAGER)
OBJECT_DECLARE_TYPE(PRManager, PRManagerClass,
pr_manager, PR_MANAGER)
struct sg_io_hdr;

View File

@ -37,10 +37,8 @@
#define TYPE_CRYPTODEV_BACKEND "cryptodev-backend"
typedef struct CryptoDevBackend CryptoDevBackend;
typedef struct CryptoDevBackendClass CryptoDevBackendClass;
DECLARE_OBJ_CHECKERS(CryptoDevBackend, CryptoDevBackendClass,
CRYPTODEV_BACKEND, TYPE_CRYPTODEV_BACKEND)
OBJECT_DECLARE_TYPE(CryptoDevBackend, CryptoDevBackendClass,
cryptodev_backend, CRYPTODEV_BACKEND)
#define MAX_CRYPTO_QUEUE_NUM 64

View File

@ -20,10 +20,8 @@
#include "qemu/bitmap.h"
#define TYPE_MEMORY_BACKEND "memory-backend"
typedef struct HostMemoryBackend HostMemoryBackend;
typedef struct HostMemoryBackendClass HostMemoryBackendClass;
DECLARE_OBJ_CHECKERS(HostMemoryBackend, HostMemoryBackendClass,
MEMORY_BACKEND, TYPE_MEMORY_BACKEND)
OBJECT_DECLARE_TYPE(HostMemoryBackend, HostMemoryBackendClass,
memory_backend, MEMORY_BACKEND)
/* hostmem-ram.c */
/**

View File

@ -17,10 +17,8 @@
#include "qom/object.h"
#define TYPE_RNG_BACKEND "rng-backend"
typedef struct RngBackend RngBackend;
typedef struct RngBackendClass RngBackendClass;
DECLARE_OBJ_CHECKERS(RngBackend, RngBackendClass,
RNG_BACKEND, TYPE_RNG_BACKEND)
OBJECT_DECLARE_TYPE(RngBackend, RngBackendClass,
rng_backend, RNG_BACKEND)
#define TYPE_RNG_BUILTIN "rng-builtin"

View File

@ -19,10 +19,8 @@
#include "qapi/error.h"
#define TYPE_TPM_BACKEND "tpm-backend"
typedef struct TPMBackend TPMBackend;
typedef struct TPMBackendClass TPMBackendClass;
DECLARE_OBJ_CHECKERS(TPMBackend, TPMBackendClass,
TPM_BACKEND, TYPE_TPM_BACKEND)
OBJECT_DECLARE_TYPE(TPMBackend, TPMBackendClass,
tpm_backend, TPM_BACKEND)
typedef struct TPMBackendCmd {

View File

@ -22,10 +22,8 @@
#include "io/channel.h"
#define TYPE_VHOST_USER_BACKEND "vhost-user-backend"
typedef struct VhostUserBackend VhostUserBackend;
typedef struct VhostUserBackendClass VhostUserBackendClass;
DECLARE_OBJ_CHECKERS(VhostUserBackend, VhostUserBackendClass,
VHOST_USER_BACKEND, TYPE_VHOST_USER_BACKEND)
OBJECT_DECLARE_TYPE(VhostUserBackend, VhostUserBackendClass,
vhost_user_backend, VHOST_USER_BACKEND)
struct VhostUserBackendClass {

View File

@ -25,10 +25,8 @@
#define TYPE_ALPHA_CPU "alpha-cpu"
typedef struct AlphaCPU AlphaCPU;
typedef struct AlphaCPUClass AlphaCPUClass;
DECLARE_OBJ_CHECKERS(AlphaCPU, AlphaCPUClass,
ALPHA_CPU, TYPE_ALPHA_CPU)
OBJECT_DECLARE_TYPE(AlphaCPU, AlphaCPUClass,
alpha_cpu, ALPHA_CPU)
/**
* AlphaCPUClass:

View File

@ -27,10 +27,8 @@ struct arm_boot_info;
#define TYPE_ARM_CPU "arm-cpu"
typedef struct ARMCPU ARMCPU;
typedef struct ARMCPUClass ARMCPUClass;
DECLARE_OBJ_CHECKERS(ARMCPU, ARMCPUClass,
ARM_CPU, TYPE_ARM_CPU)
OBJECT_DECLARE_TYPE(ARMCPU, ARMCPUClass,
arm_cpu, ARM_CPU)
#define TYPE_ARM_MAX_CPU "max-" TYPE_ARM_CPU

View File

@ -26,10 +26,8 @@
#define TYPE_AVR_CPU "avr-cpu"
typedef struct AVRCPU AVRCPU;
typedef struct AVRCPUClass AVRCPUClass;
DECLARE_OBJ_CHECKERS(AVRCPU, AVRCPUClass,
AVR_CPU, TYPE_AVR_CPU)
OBJECT_DECLARE_TYPE(AVRCPU, AVRCPUClass,
avr_cpu, AVR_CPU)
/**
* AVRCPUClass:

View File

@ -25,10 +25,8 @@
#define TYPE_CRIS_CPU "cris-cpu"
typedef struct CRISCPU CRISCPU;
typedef struct CRISCPUClass CRISCPUClass;
DECLARE_OBJ_CHECKERS(CRISCPU, CRISCPUClass,
CRIS_CPU, TYPE_CRIS_CPU)
OBJECT_DECLARE_TYPE(CRISCPU, CRISCPUClass,
cris_cpu, CRIS_CPU)
/**
* CRISCPUClass:

View File

@ -25,10 +25,8 @@
#define TYPE_HPPA_CPU "hppa-cpu"
typedef struct HPPACPU HPPACPU;
typedef struct HPPACPUClass HPPACPUClass;
DECLARE_OBJ_CHECKERS(HPPACPU, HPPACPUClass,
HPPA_CPU, TYPE_HPPA_CPU)
OBJECT_DECLARE_TYPE(HPPACPU, HPPACPUClass,
hppa_cpu, HPPA_CPU)
/**
* HPPACPUClass:

View File

@ -30,10 +30,8 @@
#define TYPE_X86_CPU "i386-cpu"
#endif
typedef struct X86CPU X86CPU;
typedef struct X86CPUClass X86CPUClass;
DECLARE_OBJ_CHECKERS(X86CPU, X86CPUClass,
X86_CPU, TYPE_X86_CPU)
OBJECT_DECLARE_TYPE(X86CPU, X86CPUClass,
x86_cpu, X86_CPU)
typedef struct X86CPUModel X86CPUModel;

View File

@ -25,10 +25,8 @@
#define TYPE_LM32_CPU "lm32-cpu"
typedef struct LM32CPU LM32CPU;
typedef struct LM32CPUClass LM32CPUClass;
DECLARE_OBJ_CHECKERS(LM32CPU, LM32CPUClass,
LM32_CPU, TYPE_LM32_CPU)
OBJECT_DECLARE_TYPE(LM32CPU, LM32CPUClass,
lm32_cpu, LM32_CPU)
/**
* LM32CPUClass:

View File

@ -25,10 +25,8 @@
#define TYPE_M68K_CPU "m68k-cpu"
typedef struct M68kCPU M68kCPU;
typedef struct M68kCPUClass M68kCPUClass;
DECLARE_OBJ_CHECKERS(M68kCPU, M68kCPUClass,
M68K_CPU, TYPE_M68K_CPU)
OBJECT_DECLARE_TYPE(M68kCPU, M68kCPUClass,
m68k_cpu, M68K_CPU)
/*
* M68kCPUClass:

View File

@ -25,10 +25,8 @@
#define TYPE_MICROBLAZE_CPU "microblaze-cpu"
typedef struct MicroBlazeCPU MicroBlazeCPU;
typedef struct MicroBlazeCPUClass MicroBlazeCPUClass;
DECLARE_OBJ_CHECKERS(MicroBlazeCPU, MicroBlazeCPUClass,
MICROBLAZE_CPU, TYPE_MICROBLAZE_CPU)
OBJECT_DECLARE_TYPE(MicroBlazeCPU, MicroBlazeCPUClass,
microblaze_cpu, MICROBLAZE_CPU)
/**
* MicroBlazeCPUClass:

View File

@ -29,10 +29,8 @@
#define TYPE_MIPS_CPU "mips-cpu"
#endif
typedef struct MIPSCPU MIPSCPU;
typedef struct MIPSCPUClass MIPSCPUClass;
DECLARE_OBJ_CHECKERS(MIPSCPU, MIPSCPUClass,
MIPS_CPU, TYPE_MIPS_CPU)
OBJECT_DECLARE_TYPE(MIPSCPU, MIPSCPUClass,
mips_cpu, MIPS_CPU)
/**
* MIPSCPUClass:

View File

@ -51,10 +51,8 @@ typedef struct CPUMoxieState {
#define TYPE_MOXIE_CPU "moxie-cpu"
typedef struct MoxieCPU MoxieCPU;
typedef struct MoxieCPUClass MoxieCPUClass;
DECLARE_OBJ_CHECKERS(MoxieCPU, MoxieCPUClass,
MOXIE_CPU, TYPE_MOXIE_CPU)
OBJECT_DECLARE_TYPE(MoxieCPU, MoxieCPUClass,
moxie_cpu, MOXIE_CPU)
/**
* MoxieCPUClass:

View File

@ -32,10 +32,8 @@ typedef struct CPUNios2State CPUNios2State;
#define TYPE_NIOS2_CPU "nios2-cpu"
typedef struct Nios2CPU Nios2CPU;
typedef struct Nios2CPUClass Nios2CPUClass;
DECLARE_OBJ_CHECKERS(Nios2CPU, Nios2CPUClass,
NIOS2_CPU, TYPE_NIOS2_CPU)
OBJECT_DECLARE_TYPE(Nios2CPU, Nios2CPUClass,
nios2_cpu, NIOS2_CPU)
/**
* Nios2CPUClass:

View File

@ -29,10 +29,8 @@ struct OpenRISCCPU;
#define TYPE_OPENRISC_CPU "or1k-cpu"
typedef struct OpenRISCCPU OpenRISCCPU;
typedef struct OpenRISCCPUClass OpenRISCCPUClass;
DECLARE_OBJ_CHECKERS(OpenRISCCPU, OpenRISCCPUClass,
OPENRISC_CPU, TYPE_OPENRISC_CPU)
OBJECT_DECLARE_TYPE(OpenRISCCPU, OpenRISCCPUClass,
openrisc_cpu, OPENRISC_CPU)
/**
* OpenRISCCPUClass:

View File

@ -29,10 +29,8 @@
#define TYPE_POWERPC_CPU "powerpc-cpu"
#endif
typedef struct PowerPCCPU PowerPCCPU;
typedef struct PowerPCCPUClass PowerPCCPUClass;
DECLARE_OBJ_CHECKERS(PowerPCCPU, PowerPCCPUClass,
POWERPC_CPU, TYPE_POWERPC_CPU)
OBJECT_DECLARE_TYPE(PowerPCCPU, PowerPCCPUClass,
powerpc_cpu, POWERPC_CPU)
typedef struct CPUPPCState CPUPPCState;
typedef struct ppc_tb_t ppc_tb_t;

View File

@ -232,10 +232,8 @@ struct CPURISCVState {
QEMUTimer *timer; /* Internal timer */
};
typedef struct RISCVCPU RISCVCPU;
typedef struct RISCVCPUClass RISCVCPUClass;
DECLARE_OBJ_CHECKERS(RISCVCPU, RISCVCPUClass,
RISCV_CPU, TYPE_RISCV_CPU)
OBJECT_DECLARE_TYPE(RISCVCPU, RISCVCPUClass,
riscv_cpu, RISCV_CPU)
/**
* RISCVCPUClass:

View File

@ -26,10 +26,8 @@
#define TYPE_RX62N_CPU RX_CPU_TYPE_NAME("rx62n")
typedef struct RXCPU RXCPU;
typedef struct RXCPUClass RXCPUClass;
DECLARE_OBJ_CHECKERS(RXCPU, RXCPUClass,
RX_CPU, TYPE_RX_CPU)
OBJECT_DECLARE_TYPE(RXCPU, RXCPUClass,
rx_cpu, RX_CPU)
/*
* RXCPUClass:

View File

@ -25,10 +25,8 @@
#define TYPE_S390_CPU "s390x-cpu"
typedef struct S390CPU S390CPU;
typedef struct S390CPUClass S390CPUClass;
DECLARE_OBJ_CHECKERS(S390CPU, S390CPUClass,
S390_CPU, TYPE_S390_CPU)
OBJECT_DECLARE_TYPE(S390CPU, S390CPUClass,
s390_cpu, S390_CPU)
typedef struct S390CPUModel S390CPUModel;
typedef struct S390CPUDef S390CPUDef;

View File

@ -29,10 +29,8 @@
#define TYPE_SH7751R_CPU SUPERH_CPU_TYPE_NAME("sh7751r")
#define TYPE_SH7785_CPU SUPERH_CPU_TYPE_NAME("sh7785")
typedef struct SuperHCPU SuperHCPU;
typedef struct SuperHCPUClass SuperHCPUClass;
DECLARE_OBJ_CHECKERS(SuperHCPU, SuperHCPUClass,
SUPERH_CPU, TYPE_SUPERH_CPU)
OBJECT_DECLARE_TYPE(SuperHCPU, SuperHCPUClass,
superh_cpu, SUPERH_CPU)
/**
* SuperHCPUClass:

View File

@ -29,10 +29,8 @@
#define TYPE_SPARC_CPU "sparc-cpu"
#endif
typedef struct SPARCCPU SPARCCPU;
typedef struct SPARCCPUClass SPARCCPUClass;
DECLARE_OBJ_CHECKERS(SPARCCPU, SPARCCPUClass,
SPARC_CPU, TYPE_SPARC_CPU)
OBJECT_DECLARE_TYPE(SPARCCPU, SPARCCPUClass,
sparc_cpu, SPARC_CPU)
typedef struct sparc_def_t sparc_def_t;
/**

View File

@ -99,10 +99,8 @@ typedef struct CPUTLGState {
#define TYPE_TILEGX_CPU "tilegx-cpu"
typedef struct TileGXCPU TileGXCPU;
typedef struct TileGXCPUClass TileGXCPUClass;
DECLARE_OBJ_CHECKERS(TileGXCPU, TileGXCPUClass,
TILEGX_CPU, TYPE_TILEGX_CPU)
OBJECT_DECLARE_TYPE(TileGXCPU, TileGXCPUClass,
tilegx_cpu, TILEGX_CPU)
/**
* TileGXCPUClass:

View File

@ -24,10 +24,8 @@
#define TYPE_TRICORE_CPU "tricore-cpu"
typedef struct TriCoreCPU TriCoreCPU;
typedef struct TriCoreCPUClass TriCoreCPUClass;
DECLARE_OBJ_CHECKERS(TriCoreCPU, TriCoreCPUClass,
TRICORE_CPU, TYPE_TRICORE_CPU)
OBJECT_DECLARE_TYPE(TriCoreCPU, TriCoreCPUClass,
tricore_cpu, TRICORE_CPU)
struct TriCoreCPUClass {
/*< private >*/

View File

@ -16,10 +16,8 @@
#define TYPE_UNICORE32_CPU "unicore32-cpu"
typedef struct UniCore32CPU UniCore32CPU;
typedef struct UniCore32CPUClass UniCore32CPUClass;
DECLARE_OBJ_CHECKERS(UniCore32CPU, UniCore32CPUClass,
UNICORE32_CPU, TYPE_UNICORE32_CPU)
OBJECT_DECLARE_TYPE(UniCore32CPU, UniCore32CPUClass,
unicore32_cpu, UNICORE32_CPU)
/**
* UniCore32CPUClass:

View File

@ -34,10 +34,8 @@
#define TYPE_XTENSA_CPU "xtensa-cpu"
typedef struct XtensaCPU XtensaCPU;
typedef struct XtensaCPUClass XtensaCPUClass;
DECLARE_OBJ_CHECKERS(XtensaCPU, XtensaCPUClass,
XTENSA_CPU, TYPE_XTENSA_CPU)
OBJECT_DECLARE_TYPE(XtensaCPU, XtensaCPUClass,
xtensa_cpu, XTENSA_CPU)
typedef struct XtensaConfig XtensaConfig;

View File

@ -20,10 +20,8 @@
#include "input-barrier.h"
#define TYPE_INPUT_BARRIER "input-barrier"
typedef struct InputBarrier InputBarrier;
typedef struct InputBarrierClass InputBarrierClass;
DECLARE_OBJ_CHECKERS(InputBarrier, InputBarrierClass,
INPUT_BARRIER, TYPE_INPUT_BARRIER)
OBJECT_DECLARE_TYPE(InputBarrier, InputBarrierClass,
input_barrier, INPUT_BARRIER)
#define MAX_HELLO_LENGTH 1024

View File

@ -31,10 +31,8 @@ static bool linux_is_button(unsigned int lnx)
}
#define TYPE_INPUT_LINUX "input-linux"
typedef struct InputLinux InputLinux;
typedef struct InputLinuxClass InputLinuxClass;
DECLARE_OBJ_CHECKERS(InputLinux, InputLinuxClass,
INPUT_LINUX, TYPE_INPUT_LINUX)
OBJECT_DECLARE_TYPE(InputLinux, InputLinuxClass,
input_linux, INPUT_LINUX)
struct InputLinux {