From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Bainbridge Subject: Re: simple check for domU? Date: Fri, 11 Nov 2005 16:21:00 +0000 Message-ID: <623652d50511110821w341cc213x@mail.gmail.com> References: <623652d50511101623q533a8e04r@mail.gmail.com> <20051111015228.GC3558@karstenlx.eng.hq.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20051111015228.GC3558@karstenlx.eng.hq.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 11/11/05, Karsten M. Self wrote: > on Fri, Nov 11, 2005 at 12:23:18AM +0000, Chris Bainbridge (chris.bainbri= dge@gmail.com) 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. I'm looking specifically for domU and not dom0 (well, it would be useful to have a reliable way of identifying both). /proc/xen will be present in dom0 and uname depends on the kernel EXTRAVERSION which isn't guaranteed.