diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-01-23 13:22:13 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-01-23 13:22:13 +0000 |
commit | f9f9329313866cffe0e00524592cf765734d3a41 (patch) | |
tree | bb835a42f05839df1244295194b58900637e19fb /tools/xenstore/xs.c | |
parent | 47fcfcb75b5d5ece1bba1aeca8e2d99b0103d6c4 (diff) | |
download | xen-f9f9329313866cffe0e00524592cf765734d3a41.tar.gz xen-f9f9329313866cffe0e00524592cf765734d3a41.tar.bz2 xen-f9f9329313866cffe0e00524592cf765734d3a41.zip |
New XS_SET_TARGET
Stubdomains (and probably other domain disagregation elements too)
need to be able to tinker with another domain. This adds
XS_SET_TARGET so that XenStore allows domains to have permissions on
files on which the "target" has permissions. This also adds
xs_set_target, called by the domain builder when the 'target' option
is used in the configuration.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'tools/xenstore/xs.c')
-rw-r--r-- | tools/xenstore/xs.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c index a815257798..dbbf8ef394 100644 --- a/tools/xenstore/xs.c +++ b/tools/xenstore/xs.c @@ -708,6 +708,25 @@ bool xs_introduce_domain(struct xs_handle *h, ARRAY_SIZE(iov), NULL)); } +bool xs_set_target(struct xs_handle *h, + unsigned int domid, unsigned int target) +{ + char domid_str[MAX_STRLEN(domid)]; + char target_str[MAX_STRLEN(target)]; + struct iovec iov[2]; + + snprintf(domid_str, sizeof(domid_str), "%u", domid); + snprintf(target_str, sizeof(target_str), "%u", target); + + iov[0].iov_base = domid_str; + iov[0].iov_len = strlen(domid_str) + 1; + iov[1].iov_base = target_str; + iov[1].iov_len = strlen(target_str) + 1; + + return xs_bool(xs_talkv(h, XBT_NULL, XS_SET_TARGET, iov, + ARRAY_SIZE(iov), NULL)); +} + static void * single_with_domid(struct xs_handle *h, enum xsd_sockmsg_type type, unsigned int domid) |