[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command |
Date: |
Mon, 16 Jun 2014 09:21:30 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
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 <address@hidden>
> ---
> 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 <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces, Igor Mammedov, 2014/06/05
- [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command, Igor Mammedov, 2014/06/05
- Re: [Qemu-devel] [PATCH 1/5] qmp: add query-memory-devices command,
Eric Blake <=
- [Qemu-devel] [PATCH 2/5] acpi: introduce TYPE_ACPI_DEVICE_IF interface, Igor Mammedov, 2014/06/05
- [Qemu-devel] [PATCH 3/5] acpi: implement ospm_status() method for PIIX4/ICH9_LPC devices, Igor Mammedov, 2014/06/05
- [Qemu-devel] [PATCH 4/5] qmp: add query-acpi-ospm-status command, Igor Mammedov, 2014/06/05
- [Qemu-devel] [PATCH 5/5] qmp: add ACPI_DEVICE_OST event handling, Igor Mammedov, 2014/06/05
- Re: [Qemu-devel] [PATCH 0/5] ACPI memory hotplug: QMP interfaces, Igor Mammedov, 2014/06/16