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

[Xen-devel] simple check for domU?


  • To: Xen development list <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Chris Bainbridge <chris.bainbridge@xxxxxxxxx>
  • Date: Fri, 11 Nov 2005 00:23:18 +0000
  • Delivery-date: Fri, 11 Nov 2005 00:23:24 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=mVc482qKmKo/4atKjhzgN81kUxh/sM/HOp1IxVGTx2geDPrK1gDJA79vMQbgzCnn5sbZyhl5L9HbEra1zRueBzbKJX31JnDiyU0t6hCCw2wTOzioY3TKva7CtTcMmpQNo2qqh3+7aDvAw2ICvAnTa1DBjrgka5mdL3s9E5hvgks=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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.

Thanks,
Chris

_______________________________________________
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®.