]> git.proxmox.com Git - qemu.git/commitdiff
spice: fix broken initialization
authorAlon Levy <alevy@redhat.com>
Wed, 14 Mar 2012 18:33:37 +0000 (20:33 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 19 Mar 2012 12:12:19 +0000 (13:12 +0100)
Commit 1b71f7c14fab6f00c2680d4489fbee7baf796e4f moved MODULE_INIT_QOM to
way before MODULE_INIT_MACHINE, thereby breaking assumptions made in
spice-core.c which registered both a type initializer and a machine
intializer.

This fix removes the type registration, and replaces it with calling
qemu_spice_init in vl.c after command line parsing (second pass) is
done, and after timers are armed, required by spice server.

Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/spice-core.c
vl.c

index 80535b6e0778cd2761282cff46e7b8319a4e6df6..a468524799441384db3d057e546ba563531c1a31 100644 (file)
@@ -554,7 +554,7 @@ void qemu_spice_init(void)
 
     qemu_thread_get_self(&me);
 
-   if (!opts) {
+    if (!opts) {
         return;
     }
     port = qemu_opt_get_number(opts, "port", 0);
@@ -787,10 +787,3 @@ static void spice_register_config(void)
     qemu_add_opts(&qemu_spice_opts);
 }
 machine_init(spice_register_config);
-
-static void spice_register_types(void)
-{
-    qemu_spice_init();
-}
-
-type_init(spice_register_types)
diff --git a/vl.c b/vl.c
index bd95539ff7604080cd584493d3efe27b745f36eb..eeb634b9ade5e54321a55c41affe02fee965c328 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -3369,6 +3369,11 @@ int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
+#ifdef CONFIG_SPICE
+    /* spice needs the timers to be initialized by this point */
+    qemu_spice_init();
+#endif
+
     if (icount_option && (kvm_enabled() || xen_enabled())) {
         fprintf(stderr, "-icount is not allowed with kvm or xen\n");
         exit(1);