diff options
author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-19 15:28:34 +0000 |
---|---|---|
committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2007-01-19 15:28:34 +0000 |
commit | b686a7d235163cb2309bb59dcab07059e0fe9aa1 (patch) | |
tree | a33f8798a09c55ce0b30e2c14bfa20d2f6f7cc65 /tools/xenstore/xenstored_domain.c | |
parent | e105919b0120a0eccfe59ece2ce545ddd6f0881f (diff) | |
download | xen-b686a7d235163cb2309bb59dcab07059e0fe9aa1.tar.gz xen-b686a7d235163cb2309bb59dcab07059e0fe9aa1.tar.bz2 xen-b686a7d235163cb2309bb59dcab07059e0fe9aa1.zip |
xenstore: add XS_RESUME command; export it to xend.
This clears the shutdown flag for a domain in xenstore, allowing
subsequent shutdowns of the same domain to fire the appropriate
watches.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
Diffstat (limited to 'tools/xenstore/xenstored_domain.c')
-rw-r--r-- | tools/xenstore/xenstored_domain.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tools/xenstore/xenstored_domain.c b/tools/xenstore/xenstored_domain.c index 75ff6e96d8..115a1f75da 100644 --- a/tools/xenstore/xenstored_domain.c +++ b/tools/xenstore/xenstored_domain.c @@ -395,6 +395,43 @@ void do_release(struct connection *conn, const char *domid_str) 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; |