From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akio Takebe Subject: Re: [RFC] Is this process running on which machine? Date: Tue, 28 Nov 2006 13:00:14 +0900 Message-ID: <2C712A1B5A045takebe_akio@jp.fujitsu.com> References: <1164078197.24087.56.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: xen-devel@lists.xensource.com, Ewan Mellor , "Andrew D. Ball" Cc: Akio Takebe List-Id: xen-devel@lists.xenproject.org Hi, I remake it again. I tested native, dom0, domU, domVTx on x86. If you have comments, please give me. ---------------------------------------------------------- #!/bin/bash declare -i IS_HVM=0 declare -i IS_PARA=0 check_hvm() { IS_X86HVM="$(strings /proc/acpi/dsdt | grep int-xen)" if [ x"${IS_X86HVM}" != x ]; then echo "x86hvm" IS_HVM=1 fi } check_para() { if $(grep -q control_d /proc/xen/capabilities); then echo "dom0" IS_PARA=1 else echo "domU" IS_PARA=1 fi } #### main #### if [ -f /proc/acpi/dsdt ]; then check_hvm fi if [ ${IS_HVM} -eq 0 ]; then if [ -f /proc/xen/capabilities ] ; then check_para fi fi if [ ${IS_HVM} -eq 0 -a ${IS_PARA} -eq 0 ]; then echo "native" fi ---------------------------------------------------------- Best Regards, Akio Takebe