Re: [PATCH 2/9] virsh: Resolve Coverity NEGATIVE_RETURNS

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

 



On 09/11/2014 06:05 PM, John Ferlan wrote:
> Coverity notes that after we VIR_ALLOC_N(params, nparams) a failed call to
> virDomainGetCPUStats could result in nparams being set to -1. In that case,
> the subsequent virTypedParamsFree in cleanup will pass -1 which isn't good.
> 
> Use the returned value as the number of stats to display in the loop as
> it will be the value reported from the hypervisor and may be less than
> nparams which is OK
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  tools/virsh-domain.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

ACK

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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]