WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] DOM0_GETDOMAININFO hypercall support for DOMID_S

To: "Cihula, Joseph" <joseph.cihula@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] DOM0_GETDOMAININFO hypercall support for DOMID_SELF
From: Anthony Liguori <aliguori@xxxxxxxxxx>
Date: Fri, 16 Dec 2005 20:09:11 -0600
Cc: Xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sat, 17 Dec 2005 02:11:31 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CA95C29D57188841ABB072EA7357C00D0A7264E7@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <CA95C29D57188841ABB072EA7357C00D0A7264E7@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)
Cihula, Joseph wrote:

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.
If you want to find out your domid (you'll have to be very careful wrt save/restore/migrate btw) what you can do today is:

1) Copy libxenctrl.so.3.0.0, libxenstore.so, and xenstore-read into your guest.
2) xenstore-read domid

This will work in any type of domain. You can also just use libxenstore directly (just make sure to use xs_domain_open()).
Regards,

Anthony Liguori

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;
        }

------------------------------------------------------------------------

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


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

<Prev in Thread] Current Thread [Next in Thread>