ia64/xen-unstable

changeset 14919:b43bd71ee65b

acm: Changes to files missed in previous cleanup patch.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author Keir Fraser <keir@xensource.com>
date Tue Apr 24 21:50:00 2007 +0100 (2007-04-24)
parents 58e98e803378
children 74b712492dba
files xen/acm/acm_core.c xen/include/acm/acm_core.h
line diff
     1.1 --- a/xen/acm/acm_core.c	Tue Apr 24 21:48:09 2007 +0100
     1.2 +++ b/xen/acm/acm_core.c	Tue Apr 24 21:50:00 2007 +0100
     1.3 @@ -312,18 +312,28 @@ acm_init(char *policy_start,
     1.4  int
     1.5  acm_init_domain_ssid(domid_t id, ssidref_t ssidref)
     1.6  {
     1.7 -    struct acm_ssid_domain *ssid;
     1.8      struct domain *subj = rcu_lock_domain_by_id(id);
     1.9 -    int ret1, ret2;
    1.10 +    int ret;
    1.11   
    1.12      if (subj == NULL)
    1.13      {
    1.14          printk("%s: ACM_NULL_POINTER ERROR (id=%x).\n", __func__, id);
    1.15          return ACM_NULL_POINTER_ERROR;
    1.16      }
    1.17 +
    1.18 +    ret = acm_init_domain_ssid_new(subj, ssidref);
    1.19 +
    1.20 +    rcu_unlock_domain(subj);
    1.21 +
    1.22 +    return ret;
    1.23 +}
    1.24 +
    1.25 +int acm_init_domain_ssid_new(struct domain *subj, ssidref_t ssidref)
    1.26 +{
    1.27 +    struct acm_ssid_domain *ssid;
    1.28 +    int ret1, ret2;
    1.29      if ((ssid = xmalloc(struct acm_ssid_domain)) == NULL)
    1.30      {
    1.31 -        rcu_unlock_domain(subj);
    1.32          return ACM_INIT_SSID_ERROR;
    1.33      }
    1.34  
    1.35 @@ -355,12 +365,10 @@ acm_init_domain_ssid(domid_t id, ssidref
    1.36          printk("%s: ERROR instantiating individual ssids for domain 0x%02x.\n",
    1.37                 __func__, subj->domain_id);
    1.38          acm_free_domain_ssid(ssid);
    1.39 -        rcu_unlock_domain(subj);
    1.40          return ACM_INIT_SSID_ERROR;
    1.41      }
    1.42      printkd("%s: assigned domain %x the ssidref=%x.\n",
    1.43 -           __func__, id, ssid->ssidref);
    1.44 -    rcu_unlock_domain(subj);
    1.45 +           __func__, subj->domain_id, ssid->ssidref);
    1.46      return ACM_OK;
    1.47  }
    1.48  
     2.1 --- a/xen/include/acm/acm_core.h	Tue Apr 24 21:48:09 2007 +0100
     2.2 +++ b/xen/include/acm/acm_core.h	Tue Apr 24 21:50:00 2007 +0100
     2.3 @@ -120,6 +120,7 @@ struct ste_ssid {
     2.4  
     2.5  /* protos */
     2.6  int acm_init_domain_ssid(domid_t id, ssidref_t ssidref);
     2.7 +int acm_init_domain_ssid_new(struct domain *, ssidref_t ssidref);
     2.8  void acm_free_domain_ssid(struct acm_ssid_domain *ssid);
     2.9  int acm_init_binary_policy(u32 policy_code);
    2.10  int acm_set_policy(XEN_GUEST_HANDLE(void) buf, u32 buf_size);