dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0428-spice-fix-broken-initialization.patch

56753f
From 9f7bc0be9a5c353d076bb42b3bfdf77d8709063f Mon Sep 17 00:00:00 2001
56753f
From: Alon Levy <alevy@redhat.com>
56753f
Date: Wed, 14 Mar 2012 20:33:37 +0200
56753f
Subject: [PATCH 428/434] spice: fix broken initialization
56753f
56753f
Commit 1b71f7c14fab6f00c2680d4489fbee7baf796e4f moved MODULE_INIT_QOM to
56753f
way before MODULE_INIT_MACHINE, thereby breaking assumptions made in
56753f
spice-core.c which registered both a type initializer and a machine
56753f
intializer.
56753f
56753f
This fix removes the type registration, and replaces it with calling
56753f
qemu_spice_init in vl.c after command line parsing (second pass) is
56753f
done, and after timers are armed, required by spice server.
56753f
56753f
Signed-off-by: Alon Levy <alevy@redhat.com>
56753f
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
56753f
56753f
Conflicts:
56753f
56753f
	ui/spice-core.c
56753f
---
56753f
 ui/spice-core.c |    8 +-------
56753f
 vl.c            |    5 +++++
56753f
 2 files changed, 6 insertions(+), 7 deletions(-)
56753f
56753f
diff --git a/ui/spice-core.c b/ui/spice-core.c
56753f
index 4ad0a67..a468524 100644
56753f
--- a/ui/spice-core.c
56753f
+++ b/ui/spice-core.c
56753f
@@ -554,7 +554,7 @@ void qemu_spice_init(void)
56753f
 
56753f
     qemu_thread_get_self(&me);
56753f
 
56753f
-   if (!opts) {
56753f
+    if (!opts) {
56753f
         return;
56753f
     }
56753f
     port = qemu_opt_get_number(opts, "port", 0);
56753f
@@ -787,9 +787,3 @@ static void spice_register_config(void)
56753f
     qemu_add_opts(&qemu_spice_opts);
56753f
 }
56753f
 machine_init(spice_register_config);
56753f
-
56753f
-static void spice_initialize(void)
56753f
-{
56753f
-    qemu_spice_init();
56753f
-}
56753f
-device_init(spice_initialize);
56753f
diff --git a/vl.c b/vl.c
56753f
index fdefa86..d33eb03 100644
56753f
--- a/vl.c
56753f
+++ b/vl.c
56753f
@@ -3271,6 +3271,11 @@ int main(int argc, char **argv, char **envp)
56753f
         exit(1);
56753f
     }
56753f
 
56753f
+#ifdef CONFIG_SPICE
56753f
+    /* spice needs the timers to be initialized by this point */
56753f
+    qemu_spice_init();
56753f
+#endif
56753f
+
56753f
     if (icount_option && (kvm_enabled() || xen_enabled())) {
56753f
         fprintf(stderr, "-icount is not allowed with kvm or xen\n");
56753f
         exit(1);
56753f
-- 
56753f
1.7.10
56753f