diff mbox

ppc: QOMified g3beige machine

Message ID 1474470400-29503-1-git-send-email-lvivier@redhat.com
State New
Headers show

Commit Message

Laurent Vivier Sept. 21, 2016, 3:06 p.m. UTC
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 hw/ppc/mac_oldworld.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

Comments

Laurent Vivier Sept. 21, 2016, 3:41 p.m. UTC | #1
On 21/09/2016 17:06, Laurent Vivier wrote:
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  hw/ppc/mac_oldworld.c | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)

Forget it, this is stupid: this is already what is doing DEFINE_MACHINE().

Laurent
diff mbox

Patch

diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 4479487..16a9600 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -363,8 +363,10 @@  static int heathrow_kvm_type(const char *arg)
     return 2;
 }
 
-static void heathrow_machine_init(MachineClass *mc)
+static void heathrow_machine_class_init(ObjectClass *oc, void *data)
 {
+    MachineClass *mc = MACHINE_CLASS(oc);
+
     mc->desc = "Heathrow based PowerMAC";
     mc->init = ppc_heathrow_init;
     mc->max_cpus = MAX_CPUS;
@@ -376,4 +378,15 @@  static void heathrow_machine_init(MachineClass *mc)
     mc->kvm_type = heathrow_kvm_type;
 }
 
-DEFINE_MACHINE("g3beige", heathrow_machine_init)
+static const TypeInfo heathrow_machine_info = {
+    .name          = MACHINE_TYPE_NAME("g3beige"),
+    .parent        = TYPE_MACHINE,
+    .class_init    = heathrow_machine_class_init,
+};
+
+static void heathrow_machine_register_types(void)
+{
+    type_register_static(&heathrow_machine_info);
+}
+
+type_init(heathrow_machine_register_types)