aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/domain.c
diff options
context:
space:
mode:
authorKeir Fraser <keir@xen.org>2011-02-07 09:51:33 +0000
committerKeir Fraser <keir@xen.org>2011-02-07 09:51:33 +0000
commit78f17e33f3ca8f6d509595165729a8f3a1210322 (patch)
tree3c32ef8450e523f927903357134e745a7388c752 /xen/common/domain.c
parentcb6e62fc9962ed9f77dd6d9ed45a9f152a3a7b7b (diff)
downloadxen-78f17e33f3ca8f6d509595165729a8f3a1210322.tar.gz
xen-78f17e33f3ca8f6d509595165729a8f3a1210322.tar.bz2
xen-78f17e33f3ca8f6d509595165729a8f3a1210322.zip
Introduce rcu_lock_remote_target_domain_by_id().
Signed-off-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/common/domain.c')
-rw-r--r--xen/common/domain.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 02327d1e9f..b8c48a7ab0 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -438,6 +438,20 @@ int rcu_lock_target_domain_by_id(domid_t dom, struct domain **d)
return 0;
}
+int rcu_lock_remote_target_domain_by_id(domid_t dom, struct domain **d)
+{
+ if ( (*d = rcu_lock_domain_by_id(dom)) == NULL )
+ return -ESRCH;
+
+ if ( (*d == current->domain) || !IS_PRIV_FOR(current->domain, *d) )
+ {
+ rcu_unlock_domain(*d);
+ return -EPERM;
+ }
+
+ return 0;
+}
+
int domain_kill(struct domain *d)
{
int rc = 0;