summaryrefslogtreecommitdiffstats
path: root/include/hw/i386
diff options
context:
space:
mode:
authorEduardo Habkost2020-09-16 20:25:18 +0200
committerEduardo Habkost2020-09-18 20:12:32 +0200
commita489d1951cd9cc91c5954214fcf6ae0f9d2d4292 (patch)
tree1b0c2f48420f830de630eae114d39dc88c3496f4 /include/hw/i386
parentqom: Remove module_obj_name parameter from OBJECT_DECLARE* macros (diff)
downloadqemu-a489d1951cd9cc91c5954214fcf6ae0f9d2d4292.tar.gz
qemu-a489d1951cd9cc91c5954214fcf6ae0f9d2d4292.tar.xz
qemu-a489d1951cd9cc91c5954214fcf6ae0f9d2d4292.zip
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/i386')
-rw-r--r--include/hw/i386/ioapic_internal.h5
-rw-r--r--include/hw/i386/microvm.h5
-rw-r--r--include/hw/i386/pc.h4
-rw-r--r--include/hw/i386/x86-iommu.h5
-rw-r--r--include/hw/i386/x86.h5
5 files changed, 5 insertions, 19 deletions
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);