[PATCH 1/7] event: Add transition reason for PMSUSPENDED state from snapshot ops

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

 



Add event reason to support transitions to PM suspended state from
snapshot revert operations.
---
 examples/object-events/event-test.c | 3 +++
 include/libvirt/libvirt.h.in        | 3 +++
 tools/virsh-domain.c                | 3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/object-events/event-test.c b/examples/object-events/event-test.c
index 2a5a83b..84c878e 100644
--- a/examples/object-events/event-test.c
+++ b/examples/object-events/event-test.c
@@ -210,6 +210,9 @@ static const char *eventDetailToString(int event, int detail) {
             case VIR_DOMAIN_EVENT_PMSUSPENDED_DISK:
                 ret = "Disk";
                 break;
+            case VIR_DOMAIN_EVENT_PMSUSPENDED_FROM_SNAPSHOT:
+                ret = "Snapshot";
+                break;
             }
             break;
         case VIR_DOMAIN_EVENT_CRASHED:
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index ad6785f..af339f2 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -3693,6 +3693,9 @@ typedef enum {
 typedef enum {
     VIR_DOMAIN_EVENT_PMSUSPENDED_MEMORY = 0, /* Guest was PM suspended to memory */
     VIR_DOMAIN_EVENT_PMSUSPENDED_DISK = 1, /* Guest was PM suspended to disk */
+    VIR_DOMAIN_EVENT_PMSUSPENDED_FROM_SNAPSHOT = 2, /* Guest changed state to
+                                                       PM suspended due to
+                                                       snapshot operation */

 #ifdef VIR_ENUM_SENTINELS
     VIR_DOMAIN_EVENT_PMSUSPENDED_LAST
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index ba47258..cade830 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10686,7 +10686,8 @@ VIR_ENUM_DECL(vshDomainEventPMSuspended)
 VIR_ENUM_IMPL(vshDomainEventPMSuspended,
               VIR_DOMAIN_EVENT_PMSUSPENDED_LAST,
               N_("Memory"),
-              N_("Disk"))
+              N_("Disk"),
+              N_("Snapshot"))

 VIR_ENUM_DECL(vshDomainEventCrashed)
 VIR_ENUM_IMPL(vshDomainEventCrashed,
-- 
2.0.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]