return none(result);
}
+#define xspy_resume_domain_doc "\n" \
+ "Tell xenstore to clear its shutdown flag for a domain.\n" \
+ "This ensures that a subsequent shutdown will fire the\n" \
+ "appropriate watches.\n" \
+ " dom [int]: domain id\n" \
+ "\n" \
+ "Returns None on success.\n" \
+ "Raises xen.lowlevel.xs.Error on error.\n"
+
+static PyObject *xspy_resume_domain(XsHandle *self, PyObject *args)
+{
+ uint32_t dom;
+
+ struct xs_handle *xh = xshandle(self);
+ bool result = 0;
+
+ if (!xh)
+ return NULL;
+ if (!PyArg_ParseTuple(args, "i", &dom))
+ return NULL;
+
+ Py_BEGIN_ALLOW_THREADS
+ result = xs_resume_domain(xh, dom);
+ Py_END_ALLOW_THREADS
+
+ return none(result);
+}
#define xspy_release_domain_doc "\n" \
"Tell xenstore to release its channel to a domain.\n" \
XSPY_METH(transaction_start, METH_NOARGS),
XSPY_METH(transaction_end, METH_VARARGS | METH_KEYWORDS),
XSPY_METH(introduce_domain, METH_VARARGS),
+ XSPY_METH(resume_domain, METH_VARARGS),
XSPY_METH(release_domain, METH_VARARGS),
XSPY_METH(close, METH_NOARGS),
XSPY_METH(get_domain_path, METH_VARARGS),
from xen.xend.XendError import XendError, VmError
from xen.xend.XendDevices import XendDevices
from xen.xend.xenstore.xstransact import xstransact, complete
-from xen.xend.xenstore.xsutil import GetDomainPath, IntroduceDomain
+from xen.xend.xenstore.xsutil import GetDomainPath, IntroduceDomain, ResumeDomain
from xen.xend.xenstore.xswatch import xswatch
from xen.xend.XendConstants import *
from xen.xend.XendAPIConstants import *
try:
if self.domid is not None:
xc.domain_resume(self.domid)
+ ResumeDomain(self.domid)
except:
log.exception("XendDomainInfo.resume: xc.domain_resume failed on domain %s." % (str(self.domid)))
def GetDomainPath(domid):
return xshandle().get_domain_path(domid)
+
+def ResumeDomain(domid):
+ return xshandle().resume_domain(domid)
case XS_WATCH_EVENT: return "WATCH_EVENT";
case XS_ERROR: return "ERROR";
case XS_IS_DOMAIN_INTRODUCED: return "XS_IS_DOMAIN_INTRODUCED";
+ case XS_RESUME: return "RESUME";
default:
return "**UNKNOWN**";
}
do_get_domain_path(conn, onearg(in));
break;
+ case XS_RESUME:
+ do_resume(conn, onearg(in));
+ break;
+
default:
eprintf("Client unknown operation %i", in->hdr.msg.type);
send_error(conn, ENOSYS);
send_ack(conn, XS_RELEASE);
}
+void do_resume(struct connection *conn, const char *domid_str)
+{
+ struct domain *domain;
+ unsigned int domid;
+
+ if (!domid_str) {
+ send_error(conn, EINVAL);
+ return;
+ }
+
+ domid = atoi(domid_str);
+ if (!domid) {
+ send_error(conn, EINVAL);
+ return;
+ }
+
+ if (conn->id != 0) {
+ send_error(conn, EACCES);
+ return;
+ }
+
+ domain = find_domain_by_domid(domid);
+ if (!domain) {
+ send_error(conn, ENOENT);
+ return;
+ }
+
+ if (!domain->conn) {
+ send_error(conn, EINVAL);
+ return;
+ }
+
+ domain->shutdown = 0;
+
+ send_ack(conn, XS_RESUME);
+}
+
void do_get_domain_path(struct connection *conn, const char *domid_str)
{
char *path;
/* domid */
void do_release(struct connection *conn, const char *domid_str);
+/* domid */
+void do_resume(struct connection *conn, const char *domid_str);
+
/* domid */
void do_get_domain_path(struct connection *conn, const char *domid_str);
return xs_bool(single_with_domid(h, XS_RELEASE, domid));
}
+/* clear the shutdown bit for the given domain */
+bool xs_resume_domain(struct xs_handle *h, unsigned int domid)
+{
+ return xs_bool(single_with_domid(h, XS_RESUME, domid));
+}
+
char *xs_get_domain_path(struct xs_handle *h, unsigned int domid)
{
char domid_str[MAX_STRLEN(domid)];
unsigned int domid,
unsigned long mfn,
unsigned int eventchn);
+/* Resume a domain.
+ * Clear the shutdown flag for this domain in the store.
+ */
+bool xs_resume_domain(struct xs_handle *h, unsigned int domid);
+
/* Release a domain.
* Tells the store domain to release the memory page to the domain.
*/