vnc: Wrap vnc initialization code with CONFIG_VNC
authorChao Peng <chao.p.peng@linux.intel.com>
Thu, 16 Jun 2016 01:59:10 +0000 (09:59 +0800)
committerEduardo Habkost <ehabkost@redhat.com>
Fri, 17 Jun 2016 13:42:21 +0000 (10:42 -0300)
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 <ehabkost@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
vl.c

diff --git a/vl.c b/vl.c
index 0736d8430dc3459d98238662ef0351f09d59f2dd..2f63eb448f4b3d7f4dc77d9eec5e7fe25a758cc9 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -4564,8 +4564,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);
This page took 0.032482 seconds and 4 git commands to generate.