Convert machine registration to use module init functions
This cleans up quite a lot of #ifdefs, extern variables, and other ugliness.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/hw/dummy_m68k.c b/hw/dummy_m68k.c
index cb9b2eb..5718ab6 100644
--- a/hw/dummy_m68k.c
+++ b/hw/dummy_m68k.c
@@ -63,8 +63,15 @@
env->pc = entry;
}
-QEMUMachine dummy_m68k_machine = {
+static QEMUMachine dummy_m68k_machine = {
.name = "dummy",
.desc = "Dummy board",
.init = dummy_m68k_init,
};
+
+static void dummy_m68k_machine_init(void)
+{
+ qemu_register_machine(&dummy_m68k_machine);
+}
+
+machine_init(dummy_m68k_machine_init);