Received: from eggs.gnu.org ([2001:4830:134:3::10]:39089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDakV-0003v1-OB for qemu-devel@nongnu.org; Thu, 16 Jun 2016 13:06:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDakQ-00054W-LM for qemu-devel@nongnu.org; Thu, 16 Jun 2016 13:06:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDakQ-00054R-F0 for qemu-devel@nongnu.org; Thu, 16 Jun 2016 13:06:30 -0400 From: Eduardo Habkost Date: Thu, 16 Jun 2016 14:06:18 -0300 Message-Id: <1466096778-13248-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1466096778-13248-1-git-send-email-ehabkost@redhat.com> References: <1466096778-13248-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PULL 2/2] vnc: Wrap vnc initialization code with CONFIG_VNC List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, Peter Maydell Cc: Paolo Bonzini , Marcel Apfelbaum , Chao Peng From: Chao Peng commit f8c75b2486 (vnc: Initialization stubs) removed CONFIG_VNC in vl.c code. However qemu_find_opts("vnc") is NULL when vnc is configured out. Crash will happen in qemu_opts_foreach() before stub vnc_init_func() is called. This patch add it back. Cc: Eduardo Habkost Reviewed-by: Eduardo Habkost Signed-off-by: Chao Peng --- vl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vl.c b/vl.c index 45eff56..2088491 100644 --- a/vl.c +++ b/vl.c @@ -4557,8 +4557,10 @@ int main(int argc, char **argv, char **envp) os_setup_signal_handling(); /* init remote displays */ +#ifdef CONFIG_VNC qemu_opts_foreach(qemu_find_opts("vnc"), vnc_init_func, NULL, NULL); +#endif if (show_vnc_port) { char *ret = vnc_display_local_addr("default"); printf("VNC server running on '%s'\n", ret); -- 2.5.5