From patchwork Tue Mar 10 11:16:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 448490 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 57E2C140157 for ; Tue, 10 Mar 2015 22:17:20 +1100 (AEDT) Received: from localhost ([::1]:48080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVIA2-0000TF-9e for incoming@patchwork.ozlabs.org; Tue, 10 Mar 2015 07:17:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVI9V-0007zP-A5 for qemu-devel@nongnu.org; Tue, 10 Mar 2015 07:16:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVI9U-0000MP-GC for qemu-devel@nongnu.org; Tue, 10 Mar 2015 07:16:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50966) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVI9U-0000MJ-8e for qemu-devel@nongnu.org; Tue, 10 Mar 2015 07:16:44 -0400 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 (8.14.4/8.14.4) with ESMTP id t2ABGeA1030959 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 10 Mar 2015 07:16:41 -0400 Received: from nilsson.home.kraxel.org (ovpn-116-37.ams2.redhat.com [10.36.116.37]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2ABGXsJ031464; Tue, 10 Mar 2015 07:16:36 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 0DB4381DCF; Tue, 10 Mar 2015 12:16:32 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 10 Mar 2015 12:16:24 +0100 Message-Id: <1425986185-28637-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1425986185-28637-1-git-send-email-kraxel@redhat.com> References: <1425986185-28637-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Paolo Bonzini , Gerd Hoffmann , Anthony Liguori Subject: [Qemu-devel] [PULL 2/3] vnc: -readconfig fix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 Tested-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 b47e223..eba5d4c 100644 --- a/vl.c +++ b/vl.c @@ -2001,7 +2001,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); } @@ -3477,7 +3476,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); } @@ -3970,6 +3968,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;