From d401f6f5129da1f0bb7db927d9a1e7c60b8e8a66 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 7 Feb 2008 10:33:19 +0000 Subject: [PATCH] linux/x86: don't hardcode is_running_on_xen() for pv-on-hvm drivers Allowing graceful failure of these modules when inadvertently loaded on native kernels. Signed-off-by: Jan Beulich --- include/asm-i386/mach-xen/asm/hypervisor.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/asm-i386/mach-xen/asm/hypervisor.h b/include/asm-i386/mach-xen/asm/hypervisor.h index 6e31492b..5aaa5f30 100644 --- a/include/asm-i386/mach-xen/asm/hypervisor.h +++ b/include/asm-i386/mach-xen/asm/hypervisor.h @@ -145,7 +145,12 @@ u64 jiffies_to_st(unsigned long jiffies); #define MULTI_UVMDOMID_INDEX 4 #endif +#ifdef CONFIG_XEN #define is_running_on_xen() 1 +#else +extern char *hypercall_stubs; +#define is_running_on_xen() (!!hypercall_stubs) +#endif static inline int HYPERVISOR_yield( -- 2.39.5