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: "Fajar A. Nugraha" <fajar@xxxxxxxxx>
Subject: Re: [Xen-users] Am I running under Xen?
From: Nico Kadel-Garcia <nkadel@xxxxxxxxx>
Date: Mon, 03 Mar 2008 08:57:58 +0000
Cc: "xen-users@xxxxxxxxxxxxxxxxxxx" <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 03 Mar 2008 00:53:28 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=kwlOyvBYwvh9hGwgsnq+ByzXvWirULtg9ThZh+WinCU=; b=LUwbaSBstlldl/pgFGRHqwtX1UiMg2zOZxLD0jghpT86msS+F0VJmFyWTTQ7gSrU+Ce28xbTyCDI94vvhHt1DfptdJhO1odR6FbrgHR93QFOu2kKcNPzhpXqLPE6W60qnPUI+M9ztSofjFCosp5Dg2FmCpzUwFJPSMbjoVaL1FI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=jvNwP03EvWO+Jy/k7PqBoJmFovA40tc9AX3CM49dz+aC653ts7HoTtdGbGvnCjTxSXoa5BE2GB51aa649N7wNXOvjnVToZkA0hTN4gu5l3xffBNVVXUKi5l2SMekK2KU3DSLECnffW2u/CK9uxX6hk35Wf9R/rX6+Nw2VCSNCO0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <47CB6F83.3060000@xxxxxxxxx>
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> <47CB6F83.3060000@xxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)
Fajar A. Nugraha wrote:
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
Also, if you have a well-defined practice of using the Xen-provided prefix in your MAC addresses, you can identify them that way, at least on localhost.

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