@@ -1810,23 +1810,20 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
pc_machine_set_fd_bootchk);
}
-static const TypeInfo pc_machine_info = {
- .name = TYPE_PC_MACHINE,
- .parent = TYPE_X86_MACHINE,
- .abstract = true,
- .instance_size = sizeof(PCMachineState),
- .instance_init = pc_machine_initfn,
- .class_size = sizeof(PCMachineClass),
- .class_init = pc_machine_class_init,
- .interfaces = (InterfaceInfo[]) {
- { TYPE_HOTPLUG_HANDLER },
- { }
+static const TypeInfo pc_machine_types[] = {
+ {
+ .name = TYPE_PC_MACHINE,
+ .parent = TYPE_X86_MACHINE,
+ .abstract = true,
+ .instance_size = sizeof(PCMachineState),
+ .instance_init = pc_machine_initfn,
+ .class_size = sizeof(PCMachineClass),
+ .class_init = pc_machine_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_HOTPLUG_HANDLER },
+ { }
+ },
},
};
-static void pc_machine_register_types(void)
-{
- type_register_static(&pc_machine_info);
-}
-
-type_init(pc_machine_register_types)
+DEFINE_TYPES(pc_machine_types)
When multiple QOM types are registered in the same file, it is simpler to use the the DEFINE_TYPES() macro. In particular because type array declared with such macro are easier to review. In few commits we are going to add more types, so replace the type_register_static() to ease further reviews. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/i386/pc.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-)