[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] simple check for domU?



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.