On Fri, Jun 19, 2026 at 07:11:28PM +0800, fanhuang wrote:
> Add a SpMemDeviceInfo variant to MemoryDeviceInfo so `query-memory-devices`
> reports each sp-mem instance (id, addr, size, node, memdev), and print it
> from HMP `info memory-devices`.
>
> Signed-off-by: FangSheng Huang <[email protected]>
> ---
> qapi/machine.json | 43 ++++++++++++++++++++++++++++++++++++--
> hw/core/machine-hmp-cmds.c | 11 ++++++++++
> hw/mem/sp-mem.c | 19 +++++++++++++++++
> 3 files changed, 71 insertions(+), 2 deletions(-)
>
> diff --git a/qapi/machine.json b/qapi/machine.json
> index 685e4e29b8..777cfc81e1 100644
> --- a/qapi/machine.json
> +++ b/qapi/machine.json
> @@ -1413,6 +1413,32 @@
> }
> }
>
> +##
> +# @SpMemDeviceInfo:
> +#
> +# sp-mem device state information
> +#
> +# @id: device's ID
> +#
> +# @addr: physical address, where device is mapped
> +#
> +# @size: size of memory that the device provides
Is this bytes ? Please include the units in the comment.
> +#
> +# @node: NUMA proximity domain to which the device is assigned
> +#
> +# @memdev: memory backend linked with device
> +#
> +# Since: 11.1
> +##
> +{ 'struct': 'SpMemDeviceInfo',
> + 'data': { '*id': 'str',
> + 'addr': 'size',
> + 'size': 'size',
> + 'node': 'int',
> + 'memdev': 'str'
> + }
> +}
> +
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|