[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Allow interdomain channels to bind DOMID_SELF to DOMID_SELF.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID eea0e77b768350bd98038dd7260af2ce86b51c36
# Parent  76a413a8eef04505632ccd18cdf78001dfacc73b
Allow interdomain channels to bind DOMID_SELF to DOMID_SELF.
Signed-off-by: Steve King <steven.r.king@xxxxxxxxx>

diff -r 76a413a8eef0 -r eea0e77b7683 xen/common/event_channel.c
--- a/xen/common/event_channel.c        Tue Oct 18 09:53:30 2005
+++ b/xen/common/event_channel.c        Tue Oct 18 10:04:48 2005
@@ -89,7 +89,8 @@
     chn = evtchn_from_port(d, port);
 
     chn->state = ECS_UNBOUND;
-    chn->u.unbound.remote_domid = alloc->remote_dom;
+    if ( (chn->u.unbound.remote_domid = alloc->remote_dom) == DOMID_SELF )
+        chn->u.unbound.remote_domid = current->domain->domain_id;
 
     alloc->port = port;
 
@@ -107,9 +108,13 @@
     struct evtchn *lchn, *rchn;
     struct domain *ld = current->domain, *rd;
     int            lport, rport = bind->remote_port;
+    domid_t        rdom = bind->remote_dom;
     long           rc = 0;
 
-    if ( (rd = find_domain_by_id(bind->remote_dom)) == NULL )
+    if ( rdom == DOMID_SELF )
+        rdom = current->domain->domain_id;
+
+    if ( (rd = find_domain_by_id(rdom)) == NULL )
         return -ESRCH;
 
     /* Avoid deadlock by first acquiring lock of domain with smaller id. */
diff -r 76a413a8eef0 -r eea0e77b7683 xen/include/public/event_channel.h
--- a/xen/include/public/event_channel.h        Tue Oct 18 09:53:30 2005
+++ b/xen/include/public/event_channel.h        Tue Oct 18 10:04:48 2005
@@ -15,6 +15,7 @@
  * is allocated in <dom> and returned as <port>.
  * NOTES:
  *  1. If the caller is unprivileged then <dom> must be DOMID_SELF.
+ *  2. <rdom> may be DOMID_SELF, allowing loopback connections.
  */
 #define EVTCHNOP_alloc_unbound    6
 typedef struct evtchn_alloc_unbound {
@@ -30,6 +31,8 @@
  * a port that is unbound and marked as accepting bindings from the calling
  * domain. A fresh port is allocated in the calling domain and returned as
  * <local_port>.
+ * NOTES:
+ *  2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
  */
 #define EVTCHNOP_bind_interdomain 0
 typedef struct evtchn_bind_interdomain {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.