From 7f842365b192a514be30512c4f96abdbef9702a0 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 3 Dec 2013 15:24:17 +0000 Subject: 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 --- libvirt-override-virConnect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libvirt-override-virConnect.py') diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py index 23fadfd..0beaf9c 100644 --- a/libvirt-override-virConnect.py +++ b/libvirt-override-virConnect.py @@ -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 -- cgit v1.2.1