[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v17 6/9] qmp/hmp: add set-vm-generation-id comma
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v17 6/9] qmp/hmp: add set-vm-generation-id commands |
Date: |
Wed, 20 Jan 2016 09:48:41 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
On 01/19/2016 06:06 AM, Igor Mammedov wrote:
> Add set-vm-generation-id command to set Virtual Machine
> Generation ID counter.
>
> QMP command example:
> { "execute": "set-vm-generation-id",
> "arguments": {
> "uuid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"
> }
> }
>
> HMP command example:
> set-vm-generation-id 324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87
>
> Signed-off-by: Igor Mammedov <address@hidden>
> ---
> +++ b/hmp.c
> @@ -2384,3 +2384,15 @@ void hmp_info_vm_generation_id(Monitor *mon, const
> QDict *qdict)
> }
> qapi_free_UuidInfo(info);
> }
> +
> +void hmp_set_vm_generation_id(Monitor *mon, const QDict *qdict)
> +{
> + Error *errp = NULL;
> + const char *uuid = qdict_get_str(qdict, "uuid");
> +
> + qmp_set_vm_generation_id(uuid, &errp);
> + if (errp != NULL) {
I might have written 'if (errp)', but that's cosmetic style.
> +++ b/qapi-schema.json
> @@ -4090,3 +4090,12 @@
> # Since 2.6
> ##
> { 'command': 'query-vm-generation-id', 'returns': 'UuidInfo' }
> +
> +##
> +# @set-vm-generation-id
> +#
> +# Set Virtual Machine Generation ID
> +#
Missing documentation of the @uuid argument.
> +# Since 2.6
> +##
> +{ 'command': 'set-vm-generation-id', 'data': { 'uuid': 'str' } }
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index 9408a3d..306082f 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -4814,3 +4814,25 @@ Example:
>
> -> { "execute": "query-vm-generation-id" }
> <- {"return": {"UUID": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"}}
Annoying that the set uses 'uuid' and the query responds with 'UUID'; I
prefer the lowercase version in new API, so maybe patch 5/9 should
create a new return type with desirable spelling rather than reusing the
older type.
> +SQMP
> +Set Virtual Machine Generation ID counter
> +-----
> +
> +Arguments:
> +
> +- "UUID": counter ID in UUID string representation (json-string)"
wrong case, per the example.
> +
> +Example:
> +
> +-> { "execute": "set-vm-generation-id" ,
> + "arguments": { "uuid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87" } }
> +<- {"return": {}}
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v17 3/9] pc: add a Virtual Machine Generation ID device, (continued)
- [Qemu-devel] [PATCH v17 3/9] pc: add a Virtual Machine Generation ID device, Igor Mammedov, 2016/01/19
- [Qemu-devel] [PATCH v17 4/9] tests: add a unit test for the vmgenid device., Igor Mammedov, 2016/01/19
- [Qemu-devel] [PATCH v17 2/9] docs: vm generation id device's description, Igor Mammedov, 2016/01/19
- [Qemu-devel] [PATCH v17 5/9] qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands, Igor Mammedov, 2016/01/19
- [Qemu-devel] [PATCH v17 7/9] add MachineClass->default_props for setting default device properties, Igor Mammedov, 2016/01/19
- [Qemu-devel] [PATCH v17 9/9] pc/q53: by default put vmgenid device as an function of ISA bridge, Igor Mammedov, 2016/01/19
- [Qemu-devel] [PATCH v17 6/9] qmp/hmp: add set-vm-generation-id commands, Igor Mammedov, 2016/01/19
- Re: [Qemu-devel] [PATCH v17 6/9] qmp/hmp: add set-vm-generation-id commands,
Eric Blake <=
- [Qemu-devel] [PATCH v17 8/9] pc: put PIIX3 in slot 1 explicitly and cleanup functions assignment, Igor Mammedov, 2016/01/19
- Re: [Qemu-devel] [PATCH v17 0/9] Virtual Machine Generation ID, Igor Mammedov, 2016/01/19