[libvirt] [PATCH] Remove a completely bogus reference increment in the Xen driver.

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

 



xenUnifiedDomainEventRegister() calls out to
virDomainEventCallbackListAdd(), which increments the reference
count on the connection.  That is fine, but then
xenUnifiedDomainEventRegister() increments the usage count again,
leading to a usage count leak.  Remove the increment in the xen
register, and the UnrefConnect in the xen unregister.

Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
---
 src/xen/xen_driver.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 5273a11..f2744b0 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -1502,9 +1502,6 @@ xenUnifiedDomainEventRegister (virConnectPtr conn,
     ret = virDomainEventCallbackListAdd(conn, priv->domainEventCallbacks,
                                         callback, opaque, freefunc);
 
-    if (ret == 0)
-        conn->refs++;
-
     xenUnifiedUnlock(priv);
     return (ret);
 }
@@ -1530,9 +1527,6 @@ xenUnifiedDomainEventDeregister (virConnectPtr conn,
         ret = virDomainEventCallbackListRemove(conn, priv->domainEventCallbacks,
                                                callback);
 
-    if (ret == 0)
-        virUnrefConnect(conn);
-
     xenUnifiedUnlock(priv);
     return ret;
 }
-- 
1.6.0.6

--
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]