ia64/xen-unstable

changeset 15752:ef79bf6f0142

xen: Do not accept DOMID_SELF as input to DOMCTL_getdomaininfo.
This was screwing up callers that loop on getdomaininfo(), if there
was a domain with domid DOMID_FIRST_RESERVED-1 (== DOMID_SELF-1).
They would see DOMID_SELF-1, then look up DOMID_SELF, which has domid
0 of course, and then start their domain-finding loop all over again!
Found by Kouya Shimura <kouya@jp.fujitsu.com>. Thanks!
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Tue Aug 14 09:56:46 2007 +0100 (2007-08-14)
parents fdffab15499d
children e9a5c6b2acbe
files xen/common/domctl.c
line diff
     1.1 --- a/xen/common/domctl.c	Tue Aug 14 09:21:39 2007 +0100
     1.2 +++ b/xen/common/domctl.c	Tue Aug 14 09:56:46 2007 +0100
     1.3 @@ -463,19 +463,13 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domc
     1.4      case XEN_DOMCTL_getdomaininfo:
     1.5      { 
     1.6          struct domain *d;
     1.7 -        domid_t dom;
     1.8 -
     1.9 -        dom = op->domain;
    1.10 -        if ( dom == DOMID_SELF )
    1.11 -            dom = current->domain->domain_id;
    1.12 +        domid_t dom = op->domain;
    1.13  
    1.14          rcu_read_lock(&domlist_read_lock);
    1.15  
    1.16          for_each_domain ( d )
    1.17 -        {
    1.18              if ( d->domain_id >= dom )
    1.19                  break;
    1.20 -        }
    1.21  
    1.22          if ( d == NULL )
    1.23          {