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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user