From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJIvj-00063O-PK for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:41:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJIvg-0004pY-JJ for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:40:59 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:52069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJIvf-0004ov-W6 for qemu-devel@nongnu.org; Thu, 05 Feb 2015 04:40:56 -0500 Message-ID: <54D33A93.7050809@huawei.com> Date: Thu, 5 Feb 2015 17:40:35 +0800 From: Gonglei MIME-Version: 1.0 References: <1423128969-5012-1-git-send-email-arei.gonglei@huawei.com> <1423128969-5012-3-git-send-email-arei.gonglei@huawei.com> In-Reply-To: <1423128969-5012-3-git-send-email-arei.gonglei@huawei.com> Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] vnc: auto assian an id when calling change vnc qmp interface List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Gonglei (Arei)" Cc: "Huangpeng (Peter)" , "qemu-devel@nongnu.org" , "kraxel@redhat.com" On 2015/2/5 17:36, Gonglei (Arei) wrote: > 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) { Oops... I forget to rebase. It should be 'if (!opts)'. :( Regards, -Gonglei > + return; > + } > + > + vnc_auto_assign_id(olist, opts); > vnc_display_open("default", errp); > } >