[1/2] early set current_machine

Submitted by Glauber Costa on March 24, 2010, 7:26 p.m.

Details

Message ID 1269458782-6123-2-git-send-email-glommer@redhat.com
State New
Headers show

Commit Message

Glauber Costa March 24, 2010, 7:26 p.m.
this way, the machine_init function itself can know which machine is current
in use, not only the late init code.
---
 vl.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/vl.c b/vl.c
index d69250c..ceddeac 100644
--- a/vl.c
+++ b/vl.c
@@ -4841,6 +4841,9 @@  int main(int argc, char **argv, char **envp)
     }
     qemu_add_globals();
 
+
+    current_machine = machine;
+
     machine->init(ram_size, boot_devices,
                   kernel_filename, kernel_cmdline, initrd_filename, cpu_model);
 
@@ -4859,8 +4862,6 @@  int main(int argc, char **argv, char **envp)
         }
     }
 
-    current_machine = machine;
-
     /* init USB devices */
     if (usb_enabled) {
         if (foreach_device_config(DEV_USB, usb_parse) < 0)