Does anyone know if there is a way to programatically determine if code is running in a guest domain? Also, is there a way to get some information from the host? I''d like for example for a program running on a guest to find out the UUID of the guest. Is this possible at all? Thanks for your help. Juan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Andrew D. Ball
2006-Aug-14 19:42 UTC
Re: [Xen-users] getting domain info from inside a guest
Try looking for /sys/hypervisor/type and /sys/hypervisor/uuid inside of the domU. On recent versions of Xen, the first will have ''xen'' in it, and the second will have the domU. To determine whether you''re in a domU or a dom0, the best way I''ve seen so far is to look for control_d in /proc/xen/capabilities. It''s there for dom0, but not for domU''s. Does someone know of a better way to do this? Peace. Andrew On Mon, 2006-08-14 at 15:08 -0400, Juan Walker wrote:> Does anyone know if there is a way to programatically determine if > code is running in a guest domain? Also, is there a way to get some > information from the host? I''d like for example for a program running > on a guest to find out the UUID of the guest. Is this possible at > all? > > Thanks for your help. > > Juan > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On 8/14/06, Andrew D. Ball <aball@us.ibm.com> wrote:> > Try looking for > > /sys/hypervisor/type > > and > > /sys/hypervisor/uuid inside of the domU. > > On recent versions of Xen, the first will have ''xen'' in it, and the > second will have the domU.Ah. I seem to have /sys/hypervisor in my domU but it''s empty. Does this mean that I don''t have a recent enough Xen version? I''m using 3.0.2-2 now. Do you know what is the minimum version I need? Thanks. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Juan Walker wrote:> Ah. I seem to have /sys/hypervisor in my domU but it''s empty. Does this > mean that I don''t have a recent enough Xen version? I''m using 3.0.2-2 > now. Do you know what is the minimum version I need? Thanks.Do you have CONFIG_XEN_SYSFS enabled in your kernel? FYI, with 3.0.2 (using latest Gentoo ebuild) I have: /sys/hypervisor/ /sys/hypervisor/properties /sys/hypervisor/properties/writable_pt /sys/hypervisor/properties/virtual_start /sys/hypervisor/properties/changeset /sys/hypervisor/properties/capabilities /sys/hypervisor/compilation /sys/hypervisor/compilation/compile_date /sys/hypervisor/compilation/compiled_by /sys/hypervisor/compilation/compiler /sys/hypervisor/version /sys/hypervisor/version/extra /sys/hypervisor/version/minor /sys/hypervisor/version/major /sys/hypervisor/type Cheers Andrew _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users