Patchwork [v4,2/3] qom: Register QOM infrastructure early

login
register
mail settings
Submitter Andreas Färber
Date March 4, 2012, 8:32 p.m.
Message ID <1330893156-26569-3-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/144530/
State New
Headers show

Comments

Andreas Färber - March 4, 2012, 8:32 p.m.
The constructors for QOM TYPE_INTERFACE were executed rather late in
vl.c's main(). Call them very early so that QOM can safely be used for
machines and CPUs.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Anthony Liguori <anthony@codemonkey.ws>
---
 vl.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/vl.c b/vl.c
index 97ab2b9..3fb9182 100644
--- a/vl.c
+++ b/vl.c
@@ -2299,6 +2299,8 @@  int main(int argc, char **argv, char **envp)
 #endif
     }
 
+    module_call_init(MODULE_INIT_QOM);
+
     runstate_init();
 
     init_clocks();
@@ -3460,8 +3462,6 @@  int main(int argc, char **argv, char **envp)
     if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
         exit(1);
 
-    module_call_init(MODULE_INIT_QOM);
-
     /* must be after qdev registration but before machine init */
     if (vga_model) {
         select_vgahw(vga_model);