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

[Xen-changelog] [linux-2.6.18-xen] linux/x86: don't hardcode is_running_on_xen() for pv-on-hvm drivers



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1202380399 0
# Node ID 5c61cd349b208a19fd7e9c8d07963166690a3de4
# Parent  f85259abcddf3da59752e8032c4ea557243b97cd
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 <jbeulich@xxxxxxxxxx>
---
 include/asm-i386/mach-xen/asm/hypervisor.h |    5 +++++
 1 files changed, 5 insertions(+)

diff -r f85259abcddf -r 5c61cd349b20 include/asm-i386/mach-xen/asm/hypervisor.h
--- a/include/asm-i386/mach-xen/asm/hypervisor.h        Tue Feb 05 10:05:19 
2008 +0000
+++ b/include/asm-i386/mach-xen/asm/hypervisor.h        Thu Feb 07 10:33:19 
2008 +0000
@@ -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(

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.