qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/3] hw/machine: move QEMUMachine assignment into th


From: Marcel Apfelbaum
Subject: [Qemu-devel] [PATCH 1/3] hw/machine: move QEMUMachine assignment into the core machine
Date: Tue, 11 Mar 2014 17:35:54 +0200

The QemuMachine assignment into the QOM machine it is common
to all machines until the conversion is over. It is not
specific to vl.c .

Signed-off-by: Marcel Apfelbaum <address@hidden>
---
 hw/core/machine.c | 8 ++++++++
 vl.c              | 8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/core/machine.c b/hw/core/machine.c
index d3ffef7..4b49a7d 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -12,12 +12,20 @@
 
 #include "hw/boards.h"
 
+static void machine_base_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->qemu_machine = data;
+}
+
 static const TypeInfo machine_info = {
     .name = TYPE_MACHINE,
     .parent = TYPE_OBJECT,
     .abstract = true,
     .class_size = sizeof(MachineClass),
     .instance_size = sizeof(MachineState),
+    .class_base_init = machine_base_class_init,
 };
 
 static void machine_register_types(void)
diff --git a/vl.c b/vl.c
index d75ca55..6a380d9 100644
--- a/vl.c
+++ b/vl.c
@@ -1531,19 +1531,11 @@ void pcmcia_info(Monitor *mon, const QDict *qdict)
 
 MachineState *current_machine;
 
-static void machine_class_init(ObjectClass *oc, void *data)
-{
-    MachineClass *mc = MACHINE_CLASS(oc);
-
-    mc->qemu_machine = data;
-}
-
 int qemu_register_machine(QEMUMachine *m)
 {
     TypeInfo ti = {
         .name       = g_strconcat(m->name, TYPE_MACHINE_SUFFIX, NULL),
         .parent     = TYPE_MACHINE,
-        .class_init = machine_class_init,
         .class_data = (void *)m,
     };
 
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]