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] Programatically checking if we're in a domU or dom0

To: "Lutrin Jean" <jeanlutrin@xxxxxxxx>, <xen-users@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-users] Programatically checking if we're in a domU or dom0
From: Grok Mogger <linuximp@xxxxxxxxx>
Date: Wed, 4 Oct 2006 10:07:40 -0400
Delivery-date: Wed, 04 Oct 2006 07:08:37 -0700
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:in-reply-to:x-mimeole:importance:from; b=PVLRPi0fLywFqDiQbWLmcsuIyl5kGFDXVqQoshxSb6vpzM6S913LtkzHHoEq7XBi/Ps6a8ye3MpVAZH95jUFhF02Ud1FYzD4WNLdyStzPDq54hsqXSa5pO1jj5TKpOEF8UYZjP/+hURkD702CZ9Ibz9vz9Y6ZfXAHwcKHryg+pk=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
Importance: Normal
In-reply-to: <20061004135137.80257.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
This might be a somewhat silly way of doing it....  but could you make an
identical copy of your xen kernel for all your DomU's, but rename it to
something else?

Then maybe instead of a 'uname -r' giving you something like...
2.6.16-xen
You could get something like...
2.6.16-xen-DomU

Not sure if that'll help, but maybe...?
- GM

-----Original Message-----
From: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:xen-users-bounces@xxxxxxxxxxxxxxxxxxx]On Behalf Of Lutrin Jean
Sent: Wednesday, October 04, 2006 9:52 AM
To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Programatically checking if we're in a domU or
dom0


> Personally, I use the following command in a
> startup script to check if we're in a privileged
> domain:
>
> grep -qsE '^control_d$' /proc/xen/capabilities

Hi Andrew,

thanks for your tip.

Now I can easily determine wether I'm running
on a modified kernel or not (by checking for
the presence of /proc/xen).

However, once I've found that, I'd like to know
if I'm on a priviledged domain or not.

Sadly my /proc/xen/capabilities is only readable
by root.

What would be a clean way to check for this from
a normal user account?








___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son
interface révolutionnaire.
http://fr.mail.yahoo.com

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.0.407 / Virus Database: 268.12.12/462 - Release Date: 10/3/2006

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.0.407 / Virus Database: 268.12.12/462 - Release Date: 10/3/2006


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