[libvirt] [PATCH 00/11] Resolution to various Coverity warnings

John Ferlan jferlan at redhat.com
Tue Feb 5 22:43:06 UTC 2013


On 01/30/2013 02:36 PM, John Ferlan wrote:
> I upgraded to a new version of Coverity last night (6.5.1) since I was
> informed it resolved the BAD_SIZEOF errors from the TRACE macros. A majority 
> were resolved, except for 3 which just required a couple of changes to avoid.
> 
> Since I was down to only a few warnings I tried ratcheting up the
> analysis "aggressiveness-level" from the default of low to medium
> and high. There many false positives out of those, but I did manage
> to find a few more leaks and a missing error check in openvz_driver.c.
> 
> After this series only a couple of warnings exist in the tests area;
> however, I've seen IRC chatter on vircommand.c and commandtest.c, so
> I'll patiently wait on that. There are some warnings in a couple of
> gnulib modules as well as /usr/include/bits/stdio2.h.
> 
> John Ferlan (11):
>   tlscontext: Make sure to get proper pointer to name
>   keepalive: Resolve Coverity complaint
>   storage: Resolve resource leaks with cmd processing
>   network: Remove conditional settings to resolve resource leak
>   parallels: Need to free memory on error path
>   openvz: Need to error check openvzDomainSetVcpusFlagsInternal()
>   uml: If need to requery, then VIR_FREE(res)
>   rpc: Need to virCommandFree on error path
>   lxc: Need to call usbFreeDevice()
>   qemu_cgroup: Need to call usbFreeDevice()
>   qemu_hotplug: Need to call usbFreeDevice()
> 
>  src/lxc/lxc_cgroup.c               |  8 +++++---
>  src/network/bridge_driver.c        |  9 +++------
>  src/openvz/openvz_driver.c         |  9 +++++++--
>  src/parallels/parallels_utils.c    |  4 +++-
>  src/qemu/qemu_cgroup.c             |  6 ++++--
>  src/qemu/qemu_hotplug.c            |  7 +++++--
>  src/rpc/virkeepalive.c             | 14 +++++++-------
>  src/rpc/virnetsocket.c             |  1 +
>  src/rpc/virnettlscontext.c         |  8 +++++---
>  src/storage/storage_backend_disk.c | 28 +++++++++++++++-------------
>  src/uml/uml_driver.c               |  3 ++-
>  11 files changed, 57 insertions(+), 40 deletions(-)
> 

With Dan Berrange's changes:

https://www.redhat.com/archives/libvir-list/2013-February/msg00021.html

My 9/11 and 10/11 were no longer necessary.  The 11/11 changes
(qemu_hotplug.c) still apply, but were changed to use the new
virUSBDeviceFree() rather than the previous usbFreeDevice().

Other changes 1/11, 4/11, 6/11, & 7/11 were made as requested.

I rebuilt, retested, and pushed.

John




More information about the libvir-list mailing list