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] determining if kernel is dom0 kernel or not.

To: jd <jdsw2002@xxxxxxxxx>, xendevel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] determining if kernel is dom0 kernel or not.
From: Keir Fraser <keir@xxxxxxxxxxxxx>
Date: Wed, 11 Jul 2007 20:18:58 +0100
Delivery-date: Wed, 11 Jul 2007 12:16:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <650667.22602.qm@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcfD8FR2ky+O6i/jEdyh5AAX8io7RQ==
Thread-topic: [Xen-devel] determining if kernel is dom0 kernel or not.
User-agent: Microsoft-Entourage/11.3.3.061214
If you are looking for running on Xen versus not on Xen (rather than dom0
versus domU), and you are interested in x86 only, then the program in
tools/misc/xen-detect.c is along the lines of what you want (and can be cut
down to size if you just want e.g., a non-zero return code if running on
Xen).

If you want to detect dom0 specifically then that's trickier --
/proc/xen/privcmd for example exists even in a domU, if the kernel is
dom0-capable. You'd have to be root and then try a privileged hypercall. :-)

 -- Keir

On 11/7/07 19:40, "jd" <jdsw2002@xxxxxxxxx> wrote:

> Hi
>   How do I reliably determine if the current kernel is
> dom0 (xen capable) or not ?
>    
>    Presence of some file in  linux /proc/xen and
> solaris /dev/xen/  ?
> 
>    Any platform independent way ? Some python API ?
> Any other ways?
> 
> Thanks
> /Jd
> 
> 
>        
> ______________________________________________________________________________
> ______
> Yahoo! oneSearch: Finally, mobile search
> that gives answers, not web links.
> http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
> 
> _______________________________________________
> 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