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

Philipp Hahn posted 1 patch 6 years ago
Failed in applying to current master (apply log)
examples/event-test.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[libvirt] [PATCH libvirt-python] event-test.py: Report ERROR events
Posted by Philipp Hahn 6 years ago
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@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

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH libvirt-python] event-test.py: Report ERROR events
Posted by Michal Privoznik 6 years ago
On 11/01/2018 11:20 AM, Philipp Hahn wrote:
> 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@univention.de>
> ---
>  examples/event-test.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

ACKed and pushed.

Michal

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