From 487c0633819b52590baa0084bf14769a3beebfaf 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". --- include/libvirt/libvirt.h.in | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include') diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index a9a15e1f7..caf5085b9 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -3718,6 +3718,24 @@ typedef void (*virConnectDomainEventPMWakeupCallback)(virConnectPtr conn, int reason, void *opaque); +/** + * virConnectDomainEventPMSuspendCallback: + * @conn: connection object + * @dom: domain on which the event occurred + * @reason: reason why the callback was called, unused currently, + * always passes 0 + * @opaque: application specified data + * + * This callback occurs when the guest is waken up. + * + * The callback signature to use when registering for an event of type + * VIR_DOMAIN_EVENT_ID_PMSuspend with virConnectDomainEventRegisterAny() + */ +typedef void (*virConnectDomainEventPMSuspendCallback)(virConnectPtr conn, + virDomainPtr dom, + int reason, + void *opaque); + /** * VIR_DOMAIN_EVENT_CALLBACK: * @@ -3740,6 +3758,7 @@ typedef enum { VIR_DOMAIN_EVENT_ID_DISK_CHANGE = 9, /* virConnectDomainEventDiskChangeCallback */ VIR_DOMAIN_EVENT_ID_TRAY_CHANGE = 10, /* virConnectDomainEventTrayChangeCallback */ VIR_DOMAIN_EVENT_ID_PMWAKEUP = 11, /* virConnectDomainEventPMWakeupCallback */ + VIR_DOMAIN_EVENT_ID_PMSUSPEND = 12, /* virConnectDomainEventPMSuspendCallback */ #ifdef VIR_ENUM_SENTINELS /* -- cgit v1.2.3-65-gdbad