From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53349) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVdCx-00033i-ML for qemu-devel@nongnu.org; Wed, 11 Mar 2015 05:45:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVdCr-0004Yc-D0 for qemu-devel@nongnu.org; Wed, 11 Mar 2015 05:45:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVdCr-0004XS-35 for qemu-devel@nongnu.org; Wed, 11 Mar 2015 05:45:37 -0400 Date: Wed, 11 Mar 2015 09:45:29 +0000 From: "Daniel P. Berrange" Message-ID: <20150311094529.GB22609@redhat.com> References: <1426004854-4869-1-git-send-email-berrange@redhat.com> <54FF9EFE.8000706@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <54FF9EFE.8000706@huawei.com> Subject: Re: [Qemu-devel] [PATCH] ui: fix regression in x509verify parameter for VNC server Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gonglei Cc: qemu-devel@nongnu.org, Gerd Hoffmann On Wed, Mar 11, 2015 at 09:48:46AM +0800, Gonglei wrote: > On 2015/3/11 0:27, Daniel P. Berrange wrote: > > The 'x509verify' parameter is documented as taking a path to the > > x509 certificates, ie the same syntax as the 'x509' parameter. > > > > commit 4db14629c38611061fc19ec6927405923de84f08 > > Author: Gerd Hoffmann > > Date: Tue Sep 16 12:33:03 2014 +0200 > > > > vnc: switch to QemuOpts, allow multiple servers > > > > caused a regression by turning 'x509verify' into a boolean > > parameter instead. This breaks setup from libvirt and is not > > consistent with the docs. > > > > Signed-off-by: Daniel P. Berrange > > --- > > ui/vnc.c | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/ui/vnc.c b/ui/vnc.c > > index 10a2724..37290e7 100644 > > --- a/ui/vnc.c > > +++ b/ui/vnc.c > > @@ -3304,7 +3304,7 @@ static QemuOptsList qemu_vnc_opts = { > > .type = QEMU_OPT_BOOL, > > },{ > > .name = "x509verify", > > - .type = QEMU_OPT_BOOL, > > + .type = QEMU_OPT_STRING, > > },{ > > .name = "acl", > > .type = QEMU_OPT_BOOL, > > @@ -3391,9 +3391,14 @@ void vnc_display_open(const char *id, Error **errp) > > #ifdef CONFIG_VNC_TLS > > tls = qemu_opt_get_bool(opts, "tls", false); > > path = qemu_opt_get(opts, "x509"); > > + if (!path) { > > + path = qemu_opt_get(opts, "x509verify"); > > + if (path) { > > + vs->tls.x509verify = true; > > + } > > + } > > if (path) { > > x509 = true; > > - vs->tls.x509verify = qemu_opt_get_bool(opts, "x509verify", false); > > We still need to get the x509verify value, while both 'x509' and 'x509verify' > are configured, isn't it? Err, the code 7 lines earlier gets the x509verify value. The x509 and x509verify parameters are never to be specified at the same time - either one or the other is used. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|