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@lists.xensource.com http://lists.xensource.com/xen-users
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@lists.xensource.com > http://lists.xensource.com/xen-users
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@lists.xensource.com > http://lists.xensource.com/xen-users