[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: "Fajar A. Nugraha" <fajar@xxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.