[PATCH libvirt-python v2 11/22] event-test.py: Convert WATCHDOG events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



to use new Description class

Signed-off-by: Philipp Hahn <hahn@xxxxxxxxxxxxx>
---
 examples/event-test.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/examples/event-test.py b/examples/event-test.py
index 46a8db8..004a263 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -494,6 +494,7 @@ DOM_EVENTS = Description(
 )
 BLOCK_JOB_TYPES = Description("unknown", "Pull", "Copy", "Commit", "ActiveCommit")
 BLOCK_JOB_STATUS = Description("Completed", "Failed", "Canceled", "Ready")
+WATCHDOG_ACTIONS = Description("none", "Pause", "Reset", "Poweroff", "Shutdown", "Debug", "Inject NMI")
 
 def agentLifecycleStateToString(state):
     agentStates = ( "unknown", "connected", "disconnected", )
@@ -515,8 +516,11 @@ def myDomainEventRebootCallback(conn, dom, opaque):
 def myDomainEventRTCChangeCallback(conn, dom, utcoffset, opaque):
     print("myDomainEventRTCChangeCallback: Domain %s(%s) %d" % (dom.name(), dom.ID(), utcoffset))
 
+
 def myDomainEventWatchdogCallback(conn, dom, action, opaque):
-    print("myDomainEventWatchdogCallback: Domain %s(%s) %d" % (dom.name(), dom.ID(), action))
+    print("myDomainEventWatchdogCallback: Domain %s(%s) %s" % (
+        dom.name(), dom.ID(), WATCHDOG_ACTIONS[action]))
+
 
 def myDomainEventIOErrorCallback(conn, dom, srcpath, devalias, action, opaque):
     print("myDomainEventIOErrorCallback: Domain %s(%s) %s %s %d" % (dom.name(), dom.ID(), srcpath, devalias, action))
-- 
2.11.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux