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: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-devel] simple check for domU?
From: "Karsten M. Self" <kself@xxxxxxxxxxxxx>
Date: Thu, 10 Nov 2005 17:52:28 -0800
Delivery-date: Fri, 11 Nov 2005 15:59:41 +0000
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>
Mail-followup-to: xen-devel@xxxxxxxxxxxxxxxxxxx
References: <623652d50511101623q533a8e04r@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
on Fri, Nov 11, 2005 at 12:23:18AM +0000, 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:

Try:

    uname -r | grep -q -- -xen

... which generally works.  'test -d /proc/xen' is pretty reliable as
well.
 
> [[ -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.
> 
> Thanks,
> Chris
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

-- 
Karsten M. Self <karsten@xxxxxxxxxxxxx>
XenSource, Inc.
2300 Geng Road #250                                +1 650.798.5900 x259
Palo Alto, CA 94303                                +1 650.493.1579 fax

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

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