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-devel

[Xen-devel] [PATCH] fixes for suspend & resume

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] fixes for suspend & resume
From: Chris <hap10@xxxxxxxxxxxxxx>
Date: Tue, 21 Nov 2006 16:45:13 -0500
Delivery-date: Tue, 21 Nov 2006 13:45:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.8 (Macintosh/20061025)
This patch does two things to improve the current condition of suspend
and resume:

1. Register 'xm resume' with the xm command line argument parser so the
corresponding xm_resume() function will be called.

2. Allow users to supply either a domain name, domid, or uuid to
identify the target of a suspend or resume operation (instead of how it
is now, where only a uuid will work).

Signed-off-by: Chris Bookholt <hap10@xxxxxxxxxxxxxx>



There's at least one additional problem (that this patch doesn't
address) effecting domains that are started, suspended, resumed, and
finally shutdown.  Affected domains remain in the xend's list of running
domains when instead they should revert back to a dormant state with
domid of -1.  A work around is to restart xend after the effected
domains have been shutdown, which causes the domains to correctly appear
as dormant, but clearly this restart shouldn't be necessary.

-Chris
diff -r 08007423788a tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Tue Nov 21 16:14:53 2006 +0000
+++ b/tools/python/xen/xend/XendDomain.py       Tue Nov 21 16:04:16 2006 -0500
@@ -751,11 +751,11 @@ class XendDomain:
             if dominfo.state != DOM_STATE_RUNNING:
                 raise XendError("Cannot suspend domain that is not running.")
 
-            if not os.path.exists(self._managed_config_path(domname)):
+            if not 
os.path.exists(self._managed_config_path(dominfo.get_uuid())):
                 raise XendError("Domain is not managed by Xend lifecycle " +
                                 "support.")
             
-            path = self._managed_check_point_path(domname)
+            path = self._managed_check_point_path(dominfo.get_uuid())
             fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
             try:
                 # For now we don't support 'live checkpoint' 
@@ -786,7 +786,7 @@ class XendDomain:
             if dominfo.state != DOM_STATE_HALTED:
                 raise XendError("Cannot suspend domain that is not running.")
 
-            chkpath = self._managed_check_point_path(domname)
+            chkpath = self._managed_check_point_path(dominfo.get_uuid())
             if not os.path.exists(chkpath):
                 raise XendError("Domain was not suspended by Xend")
 
diff -r 08007423788a tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Tue Nov 21 16:14:53 2006 +0000
+++ b/tools/python/xen/xm/main.py       Tue Nov 21 16:04:16 2006 -0500
@@ -1415,6 +1415,7 @@ commands = {
     "sysrq": xm_sysrq,
     "uptime": xm_uptime,
     "suspend": xm_suspend,
+    "resume": xm_resume,
     "list": xm_list,
     # memory commands
     "mem-max": xm_mem_max,
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel