From e3acf17ab09d29bc2b550fd3da153d3fdd655c9e Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Mon, 11 Feb 2008 12:26:08 +0100 Subject: [PATCH] kvm: external module: fix include directory priority issue Add a new include-compat/ directory for supplying headers which are missing on older Linux releases. The include order is now - kvm headers from 'make sync' - linux headers from $KERNELDIR - include-compat/ Signed-off-by: Andrea Arcangeli Signed-off-by: Avi Kivity --- kernel/Makefile | 12 +++++++++--- kernel/external-module-compat.h | 4 ++-- kernel/{include => include-compat}/asm-x86/cmpxchg.h | 2 -- kernel/{include => include-compat}/linux/anon_inodes.h | 1 - kernel/{include => include-compat}/linux/magic.h | 0 kernel/{include => include-compat}/linux/mutex.h | 2 -- 6 files changed, 11 insertions(+), 10 deletions(-) rename kernel/{include => include-compat}/asm-x86/cmpxchg.h (97%) rename kernel/{include => include-compat}/linux/anon_inodes.h (99%) rename kernel/{include => include-compat}/linux/magic.h (100%) rename kernel/{include => include-compat}/linux/mutex.h (97%) diff --git a/kernel/Makefile b/kernel/Makefile index 7a435b57..9334468d 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -25,18 +25,23 @@ hack = $(call _hack,tmp/$(strip $1)) unifdef = $(call _unifdef,tmp/$(strip $1)) all:: - $(MAKE) -C $(KERNELDIR) M=`pwd` "$$@" + # include header priority 1) $LINUX 2) $KERNELDIR 3) include-compat + $(MAKE) -C $(KERNELDIR) M=`pwd` \ + LINUXINCLUDE="-I`pwd`/include -Iinclude -I`pwd`/include-compat \ + -include include/linux/autoconf.h" \ + "$$@" sync: - rm -rf tmp + rm -rf tmp include rsync --exclude='*.mod.c' -R \ "$(LINUX)"/arch/x86/kvm/./*.[ch] \ "$(LINUX)"/virt/kvm/./*.[ch] \ "$(LINUX)"/./include/linux/kvm*.h \ "$(LINUX)"/./include/asm-x86/kvm*.h \ tmp/ - rm -rf include/asm + mkdir -p include/linux include/asm-x86 ln -s asm-x86 include/asm + ln -sf asm-x86 include-compat/asm $(call unifdef, include/linux/kvm.h) $(call unifdef, include/linux/kvm_para.h) @@ -78,6 +83,7 @@ rpm: all clean: $(MAKE) -C $(KERNELDIR) M=`pwd` $@ + rm -rf include svnclean: svn st | grep '^\?' | awk '{print $2}' | xargs rm -rf diff --git a/kernel/external-module-compat.h b/kernel/external-module-compat.h index cbfa3ed9..3b459994 100644 --- a/kernel/external-module-compat.h +++ b/kernel/external-module-compat.h @@ -10,8 +10,8 @@ #include #include #include -#include "include/linux/kvm.h" -#include "include/linux/kvm_para.h" +#include +#include #include #include #include diff --git a/kernel/include/asm-x86/cmpxchg.h b/kernel/include-compat/asm-x86/cmpxchg.h similarity index 97% rename from kernel/include/asm-x86/cmpxchg.h rename to kernel/include-compat/asm-x86/cmpxchg.h index 4258b93b..68daeebc 100644 --- a/kernel/include/asm-x86/cmpxchg.h +++ b/kernel/include-compat/asm-x86/cmpxchg.h @@ -1,5 +1,3 @@ /* * Empty file to satisfy #include for older kernels. */ - - diff --git a/kernel/include/linux/anon_inodes.h b/kernel/include-compat/linux/anon_inodes.h similarity index 99% rename from kernel/include/linux/anon_inodes.h rename to kernel/include-compat/linux/anon_inodes.h index b2e1ba32..3092c4e4 100644 --- a/kernel/include/linux/anon_inodes.h +++ b/kernel/include-compat/linux/anon_inodes.h @@ -13,4 +13,3 @@ int anon_inode_getfd(int *pfd, struct inode **pinode, struct file **pfile, void *priv); #endif /* _LINUX_ANON_INODES_H */ - diff --git a/kernel/include/linux/magic.h b/kernel/include-compat/linux/magic.h similarity index 100% rename from kernel/include/linux/magic.h rename to kernel/include-compat/linux/magic.h diff --git a/kernel/include/linux/mutex.h b/kernel/include-compat/linux/mutex.h similarity index 97% rename from kernel/include/linux/mutex.h rename to kernel/include-compat/linux/mutex.h index 71b2ae10..449905c0 100644 --- a/kernel/include/linux/mutex.h +++ b/kernel/include-compat/linux/mutex.h @@ -1,5 +1,3 @@ /* * Empty file to satisfy #include for older kernels. */ - - -- 2.11.4.GIT