direct-io.hg

changeset 8394:381cafbbc3d2

Allow a domain to specify DOMID_SELF to DOM0_GETDOMAININFO dom0_op.
This is primarily useful to allow a privileged domain to determine
its domid, where the preferred method of quering xenstore cannot be
used.

Signed-off-by: joseph.cihula@intel.com
author kaf24@firebug.cl.cam.ac.uk
date Sun Dec 18 20:27:42 2005 +0100 (2005-12-18)
parents 101ae33a8341
children 1283d309a603
files xen/common/dom0_ops.c
line diff
     1.1 --- a/xen/common/dom0_ops.c	Sat Dec 17 02:11:54 2005 +0100
     1.2 +++ b/xen/common/dom0_ops.c	Sun Dec 18 20:27:42 2005 +0100
     1.3 @@ -358,12 +358,17 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     1.4      case DOM0_GETDOMAININFO:
     1.5      { 
     1.6          struct domain *d;
     1.7 +        domid_t dom;
     1.8 +
     1.9 +        dom = op->u.getdomaininfo.domain;
    1.10 +        if ( dom == DOMID_SELF )
    1.11 +            dom = current->domain->domain_id;
    1.12  
    1.13          read_lock(&domlist_lock);
    1.14  
    1.15          for_each_domain ( d )
    1.16          {
    1.17 -            if ( d->domain_id >= op->u.getdomaininfo.domain )
    1.18 +            if ( d->domain_id >= dom )
    1.19                  break;
    1.20          }
    1.21