[PATCH v4 0/3] libxl smbios support

Jason Andryuk posted 3 patches 1 year, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230306204024.124882-1-jandryuk@gmail.com
Test gitlab-ci failed
docs/man/xl.cfg.5.pod.in             | 49 +++++++++++++++++++
tools/golang/xenlight/gengotypes.py  | 41 +++++++++-------
tools/golang/xenlight/helpers.gen.go | 51 ++++++++++++++++++++
tools/golang/xenlight/types.gen.go   | 28 +++++++++++
tools/include/libxl.h                |  5 ++
tools/libs/light/libxl_dom.c         | 33 +++++++++++++
tools/libs/light/libxl_types.idl     | 27 +++++++++++
tools/xl/xl_parse.c                  | 71 +++++++++++++++++++++++++++-
8 files changed, 288 insertions(+), 17 deletions(-)
[PATCH v4 0/3] libxl smbios support
Posted by Jason Andryuk 1 year, 8 months ago
hvm_xs_strings.h specifies xenstore entries which can be used to set or
override smbios strings.  hvmloader has support for reading them, but
xl/libxl support is not wired up.  This patches adds a new xl.cfg option
and libxl support to write the xenstore strings.

The xl syntax looks like:
smbios=["bios_vendor=Xen Project","system_version=1.0"]

The Go binding generation needed extending to support Arrays inside a
KeyedUnion, which is what the first patch does.  The generated go code
builds, but it is otherwise untested.

There are also oem strings, oem-1..oem-99, that HVM loader supports.
xl parse multiple oem strings like smbios=["oem=A,oem=B"], libxl then
iterates over them and assigned to the oem-%d entries.  Both xl and
libxl check that the 99 string limit isn't exceeded.

The rendered man page and html don't have a newline at the end of the
new section after patch 2.
"""
           battery_device_name=STRING
       ms_vm_genid="OPTION"
"""

however the txt format is correct:
"""
        battery_device_name=STRING

    ms_vm_genid="OPTION"
"""

It goes away after patch 3 is applied since it adds text about the "oem"
option in between the two lines above.  I'm at a loss as to why this is
happening.

v4 is a rebase and resend of v3.

Jason Andryuk (3):
  golang/xenlight: Extend KeyedUnion to support Arrays
  xl/libxl: Add ability to specify SMBIOS strings
  xl/libxl: Add OEM string support to smbios

 docs/man/xl.cfg.5.pod.in             | 49 +++++++++++++++++++
 tools/golang/xenlight/gengotypes.py  | 41 +++++++++-------
 tools/golang/xenlight/helpers.gen.go | 51 ++++++++++++++++++++
 tools/golang/xenlight/types.gen.go   | 28 +++++++++++
 tools/include/libxl.h                |  5 ++
 tools/libs/light/libxl_dom.c         | 33 +++++++++++++
 tools/libs/light/libxl_types.idl     | 27 +++++++++++
 tools/xl/xl_parse.c                  | 71 +++++++++++++++++++++++++++-
 8 files changed, 288 insertions(+), 17 deletions(-)

-- 
2.39.2
Re: [PATCH v4 0/3] libxl smbios support
Posted by Jan Beulich 1 year, 8 months ago
On 06.03.2023 21:40, Jason Andryuk wrote:
> hvm_xs_strings.h specifies xenstore entries which can be used to set or
> override smbios strings.  hvmloader has support for reading them, but
> xl/libxl support is not wired up.  This patches adds a new xl.cfg option
> and libxl support to write the xenstore strings.
> 
> The xl syntax looks like:
> smbios=["bios_vendor=Xen Project","system_version=1.0"]
> 
> The Go binding generation needed extending to support Arrays inside a
> KeyedUnion, which is what the first patch does.  The generated go code
> builds, but it is otherwise untested.
> 
> There are also oem strings, oem-1..oem-99, that HVM loader supports.
> xl parse multiple oem strings like smbios=["oem=A,oem=B"], libxl then
> iterates over them and assigned to the oem-%d entries.  Both xl and
> libxl check that the 99 string limit isn't exceeded.
> 
> The rendered man page and html don't have a newline at the end of the
> new section after patch 2.
> """
>            battery_device_name=STRING
>        ms_vm_genid="OPTION"
> """
> 
> however the txt format is correct:
> """
>         battery_device_name=STRING
> 
>     ms_vm_genid="OPTION"
> """
> 
> It goes away after patch 3 is applied since it adds text about the "oem"
> option in between the two lines above.  I'm at a loss as to why this is
> happening.
> 
> v4 is a rebase and resend of v3.
> 
> Jason Andryuk (3):
>   golang/xenlight: Extend KeyedUnion to support Arrays
>   xl/libxl: Add ability to specify SMBIOS strings
>   xl/libxl: Add OEM string support to smbios
> 
>  docs/man/xl.cfg.5.pod.in             | 49 +++++++++++++++++++
>  tools/golang/xenlight/gengotypes.py  | 41 +++++++++-------
>  tools/golang/xenlight/helpers.gen.go | 51 ++++++++++++++++++++
>  tools/golang/xenlight/types.gen.go   | 28 +++++++++++
>  tools/include/libxl.h                |  5 ++
>  tools/libs/light/libxl_dom.c         | 33 +++++++++++++
>  tools/libs/light/libxl_types.idl     | 27 +++++++++++
>  tools/xl/xl_parse.c                  | 71 +++++++++++++++++++++++++++-
>  8 files changed, 288 insertions(+), 17 deletions(-)

Is this work something that's worth mentioning in CHANGELOG.md?

Jan
Re: [PATCH v4 0/3] libxl smbios support
Posted by Andrew Cooper 1 year, 8 months ago
On 16/03/2023 7:53 am, Jan Beulich wrote:
> On 06.03.2023 21:40, Jason Andryuk wrote:
>> hvm_xs_strings.h specifies xenstore entries which can be used to set or
>> override smbios strings.  hvmloader has support for reading them, but
>> xl/libxl support is not wired up.  This patches adds a new xl.cfg option
>> and libxl support to write the xenstore strings.
>>
>> The xl syntax looks like:
>> smbios=["bios_vendor=Xen Project","system_version=1.0"]
>>
>> The Go binding generation needed extending to support Arrays inside a
>> KeyedUnion, which is what the first patch does.  The generated go code
>> builds, but it is otherwise untested.
>>
>> There are also oem strings, oem-1..oem-99, that HVM loader supports.
>> xl parse multiple oem strings like smbios=["oem=A,oem=B"], libxl then
>> iterates over them and assigned to the oem-%d entries.  Both xl and
>> libxl check that the 99 string limit isn't exceeded.
>>
>> The rendered man page and html don't have a newline at the end of the
>> new section after patch 2.
>> """
>>            battery_device_name=STRING
>>        ms_vm_genid="OPTION"
>> """
>>
>> however the txt format is correct:
>> """
>>         battery_device_name=STRING
>>
>>     ms_vm_genid="OPTION"
>> """
>>
>> It goes away after patch 3 is applied since it adds text about the "oem"
>> option in between the two lines above.  I'm at a loss as to why this is
>> happening.
>>
>> v4 is a rebase and resend of v3.
>>
>> Jason Andryuk (3):
>>   golang/xenlight: Extend KeyedUnion to support Arrays
>>   xl/libxl: Add ability to specify SMBIOS strings
>>   xl/libxl: Add OEM string support to smbios
>>
>>  docs/man/xl.cfg.5.pod.in             | 49 +++++++++++++++++++
>>  tools/golang/xenlight/gengotypes.py  | 41 +++++++++-------
>>  tools/golang/xenlight/helpers.gen.go | 51 ++++++++++++++++++++
>>  tools/golang/xenlight/types.gen.go   | 28 +++++++++++
>>  tools/include/libxl.h                |  5 ++
>>  tools/libs/light/libxl_dom.c         | 33 +++++++++++++
>>  tools/libs/light/libxl_types.idl     | 27 +++++++++++
>>  tools/xl/xl_parse.c                  | 71 +++++++++++++++++++++++++++-
>>  8 files changed, 288 insertions(+), 17 deletions(-)
> Is this work something that's worth mentioning in CHANGELOG.md?

Yes.  Thanks for remembering - I'd forgotten.

~Andrew

Re: [PATCH v4 0/3] libxl smbios support
Posted by Jason Andryuk 1 year, 8 months ago
On Thu, Mar 16, 2023 at 3:53 AM Jan Beulich <jbeulich@suse.com> wrote:
> Is this work something that's worth mentioning in CHANGELOG.md?

Sure, I'll add an entry.

Thanks,
Jason
Re: [PATCH v4 0/3] libxl smbios support
Posted by George Dunlap 1 year, 8 months ago
On Mon, Mar 6, 2023 at 8:40 PM Jason Andryuk <jandryuk@gmail.com> wrote:

> hvm_xs_strings.h specifies xenstore entries which can be used to set or
> override smbios strings.  hvmloader has support for reading them, but
> xl/libxl support is not wired up.  This patches adds a new xl.cfg option
> and libxl support to write the xenstore strings.
>
> The xl syntax looks like:
> smbios=["bios_vendor=Xen Project","system_version=1.0"]
>
> The Go binding generation needed extending to support Arrays inside a
> KeyedUnion, which is what the first patch does.  The generated go code
> builds, but it is otherwise untested.
>

The python & generated code looks good to me.

Golang bits:
Acked-by: George Dunlap <george.dunlap@citrix.com>

>
>