From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: determining if kernel is dom0 kernel or not. Date: Wed, 11 Jul 2007 20:18:58 +0100 Message-ID: References: <650667.22602.qm@web35804.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <650667.22602.qm@web35804.mail.mud.yahoo.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: jd , xendevel List-Id: xen-devel@lists.xenproject.org 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" 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@lists.xensource.com > http://lists.xensource.com/xen-devel