1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-11-25 12:23:48 +03:00

Fix use of virDomainEventRegister in python bindings

If an app used the virDomainEventRegister binding instead
of the virDomainEventRegisterAny binding, it would never
have its callback invoked. This is because the code for
dispatching from the C libvirt_virConnectDomainEventCallback
method was totally fubar.

If DEBUG macro was set in the python build the error would
become visible

  "libvirt_virConnectDomainEventCallback dom_class is not a class!"

The code in libvirt_virConnectDomainEventCallback was
inexplicably complex and has apparently never worked. The
fix is to write it the same way as the other callback handlers.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange
2013-12-03 15:24:17 +00:00
parent 9d9e2513c0
commit 7f842365b1
2 changed files with 6 additions and 60 deletions

View File

@@ -38,7 +38,7 @@
"""
try:
for cb,opaque in self.domainEventCallbacks.items():
cb(self,dom,event,detail,opaque)
cb(self, virDomain(self, _obj=dom), event, detail, opaque)
return 0
except AttributeError:
pass