From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9cg5-0003IV-J2 for qemu-devel@nongnu.org; Mon, 19 Mar 2012 09:31:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9cfb-000548-O7 for qemu-devel@nongnu.org; Mon, 19 Mar 2012 09:31:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4977) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9cfb-00053X-GS for qemu-devel@nongnu.org; Mon, 19 Mar 2012 09:30:43 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2JDUgmF025843 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Mar 2012 09:30:42 -0400 From: Gerd Hoffmann Date: Mon, 19 Mar 2012 14:30:38 +0100 Message-Id: <1332163838-1587-8-git-send-email-kraxel@redhat.com> In-Reply-To: <1332163838-1587-1-git-send-email-kraxel@redhat.com> References: <1332163838-1587-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 7/7] spice: fix broken initialization List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alon Levy , Gerd Hoffmann From: Alon Levy 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 Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 9 +-------- vl.c | 5 +++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 80535b6..a468524 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -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 bd95539..eeb634b 100644 --- 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); -- 1.7.1