[virt-tools-list] [PATCH] osdict, libosinfo: use "minimum" resources when "recommended" is missing

Christophe Fergeau cfergeau at redhat.com
Fri Sep 12 12:06:51 UTC 2014


On Fri, Sep 12, 2014 at 10:52:19AM +0200, Giuseppe Scrivano wrote:
> Some OS entries in libosinfo miss the "recommended" resources block.
> In this case use the "minimum" resources when available.
> 
> Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
> ---
>  virtinst/osdict.py | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/virtinst/osdict.py b/virtinst/osdict.py
> index 9e48270..88010ad 100644
> --- a/virtinst/osdict.py
> +++ b/virtinst/osdict.py
> @@ -446,6 +446,11 @@ class _OsVariant(_OsVariantType):
>                      ret["storage"] = r.get_storage()
>                      break
>  
> +        # libosinfo may miss the recommended resources block for some OS,
> +        # in this case read first the minimum resources (if present)
> +        # and use them.
> +        read_resource(self._os.get_minimum_resources(), "all")
> +        read_resource(self._os.get_minimum_resources(), arch)

Maybe better to scale these minimum resources by X% to try to have
something which is not too constrained?

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140912/2a05277f/attachment.sig>


More information about the virt-tools-list mailing list