Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 340e01248478ba8b78a6d4d1809b1eff > files > 562

kvm-83-270.el5_11.src.rpm

From 2ffe8382602a22770cd8f258659006f2c88d9c71 Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Mon, 27 Sep 2010 17:47:56 -0300
Subject: [PATCH 1/2] kmod: move cancel_work_sync availability test to configure

RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <1285609677-21847-2-git-send-email-ehabkost@redhat.com>
Patchwork-id: 12309
O-Subject: [RHEL-5.6 KVM PATCH 1/2] kmod: move cancel_work_sync availability
	test to configure
Bugzilla: 539642
RH-Acked-by: Zachary Amsden <zamsden@redhat.com>
RH-Acked-by: Don Dutile <ddutile@redhat.com>

Instead of testing for the feature every time the Makefile is loaded, run the
test on configure and store the results on kernel/config.kbuild.

Bugzilla: 539642

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 configure       |   10 ++++++++++
 kernel/Makefile |    4 ----
 2 files changed, 10 insertions(+), 4 deletions(-)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 configure       |   10 ++++++++++
 kernel/Makefile |    4 ----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index 493c178..853cb18 100755
--- a/configure
+++ b/configure
@@ -137,6 +137,15 @@ if [ -n "$no_uname" ]; then
     fi
 fi
 
+
+# check for kernel features that can't be tested by the preprocessor:
+if grep -q cancel_work_sync "$kerneldir/include/linux/workqueue.h";then
+	has_cancel_work_sync=1
+else
+	has_cancel_work_sync=0
+fi
+
+
 #configure user dir
 (cd user; ./configure --prefix="$prefix" --kerneldir="$libkvm_kerneldir" \
           --arch="$arch" --processor="$processor" \
@@ -172,4 +181,5 @@ EOF
 
 cat <<EOF > kernel/config.kbuild
 EXT_CONFIG_KVM_TRACE=$kvm_trace
+HAS_CANCEL_WORK_SYNC=$has_cancel_work_sync
 EOF
diff --git a/kernel/Makefile b/kernel/Makefile
index 6ac9dd0..d47dedb 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -21,10 +21,6 @@ LINUX = ../linux-2.6
 
 version = $(shell cd $(LINUX); git describe)
 
-# there is no preprocessor macro that can be tested to detect the availability
-# of cancel_work_sync(), so check it using 'grep' before building the modules
-HAS_CANCEL_WORK_SYNC := $(shell grep -q cancel_work_sync $(KERNELDIR)/include/linux/workqueue.h && echo 1 || echo 0)
-
 _hack = mv $1 $1.orig && \
 	gawk -v version=$(version) -f $(ARCH_DIR)/hack-module.awk $1.orig \
 	    | sed '/\#include/! s/\blapic\b/l_apic/g' > $1 && rm $1.orig
-- 
1.6.5.5