From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpcUH-0001HZ-BW for qemu-devel@nongnu.org; Tue, 05 May 2015 09:02:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpcUD-0006WH-51 for qemu-devel@nongnu.org; Tue, 05 May 2015 09:02:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpcUC-0006W5-UV for qemu-devel@nongnu.org; Tue, 05 May 2015 09:02:09 -0400 Message-ID: <5548BF4D.9090301@redhat.com> Date: Tue, 05 May 2015 07:02:05 -0600 From: Eric Blake MIME-Version: 1.0 References: <1430418035-8510-1-git-send-email-dslutz@verizon.com> <1430418035-8510-5-git-send-email-dslutz@verizon.com> In-Reply-To: <1430418035-8510-5-git-send-email-dslutz@verizon.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8Hd7PtRAq2TkIkEBo9lqXhSpEHjwg9afp" Subject: Re: [Qemu-devel] [PATCH v5 4/7] vmport_rpc: Add QMP access to vmport_rpc object. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Don Slutz , qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Markus Armbruster , Luiz Capitulino , Anthony Liguori , Paolo Bonzini , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Richard Henderson This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8Hd7PtRAq2TkIkEBo9lqXhSpEHjwg9afp Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/30/2015 12:20 PM, Don Slutz wrote: > This adds one new inject command: >=20 > inject-vmport-action >=20 > And three guest info commands: >=20 > vmport-guestinfo-set > vmport-guestinfo-get > query-vmport-guestinfo >=20 > More details in qmp-commands.hx >=20 > Signed-off-by: Don Slutz > --- > +++ b/qapi-schema.json > @@ -1295,6 +1295,96 @@ > { 'command': 'inject-nmi' } > =20 > +## > +# @vmport-guestinfo-get: > +# > +# Get a VMWare Tools guestinfo value for a key > +# > +# @key: the key to get > +# > +# @format: #optional data encoding (default 'utf8'). > +# - base64: the value is returned in base64 encoding. > +# - utf8: the value is interpreted as UTF-8. > +# > +# Returns: value for the guest info key > +# > +# Since: 2.4 > +## > +{ 'command': 'vmport-guestinfo-get', > + 'data': {'key': 'str', '*format': 'DataFormat'}, > + 'returns': 'str' } Returning a non-dictionary is not extensible. Once my qapi nested struct series is applied, you'd have to modify the whitelist to allow this command. Better would be to return things in a dictionary, as in: { 'command': 'vmport-guestinfo-get', 'data': {'key': 'str', '*format': 'DataFormat'}, 'returns': {'data':'str'} } > + > +## > +# @VmportGuestInfo: > +# > +# Information about a single VMWare Tools guestinfo > +# > +# @key: The known key > +# > +# Since: 2.4 > +## > +{ 'type': 'VmportGuestInfo', 'data': {'key': 'str'} } Also, once my series is in, you'll need to s/type/struct/ > +++ b/qmp-commands.hx > @@ -490,6 +490,126 @@ Note: inject-nmi fails when the guest doesn't sup= port injecting. > EQMP > =20 > { > + .name =3D "inject-vmport-action", > + .args_type =3D "action:s", > + .mhandler.cmd_new =3D qmp_marshal_input_inject_vmport_action, > + }, > + > +SQMP > +inject-vmport-action > +---------- Cosmetic, but the majority of the file matches the length of the ----- to the command it is underlining. > + > +-> { "execute": "vmport-guestinfo-get", > + "arguments": { "key": "foo", > + "format": "utf8" } } > +<- {"return": "abcdefgh"} Again, I don't like the notion of returning a non-dictionary without good cause. > +-> { "execute": "query-vmport-guestinfo" } > +<- { > + "return": [ > + { > + "key": "ip", > + }, Invalid JSON - no trailing commas allowed in the objects. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --8Hd7PtRAq2TkIkEBo9lqXhSpEHjwg9afp 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/ iQEcBAEBCAAGBQJVSL9NAAoJEKeha0olJ0NqYZkH/RhCFIRuVs7XXqAIND41/q20 7VOfg7OMhWmv1FiwQuolzSKT6Ex0u5Mhg+brAVjGIWr4c7pXfBjrkhkFXF9k5y83 Ii9KWkWQmczFOCWggrrzdXbPk5UQRIfp219hbgnSli7cGS6jEkSRpr47az/adqlz LQKGr2mSY2rD+0U1cUQiZ2EEAIVvCuQK/XqpKFPdIjtKmDPXBP9MK6lIFLXFh/8/ eji8atEYu7f7e7RODTuDDvp+2GMVSMgZfsiBunGC6H16swrGuZ9Yqk9fIsdavpCT 4NONPnpBJ8ftuDKkoB0RmqZkgVdtWWlxNVChpm+fPWknUpQNfHoxmOXk01/M8jQ= =flvC -----END PGP SIGNATURE----- --8Hd7PtRAq2TkIkEBo9lqXhSpEHjwg9afp--