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: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Programatically checking if we're in a domU or dom0
From: Parissa Heidari <parisa.heidari@xxxxxxxxxx>
Date: Wed, 4 Oct 2006 13:11:39 -0400
Cc: Lutrin Jean <jeanlutrin@xxxxxxxx>
Delivery-date: Wed, 04 Oct 2006 10:12:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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
User-agent: KMail/1.9.1
Hi, 
I'm not sure if I see exactly what you mean. I did change the hostname of each 
domU in the /etc/hostname of each domain. For example XX for dom0, XX-domU1 
for my first domU , XX_domU2 for the second one  and so on. Then in each 
console I have a different name. Besides it's possible to check 
the /etc/hostname for the U extension or what ever you have considered for 
the unprivileged domains name.
Did I get your question?

Parissa.

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

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