From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsFCZ-0006Vh-2Q for qemu-devel@nongnu.org; Tue, 12 May 2015 14:46:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsFCU-0005ED-Vw for qemu-devel@nongnu.org; Tue, 12 May 2015 14:46:47 -0400 Received: from omzsmtpe04.verizonbusiness.com ([199.249.25.207]:59121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsFCU-0005Dv-KB for qemu-devel@nongnu.org; Tue, 12 May 2015 14:46:42 -0400 From: Don Slutz Message-ID: <55524A67.1020108@one.verizon.com> Date: Tue, 12 May 2015 14:45:59 -0400 MIME-Version: 1.0 References: <1430418035-8510-1-git-send-email-dslutz@verizon.com> <1430418035-8510-5-git-send-email-dslutz@verizon.com> <5548BF4D.9090301@redhat.com> In-Reply-To: <5548BF4D.9090301@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WCINXjppXDjQDBoVCpl3KvvmeQ3l495UN" 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: Eric Blake , "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) --WCINXjppXDjQDBoVCpl3KvvmeQ3l495UN Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/05/15 09:02, Eric Blake wrote: > On 04/30/2015 12:20 PM, Don Slutz wrote: >> This adds one new inject command: >> >> inject-vmport-action >> >> And three guest info commands: >> >> vmport-guestinfo-set >> vmport-guestinfo-get >> query-vmport-guestinfo >> >> More details in qmp-commands.hx >> >> Signed-off-by: Don Slutz >> --- >=20 >> +++ b/qapi-schema.json >> @@ -1295,6 +1295,96 @@ >> { 'command': 'inject-nmi' } >> =20 >=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' } >=20 > 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:= >=20 > { 'command': 'vmport-guestinfo-get', > 'data': {'key': 'str', '*format': 'DataFormat'}, > 'returns': {'data':'str'} } >=20 Will change to something like this. >> + >> +## >> +# @VmportGuestInfo: >> +# >> +# Information about a single VMWare Tools guestinfo >> +# >> +# @key: The known key >> +# >> +# Since: 2.4 >> +## >> +{ 'type': 'VmportGuestInfo', 'data': {'key': 'str'} } >=20 > Also, once my series is in, you'll need to s/type/struct/ >=20 >=20 Looks like your series is in, adjusting. >> +++ b/qmp-commands.hx >> @@ -490,6 +490,126 @@ Note: inject-nmi fails when the guest doesn't su= pport 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 >> +---------- >=20 > Cosmetic, but the majority of the file matches the length of the ----- > to the command it is underlining. >=20 >=20 Will Do >> + >> +-> { "execute": "vmport-guestinfo-get", >> + "arguments": { "key": "foo", >> + "format": "utf8" } } >> +<- {"return": "abcdefgh"} >=20 > Again, I don't like the notion of returning a non-dictionary without > good cause. >=20 >=20 Will adjust. >> +-> { "execute": "query-vmport-guestinfo" } >> +<- { >> + "return": [ >> + { >> + "key": "ip", >> + }, >=20 > Invalid JSON - no trailing commas allowed in the objects. >=20 Will Fix -Don Slutz --WCINXjppXDjQDBoVCpl3KvvmeQ3l495UN 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.0.14 (GNU/Linux) iQIcBAEBAgAGBQJVUkqKAAoJEHkofi8zcwBk/EwP/RjLv06rkxzWfd8bO/Z148ls WQuffDWVj+ge52GWomLlP3nVOdprKbWbbwoDW8sQYIorvCmoPnWaUwikflucHX52 X0Du/KLhNWWDxbgi9D6k+Y0gwO6UITTCFATWpSorHEv+u3o6L7Hn2nEtrrU61E8Y +gwCN6zPKPsNXxFmJqZ+vQb7NBiEQ2VsfZljR6eFOgMKq9HqBIBsLjX3V3GAQwdX p3aStXk57gr/HvwDCP5sln/kNOveMRKzrqbHmy9I9LiBq+Os5PWTl8Ag7mtdEswv rBs83OXjiVBM+qFQQMsqfFVwO4leSWZjHlmVR4u1wwqjUdPHVbZzfthmV5rivpOp g1xZcPHg7uYruXZwcgGaJZMU+cd3FhwoFFeSVQDE+gq/7vzbA6uANpdzeks3O8BM vtM1EoUf7XQGYHTn36Fj1zW71Q8mf9sQ2UWuh+zz2W+fdsYf+9jUucmijUqB73Cl JxpBAxG5PW9sDrShHW/aFQyDyUfEgRzJ4bcP6A5FafvAPAHDF62MyrHyLV4savzr MpffDvv8tJEY5ROa6M+KykK2Kd5u4Db5B6WaHpGycGetIJebKAxwwZeoSdw/HFRj qTNwdh5KOJko4Qg1fqp3KroTb8gtlGAAGArAjNm3/l/IibH3ftHvhFcFexjMdIGx Q/Cdi7jJo8qLpzvfsT6x =F+Tg -----END PGP SIGNATURE----- --WCINXjppXDjQDBoVCpl3KvvmeQ3l495UN--