Export resumedomain domctl to libxc, xend.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
}
+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,
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
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,
"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,
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
#
}
break;
+ case XEN_DOMCTL_resumedomain:
+ {
+ struct domain *d = find_domain_by_id(op->domain);
+ struct vcpu *v;
+
+ ret = -ESRCH;
+ if ( d != NULL )
+ {
+ ret = 0;
+ if ( test_and_clear_bit(_DOMF_shutdown, &d->domain_flags) )
+ for_each_vcpu ( d, v )
+ vcpu_wake(v);
+ put_domain(d);
+ }
+ }
+ break;
+
case XEN_DOMCTL_createdomain:
{
struct domain *d;
#define XEN_DOMCTL_destroydomain 2
#define XEN_DOMCTL_pausedomain 3
#define XEN_DOMCTL_unpausedomain 4
+#define XEN_DOMCTL_resumedomain 27
#define XEN_DOMCTL_getdomaininfo 5
struct xen_domctl_getdomaininfo {