qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>, qemu-devel@nongnu.org
Cc: vasilis.liaskovitis@profitbricks.com, lcapitulino@redhat.com,
	pkrempa@redhat.com, armbru@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command
Date: Mon, 16 Jun 2014 09:21:30 -0600	[thread overview]
Message-ID: <539F0B7A.4050508@redhat.com> (raw)
In-Reply-To: <1401978968-7733-2-git-send-email-imammedo@redhat.com>

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

On 06/05/2014 08:36 AM, Igor Mammedov wrote:
> ... allowing to get state of present memory devices.
> Currently implemented only for PCDIMMDevice.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> v2:
>  * fix typos an json syntax in QMP example
>  * make 'id' optional to allow command work with
>    anonymous memory devices
> ---
>  hw/mem/pc-dimm.c                |   39 ++++++++++++++++++++++++++++
>  include/hw/mem/pc-dimm.h        |    2 +
>  qapi-schema.json                |   53 +++++++++++++++++++++++++++++++++++++++
>  qmp-commands.hx                 |   27 ++++++++++++++++++++
>  qmp.c                           |   11 ++++++++
>  stubs/Makefile.objs             |    1 +
>  stubs/qmp_pc_dimm_device_list.c |    7 +++++
>  7 files changed, 140 insertions(+), 0 deletions(-)
>  create mode 100644 stubs/qmp_pc_dimm_device_list.c
> 

> +++ b/qapi-schema.json
> @@ -4722,3 +4722,56 @@
>                'btn'     : 'InputBtnEvent',
>                'rel'     : 'InputMoveEvent',
>                'abs'     : 'InputMoveEvent' } }
> +
> +##
> +# @PCDIMMDeviceInfo:
> +#
> +# PCDIMMDevice state information
> +#
> +# @id: the device's ID

Might be worth annotating this as #optional

> +#
> +# @addr: physical address, where device is mapped
> +#
> +# @size: size of memory device provides

grammar reads awkwardly; maybe 's/device/that the device/


> +{ 'type': 'PCDIMMDeviceInfo',
> +  'data': { '*id': 'str',
> +            'addr': 'int',
> +            'size': 'int',
> +            'slot': 'int',
> +            'node': 'int',
> +            'memdev': 'str',
> +            'hotplugged': 'bool',
> +            'hotpluggable': 'bool'
> +          }
> +}

Looks okay.

> +
> +##
> +# @MemoryDeviceInfo:
> +#
> +# Union containing information about a memory device
> +#
> +# Since: 2.1
> +##
> +{ 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
> +

This command works, but it is a bit verbose.  A flat union would be a
bit more compact over the wire, but we don't yet have support for a flat
union with an empty base class.  So I'll live with this.

The two tweaks to the .json file only affect comments, so they are minor
enough that I'm okay with:

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2014-06-16 15:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 14:36 [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
2014-06-05 14:36 ` [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command Igor Mammedov
2014-06-16 15:21   ` Eric Blake [this message]
2014-06-05 14:36 ` [Qemu-devel] [PATCH 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface Igor Mammedov
2014-06-16 15:32   ` Eric Blake
2014-06-05 14:36 ` [Qemu-devel] [PATCH 3/5] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices Igor Mammedov
2014-06-16 16:14   ` Eric Blake
2014-06-16 16:42     ` Igor Mammedov
2014-06-05 14:36 ` [Qemu-devel] [PATCH 4/5] qmp: add query-acpi-ospm-status command Igor Mammedov
2014-06-16 16:19   ` Eric Blake
2014-06-05 14:36 ` [Qemu-devel] [PATCH 5/5] qmp: add ACPI_DEVICE_OST event handling Igor Mammedov
2014-06-16 16:25   ` Eric Blake
2014-06-16 15:03 ` [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces Igor Mammedov
2014-06-16 15:30 ` Michael S. Tsirkin

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=539F0B7A.4050508@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mst@redhat.com \
    --cc=pkrempa@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vasilis.liaskovitis@profitbricks.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).