Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
CFE-1563: Fix logic to detect when running under a Xen Hypervisor #2746
On Linux the Xen_Hv_Check() function can never be called because the stat on
Change the Xen_Hv_Check() function to scan the CPUID range from
When running cfengine with this change on a Xen guest the output looks like this:
Reviewed by: cy, gjb Approved by: cy Differential Revision: D8607
On Linux the Xen_Hv_Check() function can never be called because the stat on /proc/self/status will always return true which results in the OpenVZ_Detect() function always being called. Move the call to Xen_Hv_Check() to happen if the stat on /proc/xen/capabilities returns false since this is an indication that the host is acting as dom0. Change the Xen_Hv_Check() function to scan the CPUID range from 0x40000000 to 0x40010000 looking for Xen leaves. Return false if the class redhat_4 or centos_4 is defined to avoid a segfault on these platforms.