From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: Shell test for pv vs hvm (vs dom0) Date: Mon, 25 Feb 2008 05:58:28 -0700 Message-ID: <1203944308.7125.5.camel@lappy> References: Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "dan.magenheimer@oracle.com" , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Sat, 2008-02-23 at 08:18 +0000, Keir Fraser wrote: > There's no general way to discriminate between HVM and native from a shell > script. You might discriminate between HVM and PV on Linux by looking for > /sys/hypervisor or /proc/xen. Isn't something like this generally sufficient for a shell script? lspci -n | grep -q "5853:0001" if [ $? -eq 0 ]; then # HVM domain elif [ -d /proc/xen ]; then if grep -q "control_d" /proc/xen/capabilities; then # DOM0 else # DOMU fi else # Native fi It seems fairly reliable on ia64 for Xen 3.x. Thanks, Alex -- Alex Williamson HP Open Source & Linux Org.