WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [RFC] Is this process running on which machine?

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [RFC] Is this process running on which machine?
From: Akio Takebe <takebe_akio@xxxxxxxxxxxxxx>
Date: Sat, 18 Nov 2006 18:10:57 +0900
Delivery-date: Sat, 18 Nov 2006 01:09:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel