Skip to contentSkip to conversation

During suspend, return immediately with a failure if the domain will never

PATCH In review [email protected] 2 participants 2 messages Jan 24, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 During suspend, return immediately with a failure if the domain will never

# HG changeset patch
# User [email protected]
# Date 1169670529 28800
# Node ID 14fb98867856742513b4241612889209925d2bd0
# Parent f546aae09c9e5ebc5b496642a86a2d2a5fd0f108
During suspend, return immediately with a failure if the domain will never suspend, instead of pointlessly retrying.

tools/libxc/xc_linux_save.c +24 -3
@@ -378,8 +378,29 @@ static int suspend_and_state(int (*suspe
         ERROR("Could not get vcpu context");
 
 
-    if (info->shutdown && info->shutdown_reason == SHUTDOWN_suspend)
-        return 0; // success
+    if (info->dying) {
+        ERROR("domain is dying");
+        return -1;
+    }
+
+    if (info->crashed) {
+        ERROR("domain has crashed");
+        return -1;
+    }
+
+    if (info->shutdown) {
+        switch (info->shutdown_reason) {
+        case SHUTDOWN_poweroff:
+        case SHUTDOWN_reboot:
+            ERROR("domain has shut down");
+            return -1;
+        case SHUTDOWN_suspend:
+            return 0;
+        case SHUTDOWN_crash:
+            ERROR("domain has crashed");
+            return -1;
+        }
+    }
 
     if (info->paused) {
         // try unpausing domain, wait, and retest
@@ -393,7 +414,7 @@ static int suspend_and_state(int (*suspe
 
 
     if( ++i < 100 ) {
-        ERROR("Retry suspend domain.");
+        ERROR("Retry suspend domain");
         usleep(10000);  // 10ms
         goto retry;
     }
#1 lore raw
Quoted 2 lines · On Wed, Jan 24, 2007 at 01:01:13PM -0700, [email protected] wrote:

During suspend, return immediately with a failure if the domain will never suspend, instead of pointlessly retrying.

This helps a little bit in transparency, but is still stuck due to xc_save/restore. I know this has been discussed before, but is there a good continuing reason for this not to be part of xend? I have never seen them actually crash as far as I remember.

regards
john