Change in vdsm[master]: lib: apply weakmethod also to virConnect objects

fromani at redhat.com fromani at redhat.com
Fri Jan 15 11:23:27 UTC 2016


Francesco Romani has uploaded a new change for review.

Change subject: lib: apply weakmethod also to virConnect objects
......................................................................

lib: apply weakmethod also to virConnect objects

There is no evidence we leak virConnect objects,
and they are also used much more sparingly
than virDomain objects.
Yet, we used to wrap them in the same clumsy
and leaky way, so this patch makes use of
weakmethod for virConnects as well, in order
to avoid any leak in this case.

Change-Id: I520208b6ab7c3cb23b1fcdc5bc7196242b713d1e
Bug-Url: https://bugzilla.redhat.com/1283999
Bug-Url: https://bugzilla.redhat.com/1269424
Backport-To: 3.6
Backport-To: 3.5
Signed-off-by: Francesco Romani <fromani at redhat.com>
---
M lib/vdsm/libvirtconnection.py
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/85/51885/1

diff --git a/lib/vdsm/libvirtconnection.py b/lib/vdsm/libvirtconnection.py
index 927c4fb..6e522f4 100644
--- a/lib/vdsm/libvirtconnection.py
+++ b/lib/vdsm/libvirtconnection.py
@@ -167,7 +167,8 @@
             for name in dir(libvirt.virConnect):
                 method = getattr(conn, name)
                 if callable(method) and name[0] != '_':
-                    setattr(conn, name, wrapMethod(method))
+                    setattr(conn, name,
+                            wrapMethod(utils.weakmethod(method)))
             if target is not None:
                 for ev in (libvirt.VIR_DOMAIN_EVENT_ID_LIFECYCLE,
                            libvirt.VIR_DOMAIN_EVENT_ID_REBOOT,


-- 
To view, visit https://gerrit.ovirt.org/51885
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I520208b6ab7c3cb23b1fcdc5bc7196242b713d1e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani at redhat.com>


More information about the vdsm-patches mailing list