From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwx8z-0001TI-JC for qemu-devel@nongnu.org; Thu, 12 Nov 2015 14:02:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwx8x-00051r-WE for qemu-devel@nongnu.org; Thu, 12 Nov 2015 14:02:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34713) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwx8x-00051Z-Qn for qemu-devel@nongnu.org; Thu, 12 Nov 2015 14:02:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 75CCCA3B5A for ; Thu, 12 Nov 2015 19:02:47 +0000 (UTC) From: Eduardo Habkost Date: Thu, 12 Nov 2015 17:02:18 -0200 Message-Id: <1447354938-1575-8-git-send-email-ehabkost@redhat.com> In-Reply-To: <1447354938-1575-1-git-send-email-ehabkost@redhat.com> References: <1447354938-1575-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH v2 7/7] spice: Initialization stubs on qemu-spice.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Gerd Hoffmann This reduces the number of CONFIG_SPICE #ifdefs in vl.c. Cc: Gerd Hoffmann Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Move stubs to qemu-spice.h, as the header file already had a separate section for !CONFIG_SPICE --- include/ui/qemu-spice.h | 13 +++++++++++++ vl.c | 4 ---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index f9ce357..da01273 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -52,6 +52,8 @@ static inline CharDriverState *qemu_chr_open_spice_port(const char *name) #else /* CONFIG_SPICE */ +#include "qemu/error-report.h" + #define using_spice 0 #define spice_displays 0 static inline int qemu_spice_set_passwd(const char *passwd, @@ -76,6 +78,17 @@ static inline int qemu_spice_display_add_client(int csock, int skipauth, return -1; } +static inline void qemu_spice_display_init(void) +{ + /* This must never be called if CONFIG_SPICE is disabled */ + error_report("spice support is disabled"); + abort(); +} + +static inline void qemu_spice_init(void) +{ +} + #endif /* CONFIG_SPICE */ static inline bool qemu_using_spice(Error **errp) diff --git a/vl.c b/vl.c index d4191d6..57064ea 100644 --- a/vl.c +++ b/vl.c @@ -4386,10 +4386,8 @@ int main(int argc, char **argv, char **envp) os_set_line_buffering(); -#ifdef CONFIG_SPICE /* spice needs the timers to be initialized by this point */ qemu_spice_init(); -#endif cpu_ticks_init(); if (icount_opts) { @@ -4593,11 +4591,9 @@ int main(int argc, char **argv, char **envp) g_free(ret); } -#ifdef CONFIG_SPICE if (using_spice) { qemu_spice_display_init(); } -#endif if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { exit(1); -- 2.1.0