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] simple check for domU?

To: NAHieu <nahieu@xxxxxxxxx>
Subject: Re: [Xen-devel] simple check for domU?
From: Chris Bainbridge <chris.bainbridge@xxxxxxxxx>
Date: Fri, 11 Nov 2005 20:33:04 +0000
Cc: Xen development list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 11 Nov 2005 20:33:12 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PDKJ5AU1wrWEmGMCSLcxMJgHHcaMUBOOj3+p6W911Gr3UHxWrLl5DQBIWgDLY5/MMjlDnWrkM434xTR9hwGQWYdiu4tWeUYGjG2jh0g6OHcgIzi+6DiFujJP1B4v/LLlJDXF5l2WWGBqpXs/bhFn5tqOoTA+Th5swwCxDLXXPTM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <5d7aca950511111014je734b7fxe5ce488cd6573bd5@xxxxxxxxxxxxxx>
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: <623652d50511101623q533a8e04r@xxxxxxxxxxxxxx> <5d7aca950511111014je734b7fxe5ce488cd6573bd5@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On 11/11/05, NAHieu <nahieu@xxxxxxxxx> wrote:
> On 11/11/05, Chris Bainbridge <chris.bainbridge@xxxxxxxxx> 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?

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

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