qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 6/7] vl: Set current_machine early


From: Markus Armbruster
Subject: [Qemu-devel] [PATCH 6/7] vl: Set current_machine early
Date: Wed, 17 Jul 2013 19:16:08 +0200

I'd like to access QEMUMachine from a QEMUMachine init() method, which
is currently not possible.  Instead of passing it as an argument, I
simply set current_machine earlier.

Signed-off-by: Markus Armbruster <address@hidden>
---
 vl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index 45b4c52..9387662 100644
--- a/vl.c
+++ b/vl.c
@@ -3897,6 +3897,7 @@ int main(int argc, char **argv, char **envp)
         fprintf(stderr, "No machine found.\n");
         exit(1);
     }
+    current_machine = machine;
 
     if (machine->hw_version) {
         qemu_set_version(machine->hw_version);
@@ -4325,8 +4326,6 @@ int main(int argc, char **argv, char **envp)
 
     set_numa_modes();
 
-    current_machine = machine;
-
     /* init USB devices */
     if (usb_enabled(false)) {
         if (foreach_device_config(DEV_USB, usb_parse) < 0)
-- 
1.7.11.7




reply via email to

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