All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: fanhuang <FangSheng.Huang@amd.com>,
	qemu-devel@nongnu.org, david@kernel.org, mst@redhat.com,
	gourry@gourry.net, philmd@mailo.com, peterx@redhat.com,
	Zhigang.Luo@amd.com, Lianjie.Shi@amd.com
Subject: Re: [PATCH v13 02/10] qapi, hmp: introspection for the sp-mem device
Date: Mon, 22 Jun 2026 14:22:22 +0100	[thread overview]
Message-ID: <ajk3DhhIoP0Ku5YP@redhat.com> (raw)
In-Reply-To: <20260622150754.2fa1e457@imammedo>

On Mon, Jun 22, 2026 at 03:07:54PM +0200, Igor Mammedov wrote:
> On Mon, 22 Jun 2026 13:55:10 +0100
> Daniel P. Berrangé <berrange@redhat.com> wrote:
> 
> > 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 <FangSheng.Huang@amd.com>
> > > ---
> > >  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.
> 
> we don't do that with any of memory devices,
> given it's QAPI - I guess bytes are implied for 'size' type
> (i.e. no suffix massaging)

The trouble with "implied" is that it relies on the reader being
familiar with QEMU's normal practice. Perhaps passable for regular
QEMU maintainers, but not good for app developers/users consuming
QEMU. It doesn't take much to add "in bytes" to these comments to
make it clear.

Although we don't do it universally/consistently, we do have
quite a few examples:

  $ git grep 'in bytes'  | wc -l
  95

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 :|



  reply	other threads:[~2026-06-22 13:23 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19 11:11 [PATCH v13 00/10] hw/mem: add sp-mem device for Specific Purpose Memory fanhuang
2026-06-19 11:11 ` [PATCH v13 01/10] " fanhuang
2026-06-22 12:49   ` Igor Mammedov
2026-06-19 11:11 ` [PATCH v13 02/10] qapi, hmp: introspection for the sp-mem device fanhuang
2026-06-22 12:52   ` Igor Mammedov
2026-06-22 12:55   ` Daniel P. Berrangé
2026-06-22 13:07     ` Igor Mammedov
2026-06-22 13:22       ` Daniel P. Berrangé [this message]
2026-06-19 11:11 ` [PATCH v13 03/10] i386/acpi-build: partition device_memory SRAT umbrella for sp-mem fanhuang
2026-06-19 11:11 ` [PATCH v13 04/10] hw/i386: hook sp-mem into the pc machine plug path fanhuang
2026-06-22 12:44   ` Igor Mammedov
2026-06-19 11:11 ` [PATCH v13 05/10] MAINTAINERS: cover sp-mem under Memory devices, add R: tag fanhuang
2026-06-19 11:11 ` [PATCH v13 06/10] tests/acpi: add empty expected blobs for sp-mem SRAT test fanhuang
2026-06-22 12:53   ` Igor Mammedov
2026-06-19 11:11 ` [PATCH v13 07/10] tests/acpi: add bios-tables-test case for sp-mem fanhuang
2026-06-22 13:00   ` Igor Mammedov
2026-06-19 11:11 ` [PATCH v13 08/10] tests/acpi: generate expected blobs for sp-mem SRAT test fanhuang
2026-06-22 13:09   ` Igor Mammedov
2026-06-19 11:11 ` [PATCH v13 09/10] tests/qtest: add e820 fw_cfg test fanhuang
2026-06-22 14:09   ` Igor Mammedov
2026-06-19 11:11 ` [PATCH v13 10/10] tests/qtest: cover sp-mem SOFT_RESERVED e820 entry fanhuang
2026-06-22 14:09   ` 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=ajk3DhhIoP0Ku5YP@redhat.com \
    --to=berrange@redhat.com \
    --cc=FangSheng.Huang@amd.com \
    --cc=Lianjie.Shi@amd.com \
    --cc=Zhigang.Luo@amd.com \
    --cc=david@kernel.org \
    --cc=gourry@gourry.net \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@mailo.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.