mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-03 08:21:58 +03:00
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".
This commit is contained in:
@ -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 """
|
||||
|
Reference in New Issue
Block a user