[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 4/7] vmport_rpc: Add QMP access to vmport_rpc
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v5 4/7] vmport_rpc: Add QMP access to vmport_rpc object. |
Date: |
Tue, 05 May 2015 07:02:05 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
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 <address@hidden>
> ---
> +++ b/qapi-schema.json
> @@ -1295,6 +1295,96 @@
> { 'command': 'inject-nmi' }
>
> +##
> +# @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 support
> injecting.
> EQMP
>
> {
> + .name = "inject-vmport-action",
> + .args_type = "action:s",
> + .mhandler.cmd_new = 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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v5 4/7] vmport_rpc: Add QMP access to vmport_rpc object.,
Eric Blake <=