All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keir Fraser <keir@xensource.com>
To: jd <jdsw2002@yahoo.com>, xendevel <xen-devel@lists.xensource.com>
Subject: Re: determining if kernel is dom0 kernel or not.
Date: Wed, 11 Jul 2007 20:18:58 +0100	[thread overview]
Message-ID: <C2BAEBB2.1248B%keir@xensource.com> (raw)
In-Reply-To: <650667.22602.qm@web35804.mail.mud.yahoo.com>

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@yahoo.com> 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

  reply	other threads:[~2007-07-11 19:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11 18:40 determining if kernel is dom0 kernel or not jd
2007-07-11 19:18 ` Keir Fraser [this message]
2007-07-11 20:38   ` Ian Campbell
2007-07-11 21:39     ` Keir Fraser
2007-07-11 22:04       ` jd
2007-07-12 13:35         ` Mark Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C2BAEBB2.1248B%keir@xensource.com \
    --to=keir@xensource.com \
    --cc=jdsw2002@yahoo.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.