direct-io.hg

changeset 13649:271ffb1c12eb

Rename find_domain_by_id() to get_domain_by_id().
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@localhost.localdomain
date Fri Jan 26 18:38:40 2007 +0000 (2007-01-26)
parents 32fd32bbf78d
children d1710eb35385
files xen/acm/acm_core.c xen/acm/acm_simple_type_enforcement_hooks.c xen/arch/ia64/vmx/vmmu.c xen/arch/ia64/vmx/vmx_hypercall.c xen/arch/ia64/xen/dom0_ops.c xen/arch/ia64/xen/mm.c xen/arch/powerpc/domctl.c xen/arch/x86/domctl.c xen/arch/x86/hvm/hvm.c xen/arch/x86/mm.c xen/common/acm_ops.c xen/common/domain.c xen/common/domctl.c xen/common/event_channel.c xen/common/grant_table.c xen/common/memory.c xen/common/schedule.c xen/common/xenoprof.c xen/include/acm/acm_hooks.h xen/include/xen/sched.h
line diff
     1.1 --- a/xen/acm/acm_core.c	Fri Jan 26 18:34:36 2007 +0000
     1.2 +++ b/xen/acm/acm_core.c	Fri Jan 26 18:38:40 2007 +0000
     1.3 @@ -276,7 +276,7 @@ int
     1.4  acm_init_domain_ssid(domid_t id, ssidref_t ssidref)
     1.5  {
     1.6      struct acm_ssid_domain *ssid;
     1.7 -    struct domain *subj = find_domain_by_id(id);
     1.8 +    struct domain *subj = get_domain_by_id(id);
     1.9      int ret1, ret2;
    1.10   
    1.11      if (subj == NULL)
     2.1 --- a/xen/acm/acm_simple_type_enforcement_hooks.c	Fri Jan 26 18:34:36 2007 +0000
     2.2 +++ b/xen/acm/acm_simple_type_enforcement_hooks.c	Fri Jan 26 18:38:40 2007 +0000
     2.3 @@ -205,7 +205,7 @@ ste_init_state(struct acm_ste_policy_buf
     2.4                  ste_rssidref = ste_rssid->ste_ssidref;
     2.5              } else if ((*pd)->evtchn[port]->state == ECS_UNBOUND) {
     2.6                  rdomid = (*pd)->evtchn[port]->u.unbound.remote_domid;
     2.7 -                if ((rdom = find_domain_by_id(rdomid)) == NULL) {
     2.8 +                if ((rdom = get_domain_by_id(rdomid)) == NULL) {
     2.9                      printk("%s: Error finding domain to id %x!\n", __func__, rdomid);
    2.10                      goto out;
    2.11                  }
    2.12 @@ -245,7 +245,7 @@ ste_init_state(struct acm_ste_policy_buf
    2.13                          __func__, (*pd)->domain_id, i, sha_copy.flags, sha_copy.domid, 
    2.14                          (unsigned long)sha_copy.frame);
    2.15                  rdomid = sha_copy.domid;
    2.16 -                if ((rdom = find_domain_by_id(rdomid)) == NULL) {
    2.17 +                if ((rdom = get_domain_by_id(rdomid)) == NULL) {
    2.18                      printkd("%s: domain not found ERROR!\n", __func__);
    2.19                      goto out;
    2.20                  };
    2.21 @@ -507,8 +507,8 @@ ste_pre_eventchannel_unbound(domid_t id1
    2.22      if (id1 == DOMID_SELF) id1 = current->domain->domain_id;
    2.23      if (id2 == DOMID_SELF) id2 = current->domain->domain_id;
    2.24  
    2.25 -    subj = find_domain_by_id(id1);
    2.26 -    obj  = find_domain_by_id(id2);
    2.27 +    subj = get_domain_by_id(id1);
    2.28 +    obj  = get_domain_by_id(id2);
    2.29      if ((subj == NULL) || (obj == NULL)) {
    2.30          ret = ACM_ACCESS_DENIED;
    2.31          goto out;
    2.32 @@ -552,7 +552,7 @@ ste_pre_eventchannel_interdomain(domid_t
    2.33      if (id == DOMID_SELF) id = current->domain->domain_id;
    2.34  
    2.35      subj = current->domain;
    2.36 -    obj  = find_domain_by_id(id);
    2.37 +    obj  = get_domain_by_id(id);
    2.38      if (obj == NULL) {
    2.39          ret = ACM_ACCESS_DENIED;
    2.40          goto out;
    2.41 @@ -595,7 +595,7 @@ ste_pre_grant_map_ref (domid_t id) {
    2.42      }
    2.43      atomic_inc(&ste_bin_pol.gt_eval_count);
    2.44      subj = current->domain;
    2.45 -    obj = find_domain_by_id(id);
    2.46 +    obj = get_domain_by_id(id);
    2.47  
    2.48      if (share_common_type(subj, obj)) {
    2.49          cache_result(subj, obj);
    2.50 @@ -633,7 +633,7 @@ ste_pre_grant_setup (domid_t id) {
    2.51      }
    2.52      /* b) check types */
    2.53      subj = current->domain;
    2.54 -    obj = find_domain_by_id(id);
    2.55 +    obj = get_domain_by_id(id);
    2.56  
    2.57      if (share_common_type(subj, obj)) {
    2.58          cache_result(subj, obj);
     3.1 --- a/xen/arch/ia64/vmx/vmmu.c	Fri Jan 26 18:34:36 2007 +0000
     3.2 +++ b/xen/arch/ia64/vmx/vmmu.c	Fri Jan 26 18:38:40 2007 +0000
     3.3 @@ -49,7 +49,7 @@ u64 get_mfn(struct domain *d, u64 gpfn)
     3.4          d = current->domain;
     3.5      }
     3.6      else {
     3.7 -        d = find_domain_by_id(domid);
     3.8 +        d = get_domain_by_id(domid);
     3.9      }
    3.10   */
    3.11      xen_gppn = arch_to_xen_ppn(gpfn);
     4.1 --- a/xen/arch/ia64/vmx/vmx_hypercall.c	Fri Jan 26 18:34:36 2007 +0000
     4.2 +++ b/xen/arch/ia64/vmx/vmx_hypercall.c	Fri Jan 26 18:38:40 2007 +0000
     4.3 @@ -53,7 +53,7 @@ static int hvmop_set_isa_irq_level(
     4.4      if ( op.isa_irq > 15 )
     4.5          return -EINVAL;
     4.6  
     4.7 -    d = find_domain_by_id(op.domid);
     4.8 +    d = get_domain_by_id(op.domid);
     4.9      if ( d == NULL )
    4.10          return -ESRCH;
    4.11  
    4.12 @@ -85,7 +85,7 @@ static int hvmop_set_pci_intx_level(
    4.13      if ( (op.domain > 0) || (op.bus > 0) || (op.device > 31) || (op.intx > 3) )
    4.14          return -EINVAL;
    4.15  
    4.16 -    d = find_domain_by_id(op.domid);
    4.17 +    d = get_domain_by_id(op.domid);
    4.18      if ( d == NULL )
    4.19          return -ESRCH;
    4.20  
    4.21 @@ -126,7 +126,7 @@ do_hvm_op(unsigned long op, XEN_GUEST_HA
    4.22              d = current->domain;
    4.23          }
    4.24          else if (IS_PRIV(current->domain)) {
    4.25 -            d = find_domain_by_id(a.domid);
    4.26 +            d = get_domain_by_id(a.domid);
    4.27              if (d == NULL)
    4.28                  return -ESRCH;
    4.29          }
     5.1 --- a/xen/arch/ia64/xen/dom0_ops.c	Fri Jan 26 18:34:36 2007 +0000
     5.2 +++ b/xen/arch/ia64/xen/dom0_ops.c	Fri Jan 26 18:38:40 2007 +0000
     5.3 @@ -40,7 +40,7 @@ long arch_do_domctl(xen_domctl_t *op, XE
     5.4      case XEN_DOMCTL_getmemlist:
     5.5      {
     5.6          unsigned long i;
     5.7 -        struct domain *d = find_domain_by_id(op->domain);
     5.8 +        struct domain *d = get_domain_by_id(op->domain);
     5.9          unsigned long start_page = op->u.getmemlist.start_pfn;
    5.10          unsigned long nr_pages = op->u.getmemlist.max_pfns;
    5.11          uint64_t mfn;
    5.12 @@ -76,7 +76,7 @@ long arch_do_domctl(xen_domctl_t *op, XE
    5.13      case XEN_DOMCTL_arch_setup:
    5.14      {
    5.15          xen_domctl_arch_setup_t *ds = &op->u.arch_setup;
    5.16 -        struct domain *d = find_domain_by_id(op->domain);
    5.17 +        struct domain *d = get_domain_by_id(op->domain);
    5.18  
    5.19          if ( d == NULL) {
    5.20              ret = -EINVAL;
    5.21 @@ -140,7 +140,7 @@ long arch_do_domctl(xen_domctl_t *op, XE
    5.22      {
    5.23          struct domain *d; 
    5.24          ret = -ESRCH;
    5.25 -        d = find_domain_by_id(op->domain);
    5.26 +        d = get_domain_by_id(op->domain);
    5.27          if ( d != NULL )
    5.28          {
    5.29              ret = shadow_mode_control(d, &op->u.shadow_op);
    5.30 @@ -158,7 +158,7 @@ long arch_do_domctl(xen_domctl_t *op, XE
    5.31          unsigned int lp = fp + np - 1;
    5.32  
    5.33          ret = -ESRCH;
    5.34 -        d = find_domain_by_id(op->domain);
    5.35 +        d = get_domain_by_id(op->domain);
    5.36          if (unlikely(d == NULL))
    5.37              break;
    5.38  
     6.1 --- a/xen/arch/ia64/xen/mm.c	Fri Jan 26 18:34:36 2007 +0000
     6.2 +++ b/xen/arch/ia64/xen/mm.c	Fri Jan 26 18:38:40 2007 +0000
     6.3 @@ -1274,7 +1274,7 @@ static unsigned long
     6.4      if (flags & (ASSIGN_nocache | ASSIGN_pgc_allocated))
     6.5          return -EINVAL;
     6.6  
     6.7 -    rd = find_domain_by_id(domid);
     6.8 +    rd = get_domain_by_id(domid);
     6.9      if (unlikely(rd == NULL)) {
    6.10          switch (domid) {
    6.11          case DOMID_XEN:
    6.12 @@ -2055,7 +2055,7 @@ arch_memory_op(int op, XEN_GUEST_HANDLE(
    6.13          }
    6.14          else if (!IS_PRIV(current->domain))
    6.15              return -EPERM;
    6.16 -        else if ((d = find_domain_by_id(xatp.domid)) == NULL)
    6.17 +        else if ((d = get_domain_by_id(xatp.domid)) == NULL)
    6.18              return -ESRCH;
    6.19  
    6.20          /* This hypercall is used for VT-i domain only */
     7.1 --- a/xen/arch/powerpc/domctl.c	Fri Jan 26 18:34:36 2007 +0000
     7.2 +++ b/xen/arch/powerpc/domctl.c	Fri Jan 26 18:38:40 2007 +0000
     7.3 @@ -47,7 +47,7 @@ long arch_do_domctl(struct xen_domctl *d
     7.4      case XEN_DOMCTL_getmemlist:
     7.5      {
     7.6          int i;
     7.7 -        struct domain *d = find_domain_by_id(domctl->domain);
     7.8 +        struct domain *d = get_domain_by_id(domctl->domain);
     7.9          unsigned long max_pfns = domctl->u.getmemlist.max_pfns;
    7.10          uint64_t mfn;
    7.11          struct list_head *list_ent;
    7.12 @@ -84,7 +84,7 @@ long arch_do_domctl(struct xen_domctl *d
    7.13      {
    7.14          struct domain *d;
    7.15          ret = -ESRCH;
    7.16 -        d = find_domain_by_id(domctl->domain);
    7.17 +        d = get_domain_by_id(domctl->domain);
    7.18          if ( d != NULL )
    7.19          {
    7.20              ret = shadow_domctl(d, &domctl->u.shadow_op, u_domctl);
    7.21 @@ -99,7 +99,7 @@ long arch_do_domctl(struct xen_domctl *d
    7.22          unsigned int order = domctl->u.real_mode_area.log - PAGE_SHIFT;
    7.23  
    7.24          ret = -ESRCH;
    7.25 -        d = find_domain_by_id(domctl->domain);
    7.26 +        d = get_domain_by_id(domctl->domain);
    7.27          if (d != NULL) {
    7.28              ret = -EINVAL;
    7.29              if (cpu_rma_valid(order))
     8.1 --- a/xen/arch/x86/domctl.c	Fri Jan 26 18:34:36 2007 +0000
     8.2 +++ b/xen/arch/x86/domctl.c	Fri Jan 26 18:38:40 2007 +0000
     8.3 @@ -39,7 +39,7 @@ long arch_do_domctl(
     8.4      {
     8.5          struct domain *d;
     8.6          ret = -ESRCH;
     8.7 -        d = find_domain_by_id(domctl->domain);
     8.8 +        d = get_domain_by_id(domctl->domain);
     8.9          if ( d != NULL )
    8.10          {
    8.11              ret = shadow_domctl(d,
    8.12 @@ -62,7 +62,7 @@ long arch_do_domctl(
    8.13              break;
    8.14  
    8.15          ret = -ESRCH;
    8.16 -        if ( unlikely((d = find_domain_by_id(domctl->domain)) == NULL) )
    8.17 +        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) )
    8.18              break;
    8.19  
    8.20          if ( np == 0 )
    8.21 @@ -86,7 +86,7 @@ long arch_do_domctl(
    8.22          ret = -EINVAL;
    8.23  
    8.24          if ( unlikely(!mfn_valid(mfn)) ||
    8.25 -             unlikely((d = find_domain_by_id(dom)) == NULL) )
    8.26 +             unlikely((d = get_domain_by_id(dom)) == NULL) )
    8.27              break;
    8.28  
    8.29          page = mfn_to_page(mfn);
    8.30 @@ -134,7 +134,7 @@ long arch_do_domctl(
    8.31          uint32_t *arr32;
    8.32          ret = -ESRCH;
    8.33  
    8.34 -        if ( unlikely((d = find_domain_by_id(dom)) == NULL) )
    8.35 +        if ( unlikely((d = get_domain_by_id(dom)) == NULL) )
    8.36              break;
    8.37  
    8.38          if ( unlikely(num > 1024) )
    8.39 @@ -217,7 +217,7 @@ long arch_do_domctl(
    8.40      case XEN_DOMCTL_getmemlist:
    8.41      {
    8.42          int i;
    8.43 -        struct domain *d = find_domain_by_id(domctl->domain);
    8.44 +        struct domain *d = get_domain_by_id(domctl->domain);
    8.45          unsigned long max_pfns = domctl->u.getmemlist.max_pfns;
    8.46          uint64_t mfn;
    8.47          struct list_head *list_ent;
    8.48 @@ -255,7 +255,7 @@ long arch_do_domctl(
    8.49  
    8.50      case XEN_DOMCTL_hypercall_init:
    8.51      {
    8.52 -        struct domain *d = find_domain_by_id(domctl->domain);
    8.53 +        struct domain *d = get_domain_by_id(domctl->domain);
    8.54          unsigned long gmfn = domctl->u.hypercall_init.gmfn;
    8.55          unsigned long mfn;
    8.56          void *hypercall_page;
    8.57 @@ -293,7 +293,7 @@ long arch_do_domctl(
    8.58          struct vcpu               *v;
    8.59  
    8.60          ret = -ESRCH;
    8.61 -        if ( (d = find_domain_by_id(domctl->domain)) == NULL )
    8.62 +        if ( (d = get_domain_by_id(domctl->domain)) == NULL )
    8.63              break;
    8.64  
    8.65          ret = -ENOMEM;
    8.66 @@ -324,7 +324,7 @@ long arch_do_domctl(
    8.67          struct vcpu               *v;
    8.68  
    8.69          ret = -ESRCH;
    8.70 -        if ( (d = find_domain_by_id(domctl->domain)) == NULL )
    8.71 +        if ( (d = get_domain_by_id(domctl->domain)) == NULL )
    8.72              break;
    8.73  
    8.74          ret = -ENOMEM;
    8.75 @@ -360,7 +360,7 @@ long arch_do_domctl(
    8.76          struct domain *d;
    8.77  
    8.78          ret = -ESRCH;
    8.79 -        if ( (d = find_domain_by_id(domctl->domain)) == NULL )
    8.80 +        if ( (d = get_domain_by_id(domctl->domain)) == NULL )
    8.81              break;
    8.82  
    8.83          switch ( domctl->u.address_size.size )
    8.84 @@ -386,7 +386,7 @@ long arch_do_domctl(
    8.85          struct domain *d;
    8.86  
    8.87          ret = -ESRCH;
    8.88 -        if ( (d = find_domain_by_id(domctl->domain)) == NULL )
    8.89 +        if ( (d = get_domain_by_id(domctl->domain)) == NULL )
    8.90              break;
    8.91  
    8.92          domctl->u.address_size.size = BITS_PER_GUEST_LONG(d);
     9.1 --- a/xen/arch/x86/hvm/hvm.c	Fri Jan 26 18:34:36 2007 +0000
     9.2 +++ b/xen/arch/x86/hvm/hvm.c	Fri Jan 26 18:38:40 2007 +0000
     9.3 @@ -674,7 +674,7 @@ static int hvmop_set_pci_intx_level(
     9.4      if ( (op.domain > 0) || (op.bus > 0) || (op.device > 31) || (op.intx > 3) )
     9.5          return -EINVAL;
     9.6  
     9.7 -    d = find_domain_by_id(op.domid);
     9.8 +    d = get_domain_by_id(op.domid);
     9.9      if ( d == NULL )
    9.10          return -ESRCH;
    9.11  
    9.12 @@ -717,7 +717,7 @@ static int hvmop_set_isa_irq_level(
    9.13      if ( op.isa_irq > 15 )
    9.14          return -EINVAL;
    9.15  
    9.16 -    d = find_domain_by_id(op.domid);
    9.17 +    d = get_domain_by_id(op.domid);
    9.18      if ( d == NULL )
    9.19          return -ESRCH;
    9.20  
    9.21 @@ -760,7 +760,7 @@ static int hvmop_set_pci_link_route(
    9.22      if ( (op.link > 3) || (op.isa_irq > 15) )
    9.23          return -EINVAL;
    9.24  
    9.25 -    d = find_domain_by_id(op.domid);
    9.26 +    d = get_domain_by_id(op.domid);
    9.27      if ( d == NULL )
    9.28          return -ESRCH;
    9.29  
    9.30 @@ -805,7 +805,7 @@ long do_hvm_op(unsigned long op, XEN_GUE
    9.31          }
    9.32          else if ( IS_PRIV(current->domain) )
    9.33          {
    9.34 -            d = find_domain_by_id(a.domid);
    9.35 +            d = get_domain_by_id(a.domid);
    9.36              if ( d == NULL )
    9.37                  return -ESRCH;
    9.38          }
    10.1 --- a/xen/arch/x86/mm.c	Fri Jan 26 18:34:36 2007 +0000
    10.2 +++ b/xen/arch/x86/mm.c	Fri Jan 26 18:38:40 2007 +0000
    10.3 @@ -1882,7 +1882,7 @@ static int set_foreigndom(domid_t domid)
    10.4      }
    10.5      else
    10.6      {
    10.7 -        info->foreign = e = find_domain_by_id(domid);
    10.8 +        info->foreign = e = get_domain_by_id(domid);
    10.9          if ( e == NULL )
   10.10          {
   10.11              switch ( domid )
   10.12 @@ -2963,7 +2963,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
   10.13          }
   10.14          else if ( !IS_PRIV(current->domain) )
   10.15              return -EPERM;
   10.16 -        else if ( (d = find_domain_by_id(xatp.domid)) == NULL )
   10.17 +        else if ( (d = get_domain_by_id(xatp.domid)) == NULL )
   10.18              return -ESRCH;
   10.19  
   10.20          switch ( xatp.space )
   10.21 @@ -3034,7 +3034,7 @@ long arch_memory_op(int op, XEN_GUEST_HA
   10.22          }
   10.23          else if ( !IS_PRIV(current->domain) )
   10.24              return -EPERM;
   10.25 -        else if ( (d = find_domain_by_id(fmap.domid)) == NULL )
   10.26 +        else if ( (d = get_domain_by_id(fmap.domid)) == NULL )
   10.27              return -ESRCH;
   10.28  
   10.29          rc = copy_from_guest(&d->arch.e820[0], fmap.map.buffer,
    11.1 --- a/xen/common/acm_ops.c	Fri Jan 26 18:34:36 2007 +0000
    11.2 +++ b/xen/common/acm_ops.c	Fri Jan 26 18:38:40 2007 +0000
    11.3 @@ -115,7 +115,7 @@ ret_t do_acm_op(int cmd, XEN_GUEST_HANDL
    11.4              ssidref = getssid.id.ssidref;
    11.5          else if (getssid.get_ssid_by == ACM_GETBY_domainid)
    11.6          {
    11.7 -            struct domain *subj = find_domain_by_id(getssid.id.domainid);
    11.8 +            struct domain *subj = get_domain_by_id(getssid.id.domainid);
    11.9              if (!subj)
   11.10              {
   11.11                  rc = -ESRCH; /* domain not found */
   11.12 @@ -152,7 +152,7 @@ ret_t do_acm_op(int cmd, XEN_GUEST_HANDL
   11.13              ssidref1 = getdecision.id1.ssidref;
   11.14          else if (getdecision.get_decision_by1 == ACM_GETBY_domainid)
   11.15          {
   11.16 -            struct domain *subj = find_domain_by_id(getdecision.id1.domainid);
   11.17 +            struct domain *subj = get_domain_by_id(getdecision.id1.domainid);
   11.18              if (!subj)
   11.19              {
   11.20                  rc = -ESRCH; /* domain not found */
   11.21 @@ -176,7 +176,7 @@ ret_t do_acm_op(int cmd, XEN_GUEST_HANDL
   11.22              ssidref2 = getdecision.id2.ssidref;
   11.23          else if (getdecision.get_decision_by2 == ACM_GETBY_domainid)
   11.24          {
   11.25 -            struct domain *subj = find_domain_by_id(getdecision.id2.domainid);
   11.26 +            struct domain *subj = get_domain_by_id(getdecision.id2.domainid);
   11.27              if (!subj)
   11.28              {
   11.29                  rc = -ESRCH; /* domain not found */
    12.1 --- a/xen/common/domain.c	Fri Jan 26 18:34:36 2007 +0000
    12.2 +++ b/xen/common/domain.c	Fri Jan 26 18:38:40 2007 +0000
    12.3 @@ -203,7 +203,7 @@ struct domain *domain_create(domid_t dom
    12.4  }
    12.5  
    12.6  
    12.7 -struct domain *find_domain_by_id(domid_t dom)
    12.8 +struct domain *get_domain_by_id(domid_t dom)
    12.9  {
   12.10      struct domain *d;
   12.11  
    13.1 --- a/xen/common/domctl.c	Fri Jan 26 18:34:36 2007 +0000
    13.2 +++ b/xen/common/domctl.c	Fri Jan 26 18:38:40 2007 +0000
    13.3 @@ -73,7 +73,7 @@ static inline int is_free_domid(domid_t 
    13.4      if ( dom >= DOMID_FIRST_RESERVED )
    13.5          return 0;
    13.6  
    13.7 -    if ( (d = find_domain_by_id(dom)) == NULL )
    13.8 +    if ( (d = get_domain_by_id(dom)) == NULL )
    13.9          return 1;
   13.10  
   13.11      put_domain(d);
   13.12 @@ -196,7 +196,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.13  
   13.14      case XEN_DOMCTL_setvcpucontext:
   13.15      {
   13.16 -        struct domain *d = find_domain_by_id(op->domain);
   13.17 +        struct domain *d = get_domain_by_id(op->domain);
   13.18          vcpu_guest_context_u c = { .nat = NULL };
   13.19          unsigned int vcpu = op->u.vcpucontext.vcpu;
   13.20          struct vcpu *v;
   13.21 @@ -248,7 +248,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.22  
   13.23      case XEN_DOMCTL_pausedomain:
   13.24      {
   13.25 -        struct domain *d = find_domain_by_id(op->domain);
   13.26 +        struct domain *d = get_domain_by_id(op->domain);
   13.27          ret = -ESRCH;
   13.28          if ( d != NULL )
   13.29          {
   13.30 @@ -265,7 +265,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.31  
   13.32      case XEN_DOMCTL_unpausedomain:
   13.33      {
   13.34 -        struct domain *d = find_domain_by_id(op->domain);
   13.35 +        struct domain *d = get_domain_by_id(op->domain);
   13.36          ret = -ESRCH;
   13.37          if ( d != NULL )
   13.38          {
   13.39 @@ -283,7 +283,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.40  
   13.41      case XEN_DOMCTL_resumedomain:
   13.42      {
   13.43 -        struct domain *d = find_domain_by_id(op->domain);
   13.44 +        struct domain *d = get_domain_by_id(op->domain);
   13.45          struct vcpu *v;
   13.46  
   13.47          ret = -ESRCH;
   13.48 @@ -367,7 +367,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.49              break;
   13.50  
   13.51          ret = -ESRCH;
   13.52 -        if ( (d = find_domain_by_id(op->domain)) == NULL )
   13.53 +        if ( (d = get_domain_by_id(op->domain)) == NULL )
   13.54              break;
   13.55  
   13.56          /* Needed, for example, to ensure writable p.t. state is synced. */
   13.57 @@ -402,7 +402,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.58  
   13.59      case XEN_DOMCTL_destroydomain:
   13.60      {
   13.61 -        struct domain *d = find_domain_by_id(op->domain);
   13.62 +        struct domain *d = get_domain_by_id(op->domain);
   13.63          ret = -ESRCH;
   13.64          if ( d != NULL )
   13.65          {
   13.66 @@ -421,7 +421,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.67      case XEN_DOMCTL_getvcpuaffinity:
   13.68      {
   13.69          domid_t dom = op->domain;
   13.70 -        struct domain *d = find_domain_by_id(dom);
   13.71 +        struct domain *d = get_domain_by_id(dom);
   13.72          struct vcpu *v;
   13.73          cpumask_t new_affinity;
   13.74  
   13.75 @@ -460,7 +460,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.76          struct domain *d;
   13.77  
   13.78          ret = -ESRCH;
   13.79 -        if ( (d = find_domain_by_id(op->domain)) == NULL )
   13.80 +        if ( (d = get_domain_by_id(op->domain)) == NULL )
   13.81              break;
   13.82  
   13.83          ret = sched_adjust(d, &op->u.scheduler_op);
   13.84 @@ -514,7 +514,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.85          struct vcpu         *v;
   13.86  
   13.87          ret = -ESRCH;
   13.88 -        if ( (d = find_domain_by_id(op->domain)) == NULL )
   13.89 +        if ( (d = get_domain_by_id(op->domain)) == NULL )
   13.90              break;
   13.91  
   13.92          ret = -EINVAL;
   13.93 @@ -570,7 +570,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
   13.94          struct vcpu_runstate_info runstate;
   13.95  
   13.96          ret = -ESRCH;
   13.97 -        if ( (d = find_domain_by_id(op->domain)) == NULL )
   13.98 +        if ( (d = get_domain_by_id(op->domain)) == NULL )
   13.99              break;
  13.100  
  13.101          ret = -EINVAL;
  13.102 @@ -604,7 +604,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
  13.103          unsigned long new_max;
  13.104  
  13.105          ret = -ESRCH;
  13.106 -        d = find_domain_by_id(op->domain);
  13.107 +        d = get_domain_by_id(op->domain);
  13.108          if ( d == NULL )
  13.109              break;
  13.110  
  13.111 @@ -627,7 +627,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
  13.112      {
  13.113          struct domain *d;
  13.114          ret = -ESRCH;
  13.115 -        d = find_domain_by_id(op->domain);
  13.116 +        d = get_domain_by_id(op->domain);
  13.117          if ( d != NULL )
  13.118          {
  13.119              memcpy(d->handle, op->u.setdomainhandle.handle,
  13.120 @@ -642,7 +642,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
  13.121      {
  13.122          struct domain *d;
  13.123          ret = -ESRCH;
  13.124 -        d = find_domain_by_id(op->domain);
  13.125 +        d = get_domain_by_id(op->domain);
  13.126          if ( d != NULL )
  13.127          {
  13.128              if ( op->u.setdebugging.enable )
  13.129 @@ -665,7 +665,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
  13.130              break;
  13.131  
  13.132          ret = -ESRCH;
  13.133 -        d = find_domain_by_id(op->domain);
  13.134 +        d = get_domain_by_id(op->domain);
  13.135          if ( d == NULL )
  13.136              break;
  13.137  
  13.138 @@ -689,7 +689,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
  13.139              break;
  13.140  
  13.141          ret = -ESRCH;
  13.142 -        d = find_domain_by_id(op->domain);
  13.143 +        d = get_domain_by_id(op->domain);
  13.144          if ( d == NULL )
  13.145              break;
  13.146  
  13.147 @@ -707,7 +707,7 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
  13.148          struct domain *d;
  13.149  
  13.150          ret = -ESRCH;
  13.151 -        d = find_domain_by_id(op->domain);
  13.152 +        d = get_domain_by_id(op->domain);
  13.153          if ( d != NULL )
  13.154          {
  13.155              d->time_offset_seconds = op->u.settimeoffset.time_offset_seconds;
    14.1 --- a/xen/common/event_channel.c	Fri Jan 26 18:34:36 2007 +0000
    14.2 +++ b/xen/common/event_channel.c	Fri Jan 26 18:38:40 2007 +0000
    14.3 @@ -112,7 +112,7 @@ static long evtchn_alloc_unbound(evtchn_
    14.4      else if ( !IS_PRIV(current->domain) )
    14.5          return -EPERM;
    14.6  
    14.7 -    if ( (d = find_domain_by_id(dom)) == NULL )
    14.8 +    if ( (d = get_domain_by_id(dom)) == NULL )
    14.9          return -ESRCH;
   14.10  
   14.11      spin_lock(&d->evtchn_lock);
   14.12 @@ -150,7 +150,7 @@ static long evtchn_bind_interdomain(evtc
   14.13      if ( rdom == DOMID_SELF )
   14.14          rdom = current->domain->domain_id;
   14.15  
   14.16 -    if ( (rd = find_domain_by_id(rdom)) == NULL )
   14.17 +    if ( (rd = get_domain_by_id(rdom)) == NULL )
   14.18          return -ESRCH;
   14.19  
   14.20      /* Avoid deadlock by first acquiring lock of domain with smaller id. */
   14.21 @@ -598,7 +598,7 @@ static long evtchn_status(evtchn_status_
   14.22      else if ( !IS_PRIV(current->domain) )
   14.23          return -EPERM;
   14.24  
   14.25 -    if ( (d = find_domain_by_id(dom)) == NULL )
   14.26 +    if ( (d = get_domain_by_id(dom)) == NULL )
   14.27          return -ESRCH;
   14.28  
   14.29      spin_lock(&d->evtchn_lock);
   14.30 @@ -746,7 +746,7 @@ static long evtchn_reset(evtchn_reset_t 
   14.31      else if ( !IS_PRIV(current->domain) )
   14.32          return -EPERM;
   14.33  
   14.34 -    if ( (d = find_domain_by_id(dom)) == NULL )
   14.35 +    if ( (d = get_domain_by_id(dom)) == NULL )
   14.36          return -ESRCH;
   14.37  
   14.38      for ( i = 0; port_is_valid(d, i); i++ )
    15.1 --- a/xen/common/grant_table.c	Fri Jan 26 18:34:36 2007 +0000
    15.2 +++ b/xen/common/grant_table.c	Fri Jan 26 18:38:40 2007 +0000
    15.3 @@ -123,7 +123,7 @@ static void
    15.4          return;
    15.5      }
    15.6  
    15.7 -    if ( unlikely((rd = find_domain_by_id(op->dom)) == NULL) )
    15.8 +    if ( unlikely((rd = get_domain_by_id(op->dom)) == NULL) )
    15.9      {
   15.10          if ( rd != NULL )
   15.11              put_domain(rd);
   15.12 @@ -369,7 +369,7 @@ static void
   15.13      ref   = map->ref;
   15.14      flags = map->flags;
   15.15  
   15.16 -    if ( unlikely((rd = find_domain_by_id(dom)) == NULL) )
   15.17 +    if ( unlikely((rd = get_domain_by_id(dom)) == NULL) )
   15.18      {
   15.19          /* This can happen when a grant is implicitly unmapped. */
   15.20          gdprintk(XENLOG_INFO, "Could not find domain %d\n", dom);
   15.21 @@ -516,7 +516,7 @@ gnttab_setup_table(
   15.22          goto out;
   15.23      }
   15.24  
   15.25 -    if ( unlikely((d = find_domain_by_id(dom)) == NULL) )
   15.26 +    if ( unlikely((d = get_domain_by_id(dom)) == NULL) )
   15.27      {
   15.28          gdprintk(XENLOG_INFO, "Bad domid %d.\n", dom);
   15.29          op.status = GNTST_bad_domain;
   15.30 @@ -653,7 +653,7 @@ gnttab_transfer(
   15.31          }
   15.32  
   15.33          /* Find the target domain. */
   15.34 -        if ( unlikely((e = find_domain_by_id(gop.domid)) == NULL) )
   15.35 +        if ( unlikely((e = get_domain_by_id(gop.domid)) == NULL) )
   15.36          {
   15.37              gdprintk(XENLOG_INFO, "gnttab_transfer: can't find domain %d\n",
   15.38                      gop.domid);
   15.39 @@ -866,7 +866,7 @@ static void
   15.40          sd = current->domain;
   15.41          get_knownalive_domain(sd);
   15.42      }
   15.43 -    else if ( (sd = find_domain_by_id(op->source.domid)) == NULL )
   15.44 +    else if ( (sd = get_domain_by_id(op->source.domid)) == NULL )
   15.45      {
   15.46          PIN_FAIL(error_out, GNTST_bad_domain,
   15.47                   "couldn't find %d\n", op->source.domid);
   15.48 @@ -877,7 +877,7 @@ static void
   15.49          dd = current->domain;
   15.50          get_knownalive_domain(dd);
   15.51      }
   15.52 -    else if ( (dd = find_domain_by_id(op->dest.domid)) == NULL )
   15.53 +    else if ( (dd = get_domain_by_id(op->dest.domid)) == NULL )
   15.54      {
   15.55          PIN_FAIL(error_out, GNTST_bad_domain,
   15.56                   "couldn't find %d\n", op->dest.domid);
   15.57 @@ -1132,7 +1132,7 @@ gnttab_release_mappings(
   15.58                  "flags:(%x) dom:(%hu)\n",
   15.59                  handle, ref, map->flags, map->domid);
   15.60  
   15.61 -        rd = find_domain_by_id(map->domid);
   15.62 +        rd = get_domain_by_id(map->domid);
   15.63          if ( rd == NULL )
   15.64          {
   15.65              /* Nothing to clear up... */
    16.1 --- a/xen/common/memory.c	Fri Jan 26 18:34:36 2007 +0000
    16.2 +++ b/xen/common/memory.c	Fri Jan 26 18:38:40 2007 +0000
    16.3 @@ -242,7 +242,7 @@ static long translate_gpfn_list(
    16.4      else if ( !IS_PRIV(current->domain) )
    16.5          return -EPERM;
    16.6  
    16.7 -    if ( (d = find_domain_by_id(op.domid)) == NULL )
    16.8 +    if ( (d = get_domain_by_id(op.domid)) == NULL )
    16.9          return -ESRCH;
   16.10  
   16.11      if ( !shadow_mode_translate(d) )
   16.12 @@ -543,7 +543,7 @@ long do_memory_op(unsigned long cmd, XEN
   16.13          if ( likely(reservation.domid == DOMID_SELF) )
   16.14              d = current->domain;
   16.15          else if ( !IS_PRIV(current->domain) ||
   16.16 -                  ((d = find_domain_by_id(reservation.domid)) == NULL) )
   16.17 +                  ((d = get_domain_by_id(reservation.domid)) == NULL) )
   16.18              return start_extent;
   16.19          args.domain = d;
   16.20  
   16.21 @@ -589,7 +589,7 @@ long do_memory_op(unsigned long cmd, XEN
   16.22              d = current->domain;
   16.23          else if ( !IS_PRIV(current->domain) )
   16.24              return -EPERM;
   16.25 -        else if ( (d = find_domain_by_id(domid)) == NULL )
   16.26 +        else if ( (d = get_domain_by_id(domid)) == NULL )
   16.27              return -ESRCH;
   16.28  
   16.29          rc = (op == XENMEM_current_reservation) ? d->tot_pages : d->max_pages;
    17.1 --- a/xen/common/schedule.c	Fri Jan 26 18:34:36 2007 +0000
    17.2 +++ b/xen/common/schedule.c	Fri Jan 26 18:38:40 2007 +0000
    17.3 @@ -430,7 +430,7 @@ ret_t do_sched_op(int cmd, XEN_GUEST_HAN
    17.4              break;
    17.5  
    17.6          ret = -ESRCH;
    17.7 -        d = find_domain_by_id(sched_remote_shutdown.domain_id);
    17.8 +        d = get_domain_by_id(sched_remote_shutdown.domain_id);
    17.9          if ( d == NULL )
   17.10              break;
   17.11  
    18.1 --- a/xen/common/xenoprof.c	Fri Jan 26 18:34:36 2007 +0000
    18.2 +++ b/xen/common/xenoprof.c	Fri Jan 26 18:38:40 2007 +0000
    18.3 @@ -346,7 +346,7 @@ static int add_active_list(domid_t domid
    18.4      if ( adomains >= MAX_OPROF_DOMAINS )
    18.5          return -E2BIG;
    18.6  
    18.7 -    d = find_domain_by_id(domid);
    18.8 +    d = get_domain_by_id(domid);
    18.9      if ( d == NULL )
   18.10          return -EINVAL;
   18.11  
   18.12 @@ -369,7 +369,7 @@ static int add_passive_list(XEN_GUEST_HA
   18.13      if ( copy_from_guest(&passive, arg, 1) )
   18.14          return -EFAULT;
   18.15  
   18.16 -    d = find_domain_by_id(passive.domain_id);
   18.17 +    d = get_domain_by_id(passive.domain_id);
   18.18      if ( d == NULL )
   18.19          return -EINVAL;
   18.20  
    19.1 --- a/xen/include/acm/acm_hooks.h	Fri Jan 26 18:34:36 2007 +0000
    19.2 +++ b/xen/include/acm/acm_hooks.h	Fri Jan 26 18:38:40 2007 +0000
    19.3 @@ -241,7 +241,7 @@ static inline int acm_pre_domctl(struct 
    19.4                      __func__);
    19.5              return -EACCES;
    19.6          }
    19.7 -        d = find_domain_by_id(op->domain);
    19.8 +        d = get_domain_by_id(op->domain);
    19.9          if (d != NULL) {
   19.10              *ssid = d->ssid; /* save for post destroy when d is gone */
   19.11              if (*ssid == NULL) {
    20.1 --- a/xen/include/xen/sched.h	Fri Jan 26 18:34:36 2007 +0000
    20.2 +++ b/xen/include/xen/sched.h	Fri Jan 26 18:38:40 2007 +0000
    20.3 @@ -276,7 +276,7 @@ int construct_dom0(
    20.4      unsigned long initrd_start, unsigned long initrd_len,
    20.5      char *cmdline);
    20.6  
    20.7 -struct domain *find_domain_by_id(domid_t dom);
    20.8 +struct domain *get_domain_by_id(domid_t dom);
    20.9  void domain_destroy(struct domain *d);
   20.10  void domain_kill(struct domain *d);
   20.11  void domain_shutdown(struct domain *d, u8 reason);