All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Warren <ben@skyportsystems.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: qemu-devel@nongnu.org, mst@redhat.com, imammedo@redhat.com
Subject: Re: [Qemu-devel] [PATCH v6 5/7] qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands
Date: Wed, 15 Feb 2017 22:13:49 -0800	[thread overview]
Message-ID: <CA4C0334-08DE-4455-A3BF-1C6AA5F03023@skyportsystems.com> (raw)
In-Reply-To: <6845273b-aa91-c00c-bdf5-4353d5dbdd3a@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 5020 bytes --]


> On Feb 15, 2017, at 7:36 AM, Laszlo Ersek <lersek@redhat.com> wrote:
> 
> Two questions:
> 
> On 02/15/17 07:15, ben@skyportsystems.com <mailto:ben@skyportsystems.com> wrote:
>> From: Igor Mammedov <imammedo@redhat.com>
>> 
>> Add commands to query Virtual Machine Generation ID counter.
>> 
>> QMP command example:
>>    { "execute": "query-vm-generation-id" }
>> 
>> HMP command example:
>>    info vm-generation-id
>> 
>> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>> Signed-off-by: Ben Warren <ben@skyportsystems.com>
>> ---
>> hmp-commands-info.hx | 13 +++++++++++++
>> hmp.c                |  9 +++++++++
>> hmp.h                |  1 +
>> hw/acpi/vmgenid.c    | 16 ++++++++++++++++
>> qapi-schema.json     | 20 ++++++++++++++++++++
>> stubs/Makefile.objs  |  1 +
>> stubs/vmgenid.c      |  8 ++++++++
>> 7 files changed, 68 insertions(+)
>> create mode 100644 stubs/vmgenid.c
>> 
>> diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
>> index b0f35e6..f3df793 100644
>> --- a/hmp-commands-info.hx
>> +++ b/hmp-commands-info.hx
>> @@ -802,6 +802,19 @@ Show information about hotpluggable CPUs
>> ETEXI
>> 
>> STEXI
>> +@item info vm-generation-id
> 
> (1) Don't we need some kind of @findex here, for consistency with the
> rest of the file?
> 
>> +Show Virtual Machine Generation ID
>> +ETEXI
>> +
>> +    {
>> +        .name       = "vm-generation-id",
>> +        .args_type  = "",
>> +        .params     = "",
>> +        .help       = "Show Virtual Machine Generation ID",
>> +        .cmd = hmp_info_vm_generation_id,
>> +    },
>> +
>> +STEXI
>> @end table
>> ETEXI
>> 
>> diff --git a/hmp.c b/hmp.c
>> index 2bc4f06..535613d 100644
>> --- a/hmp.c
>> +++ b/hmp.c
>> @@ -2565,3 +2565,12 @@ void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict)
>> 
>>     qapi_free_HotpluggableCPUList(saved);
>> }
>> +
>> +void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict)
>> +{
>> +    GuidInfo *info = qmp_query_vm_generation_id(NULL);
>> +    if (info) {
>> +        monitor_printf(mon, "%s\n", info->guid);
>> +    }
>> +    qapi_free_GuidInfo(info);
>> +}
>> diff --git a/hmp.h b/hmp.h
>> index 05daf7c..799fd37 100644
>> --- a/hmp.h
>> +++ b/hmp.h
>> @@ -137,5 +137,6 @@ void hmp_rocker_of_dpa_flows(Monitor *mon, const QDict *qdict);
>> void hmp_rocker_of_dpa_groups(Monitor *mon, const QDict *qdict);
>> void hmp_info_dump(Monitor *mon, const QDict *qdict);
>> void hmp_hotpluggable_cpus(Monitor *mon, const QDict *qdict);
>> +void hmp_info_vm_generation_id(Monitor *mon, const QDict *qdict);
>> 
>> #endif
>> diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c
>> index b1b7b32..c159c76 100644
>> --- a/hw/acpi/vmgenid.c
>> +++ b/hw/acpi/vmgenid.c
>> @@ -235,3 +235,19 @@ static void vmgenid_register_types(void)
>> }
>> 
>> type_init(vmgenid_register_types)
>> +
>> +GuidInfo *qmp_query_vm_generation_id(Error **errp)
>> +{
>> +    GuidInfo *info;
>> +    VmGenIdState *vms;
>> +    Object *obj = find_vmgenid_dev();
>> +
>> +    if (!obj) {
>> +        return NULL;
>> +    }
>> +    vms = VMGENID(obj);
>> +
>> +    info = g_malloc0(sizeof(*info));
>> +    info->guid = qemu_uuid_unparse_strdup(&vms->guid);
>> +    return info;
>> +}
>> diff --git a/qapi-schema.json b/qapi-schema.json
>> index 61151f3..5e2a47f 100644
>> --- a/qapi-schema.json
>> +++ b/qapi-schema.json
>> @@ -6051,3 +6051,23 @@
>> #
>> ##
>> { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }
>> +
>> +##
>> +# @GuidInfo:
>> +#
>> +# GUID information.
>> +#
>> +# @guid: the globally unique identifier
>> +#
>> +# Since: 2.9
>> +##
>> +{ 'struct': 'GuidInfo', 'data': {'guid': 'str'} }
>> +
>> +##
>> +# @query-vm-generation-id:
>> +#
>> +# Show Virtual Machine Generation ID
>> +#
>> +# Since 2.9
>> +##
>> +{ 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
>> diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
>> index a187295..0bffca6 100644
>> --- a/stubs/Makefile.objs
>> +++ b/stubs/Makefile.objs
>> @@ -35,3 +35,4 @@ stub-obj-y += qmp_pc_dimm_device_list.o
>> stub-obj-y += target-monitor-defs.o
>> stub-obj-y += target-get-monitor-def.o
>> stub-obj-y += pc_madt_cpu_entry.o
>> +stub-obj-y += vmgenid.o
>> diff --git a/stubs/vmgenid.c b/stubs/vmgenid.c
>> new file mode 100644
>> index 0000000..8c448ac
>> --- /dev/null
>> +++ b/stubs/vmgenid.c
>> @@ -0,0 +1,8 @@
>> +#include "qemu/osdep.h"
>> +#include "qmp-commands.h"
>> +
>> +GuidInfo *qmp_query_vm_generation_id(Error **errp)
>> +{
>> +    error_setg(errp, "this command is not currently supported");
>> +    return NULL;
>> +}
>> 
> 
> (2) Don't we usually employ QERR_UNSUPPORTED for the format string in
> such cases?
> 
> With or without updates:
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com <mailto:lersek@redhat.com>>
> 
Both items changed.  Thanks!
> Thanks
> Laszlo


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 3583 bytes --]

  reply	other threads:[~2017-02-16  6:13 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15  6:15 [Qemu-devel] [PATCH v6 0/7] Add support for VM Generation ID ben
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 1/7] linker-loader: Add new 'write pointer' command ben
2017-02-15 10:57   ` Igor Mammedov
2017-02-15 14:13     ` Laszlo Ersek
2017-02-15 14:17       ` Laszlo Ersek
2017-02-15 15:22       ` Igor Mammedov
2017-02-15 15:30         ` Michael S. Tsirkin
2017-02-15 15:56           ` Igor Mammedov
2017-02-15 16:39             ` Michael S. Tsirkin
2017-02-15 17:19               ` Laszlo Ersek
2017-02-15 17:43               ` Igor Mammedov
2017-02-15 17:54                 ` Ben Warren
2017-02-15 18:06                   ` Michael S. Tsirkin
2017-02-15 18:14                     ` Ben Warren
2017-02-15 18:35                       ` Igor Mammedov
2017-02-15 18:44                         ` Ben Warren
2017-02-15 21:09                           ` Michael S. Tsirkin
2017-02-15 18:04                 ` Michael S. Tsirkin
2017-02-15 18:24                   ` Igor Mammedov
2017-02-15 19:14                     ` Ben Warren
2017-02-15 19:19                       ` Ben Warren
2017-02-16 11:10                         ` Igor Mammedov
2017-02-16 15:38                           ` Eric Blake
2017-02-15 19:34                     ` Michael S. Tsirkin
2017-02-16  8:25                       ` Igor Mammedov
2017-02-16  9:49                         ` Laszlo Ersek
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 2/7] docs: VM Generation ID device description ben
2017-02-15 11:07   ` Igor Mammedov
2017-02-15 14:26     ` Laszlo Ersek
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 3/7] ACPI: Add vmgenid blob storage to the build tables ben
2017-02-15 11:15   ` Igor Mammedov
2017-02-15 14:30   ` Laszlo Ersek
2017-02-16  6:11     ` Ben Warren
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 4/7] ACPI: Add Virtual Machine Generation ID support ben
2017-02-15 12:19   ` Igor Mammedov
2017-02-15 15:24     ` Laszlo Ersek
2017-02-15 16:07       ` Igor Mammedov
2017-02-15 16:40         ` Michael S. Tsirkin
2017-02-15 17:12           ` Ben Warren
2017-02-16  6:13       ` Ben Warren
2017-02-15 17:11     ` Ben Warren
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 5/7] qmp/hmp: add query-vm-generation-id and 'info vm-generation-id' commands ben
2017-02-15 15:36   ` Laszlo Ersek
2017-02-16  6:13     ` Ben Warren [this message]
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 6/7] tests: Move reusable ACPI macros into a new header file ben
2017-02-15 12:54   ` Igor Mammedov
2017-02-15 21:35   ` Eric Blake
2017-02-15 21:58     ` Ben Warren
2017-02-15 22:56       ` Eric Blake
2017-02-15 23:05         ` Ben Warren
2017-02-15  6:15 ` [Qemu-devel] [PATCH v6 7/7] tests: Add unit tests for the VM Generation ID feature ben
2017-02-15 13:13   ` Igor Mammedov
2017-02-16  6:15     ` Ben Warren
2017-02-15 19:47 ` [Qemu-devel] [PATCH v6 0/7] Add support for VM Generation ID Laszlo Ersek
2017-02-15 20:09   ` Michael S. Tsirkin
2017-02-15 20:15     ` Ben Warren
2017-02-15 20:52     ` Laszlo Ersek
2017-02-16  6:10       ` Ben Warren
2017-02-16  9:36         ` Laszlo Ersek
2017-02-16 12:08       ` Igor Mammedov
2017-02-16 13:29         ` Laszlo Ersek
2017-02-16 14:27           ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA4C0334-08DE-4455-A3BF-1C6AA5F03023@skyportsystems.com \
    --to=ben@skyportsystems.com \
    --cc=imammedo@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.