[libvirt] [PATCH libvirt-python] event-test.py: Report ERROR events

Philipp Hahn hahn at univention.de
Thu Nov 1 10:20:40 UTC 2018


VIR_DOMAIN_EVENT_ID_IO_ERROR and VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON
callbacks receive the same 'action' parameter, so also translate that
numeric action to a descriptive text for the first callback.

Signed-off-by: Philipp Hahn <hahn at univention.de>
---
 examples/event-test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/event-test.py b/examples/event-test.py
index dabf4b0..709277b 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -526,8 +526,8 @@ def myDomainEventWatchdogCallback(conn, dom, action, opaque):
 
 
 def myDomainEventIOErrorCallback(conn, dom, srcpath, devalias, action, opaque):
-    print("myDomainEventIOErrorCallback: Domain %s(%s) %s %s %d" % (
-        dom.name(), dom.ID(), srcpath, devalias, action))
+    print("myDomainEventIOErrorCallback: Domain %s(%s) %s %s %s" % (
+        dom.name(), dom.ID(), srcpath, devalias, ERROR_EVENTS[action]))
 
 
 def myDomainEventIOErrorReasonCallback(conn, dom, srcpath, devalias, action, reason, opaque):
-- 
2.11.0




More information about the libvir-list mailing list