[PATCH 17/18] event-test: Add VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON

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

 



When adding the static check I've noticed that one other event is
missing.
---
 examples/object-events/event-test.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c
index 1d8c4b1..7ec85a2 100644
--- a/examples/object-events/event-test.c
+++ b/examples/object-events/event-test.c
@@ -432,6 +432,24 @@ myDomainEventIOErrorCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
 }


+static int
+myDomainEventIOErrorReasonCallback(virConnectPtr conn ATTRIBUTE_UNUSED,
+                                   virDomainPtr dom,
+                                   const char *srcPath,
+                                   const char *devAlias,
+                                   int action,
+                                   const char *reason,
+                                   void *opaque ATTRIBUTE_UNUSED)
+{
+    printf("%s EVENT: Domain %s(%d) io error (reason) path=%s alias=%s "
+           "action=%d reason=%s\n",
+           __func__, virDomainGetName(dom), virDomainGetID(dom),
+           srcPath, devAlias, action, reason);
+
+    return 0;
+}
+
+
 static const char *
 graphicsPhaseToStr(int phase)
 {
@@ -851,6 +869,7 @@ struct domainEventData domainEvents[] = {
     DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_WATCHDOG, myDomainEventWatchdogCallback),
     DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_IO_ERROR, myDomainEventIOErrorCallback),
     DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_GRAPHICS, myDomainEventGraphicsCallback),
+    DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON, myDomainEventIOErrorReasonCallback),
     DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_CONTROL_ERROR, myDomainEventControlErrorCallback),
     DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_BLOCK_JOB, myDomainEventBlockJobCallback),
     DOMAIN_EVENT(VIR_DOMAIN_EVENT_ID_DISK_CHANGE, myDomainEventDiskChangeCallback),
-- 
2.8.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]