From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn8DR-0004PF-L9 for qemu-devel@nongnu.org; Fri, 16 Oct 2015 12:50:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zn8DN-0002HW-J6 for qemu-devel@nongnu.org; Fri, 16 Oct 2015 12:50:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn8DN-0002GU-4x for qemu-devel@nongnu.org; Fri, 16 Oct 2015 12:50:45 -0400 References: <1445013460-21104-1-git-send-email-jcfaracco@gmail.com> From: Eric Blake Message-ID: <56212ADC.4040508@redhat.com> Date: Fri, 16 Oct 2015 10:50:36 -0600 MIME-Version: 1.0 In-Reply-To: <1445013460-21104-1-git-send-email-jcfaracco@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1jGm2U5AEiJcM2HgIXe3Pc1iqEf6mHjEj" Subject: Re: [Qemu-devel] [PATCH] qapi: Adding websocket information inside VncInfo structure. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Julio Faracco , qemu-devel@nongnu.org Cc: armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1jGm2U5AEiJcM2HgIXe3Pc1iqEf6mHjEj Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/16/2015 10:37 AM, Julio Faracco wrote: > When the user setup a vnc server to QEMU using the argument "-vnc > 0.0.0.0:0,websocket=3D5701" for example, he cannot get information abou= t which > websocket port VNC is running. The command "info vnc" shows only detail= s about > the main VNC server and the clients. You can confirm that a websocket s= ervice > is running, checking the ports that are opened. This commit introduce t= wo new > fields inside "VncInfo" either: "webservice" which contains the port as= a > string and the boolean value "has_websocket" that copies the status of > ws_enabled from VNC Display. >=20 > Fixes #1486278 >=20 > Signed-Off-By: Julio Faracco > --- > hmp.c | 3 +++ > qapi-schema.json | 3 ++- > ui/vnc.c | 25 +++++++++++++++++++++++++ > 3 files changed, 30 insertions(+), 1 deletion(-) >=20 The choice of name 'has_websocket' won't work; it is forbidden by my pending qapi patch: https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg03733.html > diff --git a/hmp.c b/hmp.c > index 5048eee..3fc74e0 100644 > --- a/hmp.c > +++ b/hmp.c > @@ -559,6 +559,9 @@ void hmp_info_vnc(Monitor *mon, const QDict *qdict)= > if (info->has_host && info->has_service) { > monitor_printf(mon, " address: %s:%s\n", info->host, info-= >service); > } > + if(info->has_websocket) { Missing space after if. > + monitor_printf(mon, " websocket: %s:%s\n", info->host, info-= >webservice); > + } But you don't need has_websocket in the first place. Since you declared webservice as optional in qapi, this should be: if (info->has_webservice) { ... use info->webservice } > if (info->has_auth) { > monitor_printf(mon, " auth: %s\n", info->auth); > } > diff --git a/qapi-schema.json b/qapi-schema.json > index a386605..e97f78f 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -916,7 +916,8 @@ > { 'struct': 'VncInfo', > 'data': {'enabled': 'bool', '*host': 'str', > '*family': 'NetworkAddressFamily', > - '*service': 'str', '*auth': 'str', '*clients': ['VncClientI= nfo']} } > + '*service': 'str', '*auth': 'str', '*clients': ['VncClientI= nfo'], > + '*webservice': 'str', 'has_websocket': 'bool'} } Missing documentation on the new optional webservice; it should look like= : # @webservice: #optional string that means something... (since 2.5) and as argued above, I don't think you want has_websocket in the user interface. The fact that webservice is optional is sufficient - if it is present in QMP, then there is a web service; if it is absent, then either this qemu is too old to have the schema support, or there is no webservice. And if qemu is new enough for introspection, then using query-qmp-schema will tell us whether qemu was new enough to support it and therefore that it is intentionally omitted because there is no webservice. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1jGm2U5AEiJcM2HgIXe3Pc1iqEf6mHjEj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWISrcAAoJEKeha0olJ0NqVNsH/0iiYpQHKH3ecAs14O1bTMZx D67zWeVEviyStSfFB2fOKPkhOjOlqAvXXJoOo0h6kIEC24MaX3ZTtKGv0ZGuxFJ6 dSDGqBnek1T9maNsPmY3YCk/qy2xAC4QR5KSQkZBpSjaamnqrM18zMdpaLZPmdex aBPTSTIS1/Fa/X+qkuqjKV0UGYh1RvNFCWwz9ezk3ebiw6dTQik2rskwui5u0r0T mrtgrE9Tr2TCeODthx68kiaK0x5xKXMvvWFnkNbpmLwhoqo2ekqiw6SlSqdyNhbs jzqtDplQfGmf7RAV20E5Ck598SlW+wyD4na/duYIH1SG7J5ZsN88y9ogNxCu7nM= =tfyb -----END PGP SIGNATURE----- --1jGm2U5AEiJcM2HgIXe3Pc1iqEf6mHjEj--