All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 4bef5e80 authored by Yathindra Naik's avatar Yathindra Naik

Dummy commit

parent 7450d0d6
......@@ -1014,6 +1014,19 @@ int libxl_domain_evtchn(libxl_ctx *ctx, libxl_capabilities *info, uint32_t domid
return -1;
}
if (xc_cap_grant(ctx->xch, domid, caps, 1))
{
printf("Granting caps failed\n");
return -1;
}
// Grant our evt_chn cap to the remote domain
caps = xc_evtchn_getcaps(ctx->xch, domid);
if (caps == NULL)
{
printf("Getcaps for domain %d returned NULL!\n",domid);
return -1;
}
if (xc_cap_grant(ctx->xch, remote_domain, caps, 1))
{
printf("Granting caps failed\n");
return -1;
......
......@@ -15,7 +15,7 @@
#include <xen/xmalloc.h>
#include <xen/sched.h>
#include <xen/paging.h>
#include <public/xen-cap.h>
#include "uthash.h"
/* Capability tokens are random numbers for now. This implementation is taken from wikipedia.
* Source: http://en.wikipedia.org/wiki/Multiply-with-carry
......
......@@ -85,7 +85,6 @@ static int cap_domain_create(struct domain *d, u32 ssidref)
d->cap_space = dom_cap_space;
d->cap_flag = 1;
/* Also, init est_evtchn - allowing other domains to est event channels with domain 0 */
#if 0
d->est_evtchn = xmalloc(struct capability);
if (d->est_evtchn == NULL)
{
......@@ -97,7 +96,6 @@ static int cap_domain_create(struct domain *d, u32 ssidref)
TT_ERR("Could not create cap for Dom0's est_evtchn\n");
return -1;
}
#endif
return rc;
}
else
......@@ -1562,10 +1560,10 @@ static int cap_evtchn_unbound (struct domain *d, struct evtchn *chn,
{
int ret = 0;
struct capability *cap;
// struct domain *remote_domain;
struct domain *remote_domain;
// if ( IS_PRIV(current->domain) )
// return 0;
if ( IS_PRIV(current->domain) )
return 0;
if( current->domain->domain_id > 100 )
{
TT_DBG("returning\n");
......@@ -1577,8 +1575,8 @@ static int cap_evtchn_unbound (struct domain *d, struct evtchn *chn,
TT_DBG("Remote is Self domain\n");
return 0;
}
// if ( current->domain->cap_flag == 0 || d->cap_flag == 0 )
// return 0;
if ( current->domain->cap_flag == 0 || d->cap_flag == 0 )
return 0;
TT_DBG("\n");
cap = &(CAP_BOOT_INFO->cap_hypercalls[46]);
......@@ -1593,15 +1591,14 @@ static int cap_evtchn_unbound (struct domain *d, struct evtchn *chn,
/* if the remote domain does not have caps
set then dont do anything. Simply return. */
#if 0
if (d->est_evtchn == NULL)
{
//TT_ERR("remote domain %d does not have est_evtchn\n",id2);
TT_ERR("remote domain %d does not have est_evtchn\n",id2);
return 0;
}
if ((remote_domain = get_domain_by_id(id2)) == NULL)
{
//TT_ERR("could not get remote domain %d\n",id2);
TT_ERR("could not get remote domain %d\n",id2);
return 1;
}
if (cap_check(remote_domain, d->est_evtchn) == 0)
......@@ -1609,7 +1606,6 @@ static int cap_evtchn_unbound (struct domain *d, struct evtchn *chn,
TT_ERR("remote domain %d does not have the cap to est evtchn\n",id2);
return 1;
}
#endif
return 0;
}
else
......@@ -1647,7 +1643,6 @@ static int cap_evtchn_interdomain (struct domain *d1, struct evtchn
/* if the remote domain does not have est_evtchn
set then simply return. */
#if 0
if (d2->est_evtchn == NULL)
{
//TT_ERR("remote domain %d est_evtchn is NULL\n",d2->domain_id);
......@@ -1658,7 +1653,6 @@ static int cap_evtchn_interdomain (struct domain *d1, struct evtchn
//TT_ERR("Not allowed to bind with remote domain %d\n",d2->domain_id);
return 1;
}
#endif
return 0;
}
else
......@@ -1673,7 +1667,7 @@ static int cap_evtchn_interdomain (struct domain *d1, struct evtchn
static int cap_evtchn_send (struct domain *d, struct evtchn *chn)
{
int ret = 0;
//struct domain *remote_domain = chn->u.interdomain.remote_dom;
struct domain *remote_domain = chn->u.interdomain.remote_dom;
struct capability *cap;
if ( IS_PRIV(current->domain) )
......@@ -1689,22 +1683,20 @@ static int cap_evtchn_send (struct domain *d, struct evtchn *chn)
if ( (ret = cap_check(current->domain, cap)) == 1 )
{
//TT_DBG_ON(cap_debug,"cap_check success\nLeaving cap_evtchn_send()\n");
#if 0
if (chn->state == ECS_INTERDOMAIN)
{
if (remote_domain->est_evtchn == NULL)
{
// TT_ERR("remoted domain %d est_evtchn is NULL\n",remote_domain->domain_id);
TT_ERR("remoted domain %d est_evtchn is NULL\n",remote_domain->domain_id);
return 0;
}
if (cap_check(d,remote_domain->est_evtchn) == 0)
{
// TT_ERR("Not allowed to send evt to remote domain\n");
TT_ERR("Not allowed to send evt to remote domain\n");
return 1;
}
}
#endif
return 0;
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment