aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Denemark <jdenemar@redhat.com>2012-09-06 17:00:43 +0200
committerJiri Denemark <jdenemar@redhat.com>2012-09-07 09:38:22 +0200
commitfc4115e8d693635d5569e01b432a9cde03341f0c (patch)
tree422dbc7151c9b87b3f3b0083be675fac4d6f82b7 /examples
parentFix PMSuspend and PMWakeup events (diff)
downloadlibvirt-fc4115e8d693635d5569e01b432a9cde03341f0c.tar.gz
libvirt-fc4115e8d693635d5569e01b432a9cde03341f0c.tar.bz2
libvirt-fc4115e8d693635d5569e01b432a9cde03341f0c.zip
Add PMSUSPENDED life cycle event
While PMSUSPENDED state was added a long time ago, we didn't have corresponding life cycle event.
Diffstat (limited to 'examples')
-rw-r--r--examples/domain-events/events-c/event-test.c10
-rw-r--r--examples/domain-events/events-python/event-test.py4
2 files changed, 13 insertions, 1 deletions
diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c
index fc4d5750d..cde60fb8a 100644
--- a/examples/domain-events/events-c/event-test.c
+++ b/examples/domain-events/events-c/event-test.c
@@ -90,6 +90,9 @@ const char *eventToString(int event) {
case VIR_DOMAIN_EVENT_SHUTDOWN:
ret = "Shutdown";
break;
+ case VIR_DOMAIN_EVENT_PMSUSPENDED:
+ ret = "PMSuspended";
+ break;
}
return ret;
}
@@ -193,6 +196,13 @@ static const char *eventDetailToString(int event, int detail) {
break;
}
break;
+ case VIR_DOMAIN_EVENT_PMSUSPENDED:
+ switch ((virDomainEventPMSuspendedDetailType) detail) {
+ case VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY:
+ ret = "Memory";
+ break;
+ }
+ break;
}
return ret;
}
diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py
index e3b6ed276..fd71acd21 100644
--- a/examples/domain-events/events-python/event-test.py
+++ b/examples/domain-events/events-python/event-test.py
@@ -436,7 +436,8 @@ def eventToString(event):
"Suspended",
"Resumed",
"Stopped",
- "Shutdown" );
+ "Shutdown",
+ "PMSuspended" );
return eventStrings[event];
def detailToString(event, detail):
@@ -448,6 +449,7 @@ def detailToString(event, detail):
( "Unpaused", "Migrated", "Snapshot" ),
( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"),
( "Finished" )
+ ( "Memory", )
)
return eventStrings[event][detail]