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: Chris Bainbridge <chris.bainbridge@xxxxxxxxx>
Subject: Re: [Xen-devel] simple check for domU?
From: NAHieu <nahieu@xxxxxxxxx>
Date: Sat, 12 Nov 2005 03:14:53 +0900
Cc: Xen development list <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 11 Nov 2005 18:14:59 +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=X3Pk1qy7WrNi/rVJkCfQf46yCgYp68r4iNKJYRpM9et981V4m5wdxceDjI/NeU1tE4cdfqb463ygS+1PC6dAgRi6lhRKf6v4Bc7lmO5OqmEhMoyyQ2sD5fTMb1eEKDXevKS+YselN0vKkH3ap3SR7Jeo9zo/+EugJe9dU5Crmk4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <623652d50511101623q533a8e04r@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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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.

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

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