This patch adds an event to be raised if a PM suspended guest is
restored from a snapshot.
---
examples/domain-events/events-c/event-test.c | 3 +++
include/libvirt/libvirt.h.in | 2 ++
2 files changed, 5 insertions(+)
diff --git a/examples/domain-events/events-c/event-test.c
b/examples/domain-events/events-c/event-test.c
index 39bea49..f0e3fde 100644
--- a/examples/domain-events/events-c/event-test.c
+++ b/examples/domain-events/events-c/event-test.c
@@ -204,6 +204,9 @@ static const char *eventDetailToString(int event, int detail) {
case VIR_DOMAIN_EVENT_PMSUSPENDED_DISK:
ret = "Disk";
break;
+ case VIR_DOMAIN_EVENT_PMSUSPENDED_FROM_SNAPSHOT:
+ ret = "from snapshot";
+ break;
}
break;
}
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index ec03e4f..91cae71 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -3124,6 +3124,8 @@ typedef enum {
typedef enum {
VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY = 0, /* Guest was PM suspended to memory */
VIR_DOMAIN_EVENT_PMSUSPENDED_DISK = 1, /* Guest was PM suspended to disk */
+ VIR_DOMAIN_EVENT_PMSUSPENDED_FROM_SNAPSHOT = 2, /* Snapshot of a machine
+ in S3/S4 was reverted */
#ifdef VIR_ENUM_SENTINELS
VIR_DOMAIN_EVENT_PMSUSPENDED_LAST
--
1.7.12.4