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

Re: [Xen-users] How to find we are in Dom0 or DomU from a driver



Use xen_initial_domain() from xen/xen.h:

if (xen_initial_domain()) {
        /* Dom0-related code goes here*/
.....

On Fri, Jan 20, 2012 at 04:04:39PM +0530, Venkatesh P N wrote:
> Hi,
> 
> I am currently using Citrix Xen6.0 Server and installed a couple of guests on
> it.
> 
> I am writing a PCI driver common for Dom0 and DomU.
> In the driver, I need to write the code like
> 
> If I am in Dom0
> {
> Do Dom0 related ops (physical driver)
> }
> else
> {
> Do DomU related ops. (virtual driver)
> }
> 
> So, How can we find out whether we are in Dom0 or DomU from the driver level.
> Other than "/proc/xen/capabilities", is there any kernel function or data
> structure to find out this.
> 
> Thanks
> Petla Venkatesh
> 

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


_______________________________________________
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®.