[libvirt] [PATCH v2 1/2] Introduce new VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR event

Michal Privoznik mprivozn at redhat.com
Tue Nov 6 18:23:15 UTC 2012


This is supposed to be thrown every time we need to pause domain
because of API execution (e.g. qemuDomainSaveInternal) but fails
to restore it back after. In this case, domain remains paused,
however, none of existing reasons can fit this scenario.
---
 examples/domain-events/events-c/event-test.c       |    3 +++
 examples/domain-events/events-python/event-test.py |    2 +-
 include/libvirt/libvirt.h.in                       |    1 +
 3 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/examples/domain-events/events-c/event-test.c b/examples/domain-events/events-c/event-test.c
index 39bea49..ee324b3 100644
--- a/examples/domain-events/events-c/event-test.c
+++ b/examples/domain-events/events-c/event-test.c
@@ -149,6 +149,9 @@ static const char *eventDetailToString(int event, int detail) {
             case VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT:
                 ret = "Snapshot";
                 break;
+            case VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR:
+                ret = "Api error";
+                break;
             }
             break;
         case VIR_DOMAIN_EVENT_RESUMED:
diff --git a/examples/domain-events/events-python/event-test.py b/examples/domain-events/events-python/event-test.py
index 2bb5195..cd9e2b4 100644
--- a/examples/domain-events/events-python/event-test.py
+++ b/examples/domain-events/events-python/event-test.py
@@ -445,7 +445,7 @@ def detailToString(event, detail):
         ( "Added", "Updated" ),
         ( "Removed", ),
         ( "Booted", "Migrated", "Restored", "Snapshot", "Wakeup" ),
-        ( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot" ),
+        ( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot", "Api error" ),
         ( "Unpaused", "Migrated", "Snapshot" ),
         ( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"),
         ( "Finished", ),
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index fe58c08..bf584a0 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -3159,6 +3159,7 @@ typedef enum {
     VIR_DOMAIN_EVENT_SUSPENDED_WATCHDOG = 3,  /* Suspended due to a watchdog firing */
     VIR_DOMAIN_EVENT_SUSPENDED_RESTORED = 4,  /* Restored from paused state file */
     VIR_DOMAIN_EVENT_SUSPENDED_FROM_SNAPSHOT = 5, /* Restored from paused snapshot */
+    VIR_DOMAIN_EVENT_SUSPENDED_API_ERROR = 6, /* suspended after failure during libvirt API call */
 
 #ifdef VIR_ENUM_SENTINELS
     VIR_DOMAIN_EVENT_SUSPENDED_LAST
-- 
1.7.8.6




More information about the libvir-list mailing list