qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH V3 3/5] vl.c: Replace QEMUMachine with MachineClass


From: Marcel Apfelbaum
Subject: [Qemu-devel] [PATCH V3 3/5] vl.c: Replace QEMUMachine with MachineClass in QEMUMachineInitArgs
Date: Wed, 9 Apr 2014 20:34:51 +0300

QEMUMachine's fields are already in MachineClass. We can safely
make the switch because we copy them in machine_class_init.

Signed-off-by: Marcel Apfelbaum <address@hidden>
---
 include/hw/boards.h | 5 +++--
 vl.c                | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/hw/boards.h b/include/hw/boards.h
index 138346d..51211a6 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -7,8 +7,10 @@
 #include "hw/qdev.h"
 #include "qom/object.h"
 
+typedef struct MachineClass MachineClass;
+
 typedef struct QEMUMachineInitArgs {
-    const QEMUMachine *machine;
+    const MachineClass *machine;
     ram_addr_t ram_size;
     const char *boot_order;
     const char *kernel_filename;
@@ -62,7 +64,6 @@ int qemu_register_machine(QEMUMachine *m);
     OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE)
 
 typedef struct MachineState MachineState;
-typedef struct MachineClass MachineClass;
 
 MachineClass *find_default_machine(void);
 extern MachineState *current_machine;
diff --git a/vl.c b/vl.c
index 0b0202d..dc8d515 100644
--- a/vl.c
+++ b/vl.c
@@ -4394,7 +4394,7 @@ int main(int argc, char **argv, char **envp)
 
     qdev_machine_init();
 
-    QEMUMachineInitArgs args = { .machine = machine,
+    QEMUMachineInitArgs args = { .machine = machine_class,
                                  .ram_size = ram_size,
                                  .boot_order = boot_order,
                                  .kernel_filename = kernel_filename,
-- 
1.8.3.1




reply via email to

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