aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-01-19 15:23:41 +0000
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-01-19 15:23:41 +0000
commite105919b0120a0eccfe59ece2ce545ddd6f0881f (patch)
tree216cb735cbd311c4e62840e37c64763f2f0960a3 /tools
parent6b23fd229a317c9504cd19968329597f8f149e7e (diff)
downloadxen-e105919b0120a0eccfe59ece2ce545ddd6f0881f.tar.gz
xen-e105919b0120a0eccfe59ece2ce545ddd6f0881f.tar.bz2
xen-e105919b0120a0eccfe59ece2ce545ddd6f0881f.zip
Add resumedomain domctl to resume a domain after checkpoint.
Export resumedomain domctl to libxc, xend. Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
Diffstat (limited to 'tools')
-rw-r--r--tools/libxc/xc_domain.c10
-rw-r--r--tools/libxc/xenctrl.h12
-rw-r--r--tools/python/xen/lowlevel/xc/xc.c11
-rw-r--r--tools/python/xen/xend/XendDomainInfo.py9
4 files changed, 42 insertions, 0 deletions
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 9a156ebba4..98e909d0a3 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -89,6 +89,16 @@ int xc_domain_shutdown(int xc_handle,
}
+int xc_domain_resume(int xc_handle,
+ uint32_t domid)
+{
+ DECLARE_DOMCTL;
+ domctl.cmd = XEN_DOMCTL_resumedomain;
+ domctl.domain = (domid_t)domid;
+ return do_domctl(xc_handle, &domctl);
+}
+
+
int xc_vcpu_setaffinity(int xc_handle,
uint32_t domid,
int vcpu,
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index a5df681e3e..715764ac6e 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -236,6 +236,18 @@ int xc_domain_unpause(int xc_handle,
int xc_domain_destroy(int xc_handle,
uint32_t domid);
+
+/**
+ * This function resumes a suspended domain. The domain should have
+ * been previously suspended.
+ *
+ * @parm xc_handle a handle to an open hypervisor interface
+ * @parm domid the domain id to resume
+ * return 0 on success, -1 on failure
+ */
+int xc_domain_resume(int xc_handle,
+ uint32_t domid);
+
/**
* This function will shutdown a domain. This is intended for use in
* fully-virtualized domains where this operation is analogous to the
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index fb6ee675d9..a95b7d9bf8 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -174,6 +174,10 @@ static PyObject *pyxc_domain_shutdown(XcObject *self, PyObject *args)
return zero;
}
+static PyObject *pyxc_domain_resume(XcObject *self, PyObject *args)
+{
+ return dom_op(self, args, xc_domain_resume);
+}
static PyObject *pyxc_vcpu_setaffinity(XcObject *self,
PyObject *args,
@@ -1042,6 +1046,13 @@ static PyMethodDef pyxc_methods[] = {
"Destroy a domain.\n"
" dom [int]: Identifier of domain to be destroyed.\n\n"
"Returns: [int] 0 on success; -1 on error.\n" },
+
+ { "domain_resume",
+ (PyCFunction)pyxc_domain_resume,
+ METH_VARARGS, "\n"
+ "Resume execution of a suspended domain.\n"
+ " dom [int]: Identifier of domain to be resumed.\n\n"
+ "Returns: [int] 0 on success; -1 on error.\n" },
{ "domain_shutdown",
(PyCFunction)pyxc_domain_shutdown,
diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py
index 27cba0049c..087ff0e5aa 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -1539,6 +1539,15 @@ class XendDomainInfo:
self.cleanupDomain()
+ def resumeDomain(self):
+ log.debug("XendDomainInfo.resumeDomain(%s)", str(self.domid))
+
+ try:
+ if self.domid is not None:
+ xc.domain_resume(self.domid)
+ except:
+ log.exception("XendDomainInfo.resume: xc.domain_resume failed on domain %s." % (str(self.domid)))
+
#
# Channels for xenstore and console
#