From patchwork Mon Feb 16 08:26:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 439984 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 E1106140190 for ; Mon, 16 Feb 2015 19:27:07 +1100 (AEDT) Received: from localhost ([::1]:38088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNH1G-0003vq-1e for incoming@patchwork.ozlabs.org; Mon, 16 Feb 2015 03:27:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNH0f-0002l4-EB for qemu-devel@nongnu.org; Mon, 16 Feb 2015 03:26:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNH0a-0007xa-KR for qemu-devel@nongnu.org; Mon, 16 Feb 2015 03:26:29 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNH0a-0007xP-Dt for qemu-devel@nongnu.org; Mon, 16 Feb 2015 03:26:24 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1G8QLKl023604 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 16 Feb 2015 03:26:22 -0500 Received: from nilsson.home.kraxel.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1G8QLAD002725; Mon, 16 Feb 2015 03:26:21 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id CAE9E80795; Mon, 16 Feb 2015 09:26:20 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 16 Feb 2015 09:26:03 +0100 Message-Id: <1424075165-25016-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1424075165-25016-1-git-send-email-kraxel@redhat.com> References: <1424075165-25016-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gonglei , Gerd Hoffmann , Luiz Capitulino Subject: [Qemu-devel] [PULL 5/7] vnc: auto assian an id when calling change vnc qmp interface 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 From: Gonglei Only in this way, change vnc qmp interface can take effect, because qemu_opts_find(&qemu_vnc_opts, id) will return NULL in vnc_display_open(), It can't connect successfully vnc server forever. Signed-off-by: Gonglei Signed-off-by: Gerd Hoffmann --- qmp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qmp.c b/qmp.c index 6b2c4be..d701cff 100644 --- a/qmp.c +++ b/qmp.c @@ -387,6 +387,11 @@ static void qmp_change_vnc_listen(const char *target, Error **errp) qemu_opts_del(opts); } opts = vnc_parse_func(target); + if (!opts) { + return; + } + + vnc_auto_assign_id(olist, opts); vnc_display_open("default", errp); }