From 29b16a45d77586672631537bfe877455fa5527ac Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Fri, 23 Mar 2012 22:43:14 +0800 Subject: Add support for the wakeup event This patch introduces a new event type for the QMP event WAKEUP: VIR_DOMAIN_EVENT_ID_PMWAKEUP The event doesn't take any data, but considering there might be reason for wakeup in future, the callback definition is: typedef void (*virConnectDomainEventWakeupCallback)(virConnectPtr conn, virDomainPtr dom, int reason, void *opaque); "reason" is unused currently, always passes "0". --- libvirt-override-virConnect.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libvirt-override-virConnect.py') diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py index 82c2437..2d48828 100644 --- a/libvirt-override-virConnect.py +++ b/libvirt-override-virConnect.py @@ -143,6 +143,14 @@ cb(self, virDomain(self, _obj=dom), devAlias, reason, opaque) return 0; + def _dispatchDomainEventPMWakeupCallback(self, dom, reason, cbData): + """Dispatches event to python user domain pmwakeup event callbacks + """ + cb = cbData["cb"] + opaque = cbData["opaque"] + + cb(self, virDomain(self, _obj=dom), reason, opaque) + return 0; def domainEventDeregisterAny(self, callbackID): """Removes a Domain Event Callback. De-registering for a -- cgit