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
|