All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Bainbridge <chris.bainbridge@gmail.com>
To: NAHieu <nahieu@gmail.com>
Cc: Xen development list <xen-devel@lists.xensource.com>
Subject: Re: simple check for domU?
Date: Fri, 11 Nov 2005 20:33:04 +0000	[thread overview]
Message-ID: <623652d50511111233n6bc7d9en@mail.gmail.com> (raw)
In-Reply-To: <5d7aca950511111014je734b7fxe5ce488cd6573bd5@mail.gmail.com>

On 11/11/05, NAHieu <nahieu@gmail.com> wrote:
> On 11/11/05, Chris Bainbridge <chris.bainbridge@gmail.com> wrote:
> > Hi, is there a simple way to check that we're running under a domU? So
> > far I came up with:
> >
> > [[ -d /proc/xen && ! -z `ls /sys/bus/xen/devices/` ]]
> >
> > or
> >
> > -e /sys/bus/xen/drivers/vbd || -e /sys/bus/xen/drivers/vif
> >
> > Neither of which is pretty, and I'm not convinced they work under all
> > circumstances. This is useful for system setup scripts to do different
> > things depending if they are run under dom0/U.
>
> That is easy. Something you will never see in domU, such as
> xenconsoled, xenstored,...
>
> So check for the presence of these daemons is a good way, especially
> that requires no privileged access.

It is quite possible that someone has these daemons installed in a
domU fs. Maybe you mean check if the process is running? Even that is
problematic; it's possible to run a xen0 kernel without those daemons.
Besides, how do we differentiate between a domU kernel and a standard
kernel?

If there's no easy and reliable way to do this maybe one should be added?

  reply	other threads:[~2005-11-11 20:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-11  0:23 simple check for domU? Chris Bainbridge
2005-11-11  1:52 ` Karsten M. Self
2005-11-11 16:21   ` Chris Bainbridge
2005-11-11 18:14 ` NAHieu
2005-11-11 20:33   ` Chris Bainbridge [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-11-12  1:33 James Harper
2005-11-12  2:26 ` Chris Bainbridge

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=623652d50511111233n6bc7d9en@mail.gmail.com \
    --to=chris.bainbridge@gmail.com \
    --cc=nahieu@gmail.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.