[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 08/11] numa: Extend the command-line to provi
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCH v4 08/11] numa: Extend the command-line to provide memory latency and bandwidth information |
Date: |
Thu, 6 Jun 2019 18:50:40 +0200 |
On Thu, 6 Jun 2019 08:23:47 -0500
Eric Blake <address@hidden> wrote:
> On 6/6/19 2:47 AM, Tao Xu wrote:
> > On 6/5/2019 10:40 PM, Igor Mammedov wrote:
> >> On Wed, 8 May 2019 14:17:23 +0800
> >> Tao Xu <address@hidden> wrote:
> >>
> >>> From: Liu Jingqi <address@hidden>
> >>>
> >>> Add -numa hmat-lb option to provide System Locality Latency and
> >>> Bandwidth Information. These memory attributes help to build
> >>> System Locality Latency and Bandwidth Information Structure(s)
> >>> in ACPI Heterogeneous Memory Attribute Table (HMAT).
> >>>
> >>> Signed-off-by: Liu Jingqi <address@hidden>
> >>> Signed-off-by: Tao Xu <address@hidden>
> >>> ---
> > ...
> >>> +##
> >>> +{ 'struct': 'NumaHmatLBOptions',
> >>> + 'data': {
> >>> + 'initiator': 'uint16',
> >>> + 'target': 'uint16',
> >>> + 'hierarchy': 'HmatLBMemoryHierarchy',
> >>> + 'data-type': 'HmatLBDataType',
> >> I think union will be better here with data-type used as discriminator,
> >> on top of that you'll be able to drop a bit of error checking above since
> >> QAPI's union will not allow user to mix latency and bandwidth.
> >>
> > Hi Igor,
> >
> > I have quesion here, the 'hmat-lb' is a member of a union 'NumaOptions',
> > it seems can' use a union as a member of union.
>
> It should be technically possible to expand the QAPI generators to allow
> one union as a branch within another union, so long as there are no
> collisions in identifiers, if that makes for the smartest on-the-wire
> representation.
It would save quite a bit of boiler plate error checking in numa code,
but since I don't know much about QAPI to make meaningful suggestion
how to implement it, I won't insist on using union.