WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] During suspend, return immediately with a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] During suspend, return immediately with a failure if the domain will
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 26 Jan 2007 05:35:09 -0800
Delivery-date: Fri, 26 Jan 2007 05:35:42 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] During suspend, return immediately with a failure if the domain will, Xen patchbot-unstable <=