From: Chris Subject: [PATCH] fixes for suspend & resume Date: Tue, 21 Nov 2006 16:45:13 -0500 Message-ID: <45637369.4040007@tycho.ncsc.mil> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000607070204090705070807" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------000607070204090705070807 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 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 --------------000607070204090705070807 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="suspend-resume.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="suspend-resume.patch" 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, --------------000607070204090705070807 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------000607070204090705070807--