qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Haozhong Zhang <haozhong.zhang@intel.com>,
	qemu-devel@nongnu.org, mst@redhat.com,
	Xiao Guangrong <xiaoguangrong.eric@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Markus Armbruster <armbru@redhat.com>,
	dgilbert@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 2/5] qmp: distinguish PC-DIMM and NVDIMM in MemoryDeviceInfoList
Date: Tue, 6 Mar 2018 13:34:27 +0100	[thread overview]
Message-ID: <20180306133427.565a7c81@redhat.com> (raw)
In-Reply-To: <d22bd716-c48f-89a6-d264-cea75ab7b3c4@redhat.com>

On Mon, 5 Mar 2018 13:14:34 -0600
Eric Blake <eblake@redhat.com> wrote:

> On 03/05/2018 12:57 AM, Haozhong Zhang wrote:
> > It may need to treat PC-DIMM and NVDIMM differently, e.g., when
> > deciding the necessity of non-volatile flag bit in SRAT memory
> > affinity structures.
> > 
> > NVDIMMDeviceInfo, which inherits from PCDIMMDeviceInfo, is added to
> > union type MemoryDeviceInfo to record information of NVDIMM devices.
> > The NVDIMM-specific data is currently left empty and will be filled
> > when necessary in the future.
> > 
> > Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
> > ---
> >   hmp.c            | 14 +++++++++++---
> >   hw/mem/pc-dimm.c | 20 ++++++++++++++++++--
> >   numa.c           | 19 +++++++++++++------
> >   qapi-schema.json | 18 +++++++++++++++++-  
> 
> Will need rebasing now that the contents live in qapi/misc.json.
> 
> > +++ b/qapi-schema.json
> > @@ -2920,6 +2920,18 @@
> >             }
> >   }
> >   
> > +##
> > +# @NVDIMMDeviceInfo:
> > +#
> > +# NVDIMMDevice state information
> > +#
> > +# Since: 2.12
> > +##
> > +{ 'struct': 'NVDIMMDeviceInfo',
> > +  'base': 'PCDIMMDeviceInfo',
> > +  'data': {}
> > +}  
> 
> You added no data, so why did you need the type?
> 
> > +
> >   ##
> >   # @MemoryDeviceInfo:
> >   #
> > @@ -2927,7 +2939,11 @@
> >   #
> >   # Since: 2.1
> >   ##
> > -{ 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
> > +{ 'union': 'MemoryDeviceInfo',
> > +  'data': { 'dimm': 'PCDIMMDeviceInfo',
> > +            'nvdimm': 'NVDIMMDeviceInfo'  
> 
> Names aren't part of the interface; would it be better to rename 
> PCDIMMDeviceInfo into something that can be generically shared between 
> both the 'dimm' and 'nvdimm' branches without having to create a 
> pointless subtype?
Currently we are lying on query-memory-devices and reporting nvdimm
devices as pcdimm (I haven't noticed it when nvdimms were introduced),
this patch fixes it so it will be clear what type of device is used where.

Later we can extend data{} section with nvdimm specific info as needed.

The second goal of this patch (well, the actual reason I've asked for it),
is to reuse qmp_pc_dimm_device_list() internally in QEMU to get
list of dimm based memory devices, instead of creating yet another
API to do that for internal usage.

  parent reply	other threads:[~2018-03-06 12:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-05  6:57 [Qemu-devel] [PATCH v3 0/5] hw/acpi-build: build SRAT memory affinity structures for DIMM devices Haozhong Zhang
2018-03-05  6:57 ` [Qemu-devel] [PATCH v3 1/5] pc-dimm: refactor qmp_pc_dimm_device_list Haozhong Zhang
2018-03-07 10:10   ` Igor Mammedov
2018-03-05  6:57 ` [Qemu-devel] [PATCH v3 2/5] qmp: distinguish PC-DIMM and NVDIMM in MemoryDeviceInfoList Haozhong Zhang
2018-03-05 19:14   ` Eric Blake
2018-03-06  0:24     ` Haozhong Zhang
2018-03-06 12:34     ` Igor Mammedov [this message]
2018-03-07 10:21   ` Igor Mammedov
2018-03-05  6:57 ` [Qemu-devel] [PATCH v3 3/5] hw/acpi-build: build SRAT memory affinity structures for DIMM devices Haozhong Zhang
2018-03-07 10:30   ` Igor Mammedov
2018-03-05  6:57 ` [Qemu-devel] [PATCH v3 4/5] tests/bios-tables-test: allow setting extra machine options Haozhong Zhang
2018-03-07 10:40   ` Igor Mammedov
2018-03-05  6:57 ` [Qemu-devel] [PATCH v3 5/5] tests/bios-tables-test: add test cases for DIMM proximity Haozhong Zhang
2018-03-07 12:02   ` 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=20180306133427.565a7c81@redhat.com \
    --to=imammedo@redhat.com \
    --cc=armbru@redhat.com \
    --cc=dan.j.williams@intel.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=haozhong.zhang@intel.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@redhat.com \
    --cc=xiaoguangrong.eric@gmail.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).