Re: [PATCHv3 3/4] Simplify linuxNodeGetCPUStats

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

 



On 01/28/2014 08:50 AM, Ján Tomko wrote:
> On 01/27/2014 05:16 PM, Eric Blake wrote:
>> On 01/22/2014 06:37 AM, Ján Tomko wrote:
>>> Split out the repetitive code.
>>> ---
>>>  src/nodeinfo.c | 77 +++++++++++++++++++++++-----------------------------------
>>>  1 file changed, 30 insertions(+), 47 deletions(-)
>>>
>>
>> ACK.
>>
>>
>>> @@ -722,51 +734,22 @@ linuxNodeGetCPUStats(FILE *procstat,
>>>                  continue;
>>>              }
>>>  
>>> -            for (i = 0; i < *nparams; i++) {
>>> -                virNodeCPUStatsPtr param = &params[i];
>>
>> The old loop terminates early if *nparams < 4.
>>
> 
> We can't get there with *nparams != 4:
>      if ((*nparams) != LINUX_NB_CPU_STATS) {
>          virReportInvalidArg(*nparams,
>                              _("nparams in %s must be equal to %d"),
>                              __FUNCTION__, LINUX_NB_CPU_STATS);
>          goto cleanup;
>      }
> 

I've pushed this along with 4/3.

Jan

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]