Re: [libvirt] [PATCH] examples: If parameters count is zero we have nothing to do

2016-07-12 Thread Michal Privoznik
On 12.07.2016 13:49, Marc Hartmayer wrote: > On Sat, Jul 09, 2016 at 11:02 AM +0200, Michal Privoznik > wrote: >> On 06.07.2016 15:47, Marc Hartmayer wrote: >>> The virDomainGetCPUStats() API contract permits nparams == >>> 0. print_cpu_usage() assumes nparams > 0 because

Re: [libvirt] [PATCH] examples: If parameters count is zero we have nothing to do

2016-07-12 Thread Marc Hartmayer
On Sat, Jul 09, 2016 at 11:02 AM +0200, Michal Privoznik wrote: > On 06.07.2016 15:47, Marc Hartmayer wrote: >> The virDomainGetCPUStats() API contract permits nparams == >> 0. print_cpu_usage() assumes nparams > 0 because the domtop example >> application isn't very useful

Re: [libvirt] [PATCH] examples: If parameters count is zero we have nothing to do

2016-07-09 Thread Michal Privoznik
On 06.07.2016 15:47, Marc Hartmayer wrote: > The virDomainGetCPUStats() API contract permits nparams == > 0. print_cpu_usage() assumes nparams > 0 because the domtop example > application isn't very useful if there are no statistics. Explicitly > error out to avoid potentially using the local

[libvirt] [PATCH] examples: If parameters count is zero we have nothing to do

2016-07-06 Thread Marc Hartmayer
The virDomainGetCPUStats() API contract permits nparams == 0. print_cpu_usage() assumes nparams > 0 because the domtop example application isn't very useful if there are no statistics. Explicitly error out to avoid potentially using the local variable pos uninitialized. Reviewed-by: Boris