From patchwork Thu Feb 5 09:36:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gonglei (Arei)" X-Patchwork-Id: 436724 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 5A9F714016B for ; Thu, 5 Feb 2015 20:37:55 +1100 (AEDT) Received: from localhost ([::1]:40875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJIsj-0002g1-Ar for incoming@patchwork.ozlabs.org; Thu, 05 Feb 2015 04:37:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJIs4-0001XM-Jp for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:37:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJIru-00038G-Mv for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:37:12 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:23223) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJIru-00037I-An for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:37:02 -0500 Received: from 172.24.2.119 (EHLO szxeml427-hub.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CGV95737; Thu, 05 Feb 2015 17:36:59 +0800 (CST) Received: from localhost (10.177.19.102) by szxeml427-hub.china.huawei.com (10.82.67.182) with Microsoft SMTP Server id 14.3.158.1; Thu, 5 Feb 2015 17:36:14 +0800 From: To: Date: Thu, 5 Feb 2015 17:36:09 +0800 Message-ID: <1423128969-5012-3-git-send-email-arei.gonglei@huawei.com> X-Mailer: git-send-email 1.7.3.1.msysgit.0 In-Reply-To: <1423128969-5012-1-git-send-email-arei.gonglei@huawei.com> References: <1423128969-5012-1-git-send-email-arei.gonglei@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.19.102] X-CFilter-Loop: Reflected X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 119.145.14.65 Cc: Gonglei , kraxel@redhat.com, peter.huangpeng@huawei.com Subject: [Qemu-devel] [PATCH 2/2] 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 --- qmp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qmp.c b/qmp.c index 963305c..028193b 100644 --- a/qmp.c +++ b/qmp.c @@ -381,6 +381,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); }