Re: [libvirt] [PATCH 0/6] Fix some Coverity issues

2015-10-01 Thread Jim Fehlig

On 09/23/2015 05:18 PM, John Ferlan wrote:

Newer Coverity (7.7.0) found a couple real issues and a few more
false positives. There's still a few more to be resolved, but still
trying to figure them out...

libxlDomainMigrationPrepare - claim is args is leaked. Although
 it seems to be handled in libxlMigrateReceive or libxlDoMigrateReceive.
 Don't know the code well enough to do proper triage.


args is a subclass of virObject. It is freed when refcnt reaches zero and the 
dispose function is called.


args is created (refcnt=1) in libxlDomainMigrationPrepare() and added to the 
virNetSocket IO callback. When the sender connects, the callback invokes 
libxlMigrateReceive() passing args. libxlMigrateReceive() starts a thread to 
receive the migration data (avoids blocking the event loop while receiving the 
migration data :-)), passing args to the thread start function, 
libxlDoMigrateReceive(). args is unref'ed in libxlMigrateReceive() if there are 
any failures, otherwise args is unref'ed in libxlDoMigrateReceive().


Regards,
Jim

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


[libvirt] [PATCH 0/6] Fix some Coverity issues

2015-09-23 Thread John Ferlan
Newer Coverity (7.7.0) found a couple real issues and a few more
false positives. There's still a few more to be resolved, but still
trying to figure them out...

libxlDomainMigrationPrepare - claim is args is leaked. Although
it seems to be handled in libxlMigrateReceive or libxlDoMigrateReceive.
Don't know the code well enough to do proper triage.

qemuProcessStop - claim is usage of net->ifname in the condition
(vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)
is using a NULL net->ifname that would have been VIR_FREE()'d
when case VIR_DOMAIN_NET_TYPE_DIRECT a few lines above.

qemuDomainBlockRebase - claim is overwriting 'dest' after call to
   qemuDomainBlockCopyCommon causes resource leak.  Although reading
   code says otherwise, except of course if CopyCommon goes to cleanup
   rather than endjob.  Even changing the location doesn't resolve
   the issue.

Fix the Coverity tag for the DEADCODE... It's always a coin-flip either
dead_error_begin or dead_error_condition - I gave Jiri bad advice as
to which one to use it seems.

John Ferlan (6):
  Avoid Coverity FORWARD_NULL prior to strtok_r calls
  tests: Resolve Coverity RESOURCE_LEAK
  tests: Resolve Coverity RESOURCE_LEAK
  virsh: Resolve Coverity DEADCODE
  qemu: Resolve Coverity CHECKED_RETURN
  qemu: Resolve Coverity RESOURCE_LEAK

 src/esx/esx_vi.c  |  1 +
 src/libxl/libxl_conf.c|  1 +
 src/openvz/openvz_conf.c  |  2 ++
 src/qemu/qemu_driver.c| 24 +++-
 src/qemu/qemu_process.c   |  6 +++---
 src/xenapi/xenapi_utils.c |  1 +
 tests/qemucaps2xmltest.c  |  1 +
 tests/virnetdaemontest.c  |  2 ++
 tools/virsh.c |  2 +-
 9 files changed, 23 insertions(+), 17 deletions(-)

-- 
2.1.0

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