From: Chao Peng <chao.p.peng@linux.intel.com>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Subject: [Qemu-devel] [PATCH] vnc: wrap vnc initialization code with CONFIG_VNC
Date: Thu, 16 Jun 2016 09:59:10 +0800 [thread overview]
Message-ID: <1466042350-13373-1-git-send-email-chao.p.peng@linux.intel.com> (raw)
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>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
Note: Of course there is other ways to fix it (e.g. check against NULL).
I feel comfortable in any way.
---
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);
--
1.8.3.1
next reply other threads:[~2016-06-16 2:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-16 1:59 Chao Peng [this message]
2016-06-16 14:38 ` [Qemu-devel] [PATCH] vnc: wrap vnc initialization code with CONFIG_VNC Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1466042350-13373-1-git-send-email-chao.p.peng@linux.intel.com \
--to=chao.p.peng@linux.intel.com \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).