From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akio Takebe Subject: [RFC] Is this process running on which machine? Date: Sat, 18 Nov 2006 18:10:57 +0900 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: 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 Hi, all I'd like to know "Is this process running on which machine?" For example, a native machien, or dom0, or domU, or HVM.. So I research codes of xen, then I make the following shell. (I haven't confirmed HVM yet because I don't use VTx machine.) What do you think about it? ========================================================================= #!/bin/bash if [ -d /sys/hypervisor ] ; then UUID=$(cat /sys/hypervisor/uuid) if [ x"$UUID" == x"00000000-0000-0000-0000-000000000000" ]; then echo "this is dom0." else echo "this is domU." fi else IS_HVM=$(strings /proc/acpi/dsdt | grep -i xen) if [ x"IS_HVM" != x ]; then echo "this is hvm machine" else echo "this is native machine" fi fi ========================================================================= Best Regards, Akio Takebe