aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenstore/xs.c
diff options
context:
space:
mode:
authorIan Jackson <Ian.Jackson@eu.citrix.com>2010-07-06 11:57:20 +0100
committerIan Jackson <Ian.Jackson@eu.citrix.com>2010-07-06 11:57:20 +0100
commit2157eba42a40fd8d18b8870f9a9073c41d21fb5f (patch)
treee3975fe56e67bad37e7a42fddac5c2e6db9abb36 /tools/xenstore/xs.c
parentf2402d342d95bd0cdfabeb28a9510761ad0f7e89 (diff)
downloadxen-2157eba42a40fd8d18b8870f9a9073c41d21fb5f.tar.gz
xen-2157eba42a40fd8d18b8870f9a9073c41d21fb5f.tar.bz2
xen-2157eba42a40fd8d18b8870f9a9073c41d21fb5f.zip
tools/xenstore: add XS_RESTRICT operation to C xenstore client libs.
The OCaml xenstored supports the XS_RESTRICT operation, which deprivileges a dom0 xenstore connection so it can only affect one domain's entries. Add the relevant definitions to the C libraries so that callers can use it. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Diffstat (limited to 'tools/xenstore/xs.c')
-rw-r--r--tools/xenstore/xs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c
index 094db25efa..3441656039 100644
--- a/tools/xenstore/xs.c
+++ b/tools/xenstore/xs.c
@@ -615,6 +615,14 @@ unwind:
return false;
}
+bool xs_restrict(struct xs_handle *h, unsigned domid)
+{
+ char buf[16];
+
+ sprintf(buf, "%d", domid);
+ return xs_bool(xs_single(h, XBT_NULL, XS_RESTRICT, buf, NULL));
+}
+
/* Watch a node for changes (poll on fd to detect, or call read_watch()).
* When the node (or any child) changes, fd will become readable.
* Token is returned when watch is read, to allow matching.