libxl: fix leaking libxlDomainObjPrivate
libxl: fix leaking libxlDomainObjPrivate

When libxl registers an FD with the libxl driver, the refcnt of the
associated libxlDomainObjPrivate object is incremented. The refcnt
is decremented when libxl deregisters the FD.  But some FDs are only
deregistered when their libxl ctx is freed, which unfortunately is
done in the libxlDomainObjPrivate dispose function.  With references
held by the FDs, libxlDomainObjPrivate is never disposed.

I added the ref/unref in FD registration/deregistration when adding
the same in timer registration/deregistration.  For timers, this
is a simple approach to ensuring the libxlDomainObjPrivate is not
disposed prior to their expirtation, which libxl guarantees will
occur.  It is not needed for FDs, and only causes
libxlDomainObjPrivate to leak.

This patch removes the reference on libxlDomainObjPrivate for FD
registrations, but retains them for timer registrations.  Tested on
the latest releases of Xen supported by the libxl driver:  4.2.3,
4.3.1, and 4.4.0 RC3.

Signed-off-by: Jim Fehlig <39929b5b86d72d51fceac59b52303e3fe8a3083e@suse.com>

shugaoye/libvirt,jardasgit/libvirt,elmarco/libvirt,elmarco/libvirt,taget/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,agx/libvirt,datto/libvirt,zippy2/libvirt,datto/libvirt,libvirt/libvirt,rlaager/libvirt,datto/libvirt,nertpinx/libvirt,libvirt/libvirt,jardasgit/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,VenkatDatta/libvirt,datto/libvirt,jfehlig/libvirt,VenkatDatta/libvirt,rlaager/libvirt,nertpinx/libvirt,eskultety/libvirt,crobinso/libvirt,olafhering/libvirt,eskultety/libvirt,eskultety/libvirt,VenkatDatta/libvirt,libvirt/libvirt,taget/libvirt,shugaoye/libvirt,agx/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,crobinso/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,olafhering/libvirt,zippy2/libvirt,rlaager/libvirt,shugaoye/libvirt,zippy2/libvirt,olafhering/libvirt,elmarco/libvirt,nertpinx/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,shugaoye/libvirt,agx/libvirt,agx/libvirt,nertpinx/libvirt,elmarco/libvirt,jfehlig/libvirt,elmarco/libvirt,zippy2/libvirt,libvirt/libvirt,taget/libvirt,taget/libvirt,rlaager/libvirt,eskultety/libvirt,taget/libvirt,rlaager/libvirt,agx/libvirt,andreabolognani/libvirt,olafhering/libvirt,VenkatDatta/libvirt,crobinso/libvirt,jardasgit/libvirt,shugaoye/libvirt,crobinso/libvirt,jfehlig/libvirt,eskultety/libvirt,fabianfreyer/libvirt,datto/libvirt,jardasgit/libvirt