Bug 220094

Summary: xendDomainCreateLinux leaks a reference count in virDomainPtr object
Product: Red Hat Enterprise Linux 5 Reporter: Daniel Berrangé <berrange>
Component: libvirtAssignee: Daniel Veillard <veillard>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-0.2.3 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-20 19:44:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Remove duplicated called to virDomainLookupByID to eliminate ref count leak none

Description Daniel Berrangé 2006-12-18 21:54:58 UTC
Description of problem:
The xendDomainCreateLinux  does two calls to 

    dom = virDomainLookupByName(conn, name);

Each call to virDomainLookupByName increments the reference count on the
virDomainPtr object. So, upon returning from virDomainCreateLinux, the caller
has a virDomainPtr object with a reference count of '2' instead of the expected
'1'. The result is the virDomainPtr object will never be freed

Version-Release number of selected component (if applicable):
libvirt-0.1.8

How reproducible:
Always

Steps to Reproduce:
1. Run a program which calls virDomainCreateLinux under GDB
2. Stop execution immediately after virDomainCreateLinux returns
3. Examine the reference count of the returned virDomainPtr object
  
Actual results:
Ref count of 2

Expected results:
Ref count of 1

Additional info:

Comment 1 Daniel Berrangé 2006-12-18 21:54:58 UTC
Created attachment 143946 [details]
Remove duplicated called to virDomainLookupByID to eliminate ref count leak

Comment 2 Daniel Veillard 2006-12-18 22:10:25 UTC
Dohh, fix applied upstream, at this point,

Daniel

Comment 3 Stephen Tweedie 2007-03-13 18:51:45 UTC
Is this important enough to merit being merged back to RHEL-5?

Comment 4 Daniel Veillard 2007-03-13 21:00:47 UTC
If we push a new libvirt this should definitely be included.
I'm not 100% this affected virt-manager as shipped, if yes
or if we push a new virt-manager, then a new libvirt should be
done in my opinion.

Daniel

Comment 5 Daniel Veillard 2007-06-20 19:44:53 UTC
Package for RHEL5 update 1 will fix this,

Daniel