From dc2f75d35a6461c896a738d092dc973067d0dbd4 Mon Sep 17 00:00:00 2001 From: Osier Yang Date: Fri, 23 Mar 2012 22:50:36 +0800 Subject: Add support for the suspend event This patch introduces a new event type for the QMP event SUSPEND: VIR_DOMAIN_EVENT_ID_PMSUSPEND The event doesn't take any data, but considering there might be reason for wakeup in future, the callback definition is: typedef void (*virConnectDomainEventSuspendCallback)(virConnectPtr conn, virDomainPtr dom, int reason, void *opaque); "reason" is unused currently, always passes "0". --- libvirt-override-virConnect.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libvirt-override-virConnect.py') diff --git a/libvirt-override-virConnect.py b/libvirt-override-virConnect.py index 2d48828..811e16b 100644 --- a/libvirt-override-virConnect.py +++ b/libvirt-override-virConnect.py @@ -152,6 +152,15 @@ cb(self, virDomain(self, _obj=dom), reason, opaque) return 0; + def _dispatchDomainEventPMSuspendCallback(self, dom, reason, cbData): + """Dispatches event to python user domain pmsuspend 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 domain callback will disable delivery of this event type """ -- cgit