mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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
This commit is contained in:
1 parent
2cafb4b4e9
commit
310773bcd1
1 file changed
+6
-1
@@ -358,12 +358,17 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
|
||||
case DOM0_GETDOMAININFO:
|
||||
{
|
||||
struct domain *d;
|
||||
domid_t dom;
|
||||
|
||||
dom = op->u.getdomaininfo.domain;
|
||||
if ( dom == DOMID_SELF )
|
||||
dom = current->domain->domain_id;
|
||||
|
||||
read_lock(&domlist_lock);
|
||||
|
||||
for_each_domain ( d )
|
||||
{
|
||||
if ( d->domain_id >= op->u.getdomaininfo.domain )
|
||||
if ( d->domain_id >= dom )
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||