Re: [PATCH] osdict, libosinfo: use "minimum" resources when "recommended" is missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christophe Fergeau <cfergeau@xxxxxxxxxx> writes:

> 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 <gscrivan@xxxxxxxxxx>
>> ---
>>  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?

yes, I've changed them after your feedback.


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

thanks, I'll wait a bit more for comments and push it later.

Regards,
Giuseppe

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux