From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNe3E-0003C0-3N for qemu-devel@nongnu.org; Tue, 17 Feb 2015 04:02:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNe37-0001Ao-Oh for qemu-devel@nongnu.org; Tue, 17 Feb 2015 04:02:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNe37-0001Ak-Hi for qemu-devel@nongnu.org; Tue, 17 Feb 2015 04:02:33 -0500 From: Gerd Hoffmann Date: Tue, 17 Feb 2015 10:02:27 +0100 Message-Id: <1424163747-27927-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1424163747-27927-1-git-send-email-kraxel@redhat.com> References: <1424163747-27927-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] vnc: -readconfig fix List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , armbru@redhat.com, Anthony Liguori , Gerd Hoffmann Now that -vnc goes through QemuOpts we can get vnc configuration via -readconfig too. So setting display_remote in the command line parsing code doesn't cut it any more, we must check QemuOpts instead to see whenever any vnc display is configured. Reported-by: Markus Armbruster Signed-off-by: Gerd Hoffmann --- vl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 8c8f142..6677f6c 100644 --- a/vl.c +++ b/vl.c @@ -2000,7 +2000,6 @@ static DisplayType select_display(const char *p) } else if (strstart(p, "vnc", &opts)) { #ifdef CONFIG_VNC if (*opts == '=') { - display_remote++; if (vnc_parse_func(opts+1) == NULL) { exit(1); } @@ -3474,7 +3473,6 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_vnc: #ifdef CONFIG_VNC - display_remote++; if (vnc_parse_func(optarg) == NULL) { exit(1); } @@ -3967,6 +3965,11 @@ int main(int argc, char **argv, char **envp) } } +#if defined(CONFIG_VNC) + if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) { + display_remote++; + } +#endif if (display_type == DT_DEFAULT && !display_remote) { #if defined(CONFIG_GTK) display_type = DT_GTK; -- 1.8.3.1