[Kimchi-devel] [PATCH] Update host number of cpus and total physical memory information

Aline Manera alinefm at linux.vnet.ibm.com
Mon Mar 23 14:06:21 UTC 2015



On 23/03/2015 10:31, Jose Ricardo Ziviani wrote:
> >> +    def _update_host_info(self, host_info):
> >> +        if not isinstance(host_info, dict):
> >> +            return
> >> +
> >> +        host_info['cpus'] = psutil._psplatform.get_num_cpus()
> >> +        host_info['memory'] = psutil.phymem_usage().total
> >> +
> >
> >_get_host_info() runs once on __init__() and then set the 
> self.host_info value
> >
> >So I don't think we need the above function as we can update the
> >self.host_info directly on lookup()
>
> You prefer these codes:
> host_info['cpus'] = psutil._psplatform.get_num_cpus()
> host_info['memory'] = psutil.phymem_usage().total
>
> placed in lookup() only?
> So, in_get_host_info() I'd have those fields (cpus, memory) 
> initialized like:
> res['cpus'] = 0
> res['memory'] = 0L
>
> What do you think?
>

+1

> Thank you
>
> _______________________________________________
> Kimchi-devel mailing list
> Kimchi-devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/kimchi-devel
>




More information about the Kimchi-devel mailing list