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

[Xen-changelog] [xen-unstable] During suspend, return immediately with a failure if the domain will



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1169728225 0
# Node ID a9165141e52d4b2f8e9dccdefb8fb2a1c1e67dfe
# Parent  d6d27c649fd6d3fe57c34e525de48ff3588f80c6
During suspend, return immediately with a failure if the domain will
never suspend, instead of pointlessly retrying.

Signed-off-by: John Levon <john.levon@xxxxxxx>
---
 tools/libxc/xc_linux_save.c |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

diff -r d6d27c649fd6 -r a9165141e52d tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       Thu Jan 25 12:28:47 2007 +0000
+++ b/tools/libxc/xc_linux_save.c       Thu Jan 25 12:30:25 2007 +0000
@@ -379,8 +379,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
@@ -394,7 +415,7 @@ static int suspend_and_state(int (*suspe
 
 
     if( ++i < 100 ) {
-        ERROR("Retry suspend domain.");
+        ERROR("Retry suspend domain");
         usleep(10000);  // 10ms
         goto retry;
     }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.