[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] DOM0_GETDOMAININFO hypercall support for DOMID_SELF


  • To: <Xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Cihula, Joseph" <joseph.cihula@xxxxxxxxx>
  • Date: Fri, 16 Dec 2005 17:39:24 -0800
  • Delivery-date: Sat, 17 Dec 2005 01:41:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcYCqrYY0oZBPKxURPK/QX+ZNpUcsQ==
  • Thread-topic: [PATCH] DOM0_GETDOMAININFO hypercall support for DOMID_SELF

The attached (and following) patch allows a privileged domain to use the
DOM0_GETDOMAININFO dom0_op (and by extension, userspace apps to use
xc_domain_getinfo()) to query about themselves by specifying the domid
as DOMID_SELF.

Most importantly, this allows the domain to determine its own domid.

Signed-off-by: joseph.cihula@xxxxxxxxx

diff -r 6ee4c16bfdec xen/common/dom0_ops.c
--- a/xen/common/dom0_ops.c     Fri Dec 16 17:58:21 2005
+++ b/xen/common/dom0_ops.c     Fri Dec 16 18:40:39 2005
@@ -358,12 +358,17 @@
     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;
         }

Attachment: getinfo.patch
Description: getinfo.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.