[Libosinfo] [libosinfo PATCH 0/3] Add support for resources' inheritance

Fabiano Fidêncio fidencio at redhat.com
Tue Nov 13 07:07:08 UTC 2018


On Mon, 2018-11-12 at 15:07 +0100, Fabiano Fidêncio wrote:
> This patch set introduces resources' inheritance for OSes that
> derive-from/clone a device that already has its resources set.
> 
> While this patch doesn't cause any harm per si, from the moment we
> start
> removing the duplications we'll need a new libosinfo release with
> this
> code included.
> 
> https://gitlab.com/libosinfo/osinfo-db/issues/15
> 
> Fabiano Fidêncio (3):
>   os: Add _get_.*_resources_without_inheritance()
>   os: Add support for Resources inheritance
>   test-os: Add test_resources_inheritance()
> 
>  osinfo/Makefile.am                            |  1 +
>  osinfo/osinfo_os.c                            | 85 ++++++++++++++++-
>  osinfo/osinfo_os_private.h                    | 39 ++++++++
>  .../test-os-resources-inheritance-1.xml       | 25 +++++
>  .../test-os-resources-inheritance-2.xml       | 10 ++
>  tests/test-os.c                               | 91
> +++++++++++++++++++
>  6 files changed, 247 insertions(+), 4 deletions(-)
>  create mode 100644 osinfo/osinfo_os_private.h
>  create mode 100644 tests/dbdata/os/libosinfo.org/test-os-resources-
> inheritance-1.xml
>  create mode 100644 tests/dbdata/os/libosinfo.org/test-os-resources-
> inheritance-2.xml
> 

Apart from Pino's comments, I've also realized that we're not filling
values of a resource that was previous set (but it's not in this
version).

Example:

In os1, we have:
<resources arch="all">
  <minimum>
    <cpu>1000000000</cpu>
    <ram>1073741824</ram>
  </minimum>
</resources>

Is os2, which inherits the values from os1, we have:
<resources arch="all">
  <minimum>
    <n-cpus>2</cpu>
  </minimum>
</resources>

What I'd expect is that when querying for minimum CPU for os2 I'd get:
1000000000.

I'll cover this and Pino's comments and submit a v2.

Best Regards,
-- 
Fabiano Fidêncio




More information about the Libosinfo mailing list