On Fri, Sep 12, 2014 at 05:50:15PM +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 <[email protected]>
> ---
>  virtinst/osdict.py | 22 ++++++++++++++++------
>  1 file changed, 16 insertions(+), 6 deletions(-)
> 
> diff --git a/virtinst/osdict.py b/virtinst/osdict.py
> index 9e48270..76794c3 100644
> --- a/virtinst/osdict.py
> +++ b/virtinst/osdict.py
> @@ -436,18 +436,28 @@ class _OsVariant(_OsVariantType):
>  
>      def get_recommended_resources(self, arch):
>          ret = {}
> -        def read_resource(resources, arch):
> +        def read_resource(resources, minimum, arch):
> +            # If we are reading the "minimum" block, allocate more
> +            # resources.
> +            ram_scale = minimum and 2 or 1
> +            n_cpus_scale = minimum and 2 or 1
> +            storage_scale = minimum and 2 or 1

I don't know if this is typical python, but I find this hard to read
(but I do python at most once per year, so this may be crystal clear to
people experienced with python :). I thought you had picked different
scaling factors for cpu/ram/storage?

Apart from these non-critical comments, looks good to me, ACK if I'm
allowed to give ACKs to virt-manager patches

Christophe

Attachment: pgpLr8JDREHFM.pgp
Description: PGP signature

_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list

Reply via email to