Change in vdsm[master]: vmfex hook: hold a ref for a virDomain object
danken at redhat.com
danken at redhat.com
Mon Feb 8 09:51:24 UTC 2016
Dan Kenigsberg has submitted this change and it was merged.
Change subject: vmfex hook: hold a ref for a virDomain object
......................................................................
vmfex hook: hold a ref for a virDomain object
commit 93feb1c introduced a weakref to virDomain object to avoid
reference cycles. This causes a surprising behaviour: if we do not hold
a reference to virdomain.Notifying, the underlying virDomain is
garbage-collected before being accessed for the first time.
This patch quickly holds a named reference to the domain. I did not find
other pieces of code with the same problem, however, the mechanism seems
dangerously error-prone.
This bug is easily reproduced with
from vdsm import libvirtconnection
c = libvirtconnection.get()
print(c.lookupByName('my-vm').XMLDesc(0))
and "solved" by
from vdsm import libvirtconnection
c = libvirtconnection.get()
v = c.lookupByName('my-vm')
print(v.XMLDesc(0))
Change-Id: Ida7488db5f8af51da5a2931d8b8a6c51d99c36f0
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1305338
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/53160
Continuous-Integration: Jenkins CI
Reviewed-by: Francesco Romani <fromani at redhat.com>
---
M vdsm_hooks/vmfex_dev/vmfex_vnic.py
1 file changed, 4 insertions(+), 2 deletions(-)
Approvals:
Jenkins CI: Passed CI tests
Dan Kenigsberg: Verified
Francesco Romani: Looks good to me, approved
--
To view, visit https://gerrit.ovirt.org/53160
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ida7488db5f8af51da5a2931d8b8a6c51d99c36f0
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Anonymous Coward #1001177
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dan Yasny <dyasny at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
More information about the vdsm-patches
mailing list