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-users

Re: [Xen-users] Am I running under Xen?

To: "xen-users@xxxxxxxxxxxxxxxxxxx" <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] Am I running under Xen?
From: "Fajar A. Nugraha" <fajar@xxxxxxxxx>
Date: Mon, 03 Mar 2008 10:24:51 +0700
Delivery-date: Sun, 02 Mar 2008 19:25:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <47CB6A12.6020401@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <20080302215654.6358d3b4@zooty> <47CB6A12.6020401@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.12 (X11/20080227)
Matthew Haas wrote:
Tom Horsley wrote:
Is there a standard idiom most folks use to ask the
question: Am I a linux that was just booted under Xen?




If there is a nice guaranteed way of detecting a Paravirtualized domU (or if the machine is acting as a dom0), I would also be interested in knowing (basing it off strings in the kernel name isn't necessarily 100% guaranteed).

What RH did :
"if [ -e /proc/xen/xsd_kva -o ! -d /proc/xen ]; then"

First part detects a xen dom0, second part detects a native Linux.
To detect domU, you could put the code in the "else" part, or invert the test, e.g.

"if [ -d /proc/xen -a ! -e /proc/xen/xsd_kva ]; then"

Regards,

Fajar

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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