Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > aadbe78a25743146bb784eee19f007c5 > files > 248

kvm-83-164.el5_5.9.src.rpm

From 92e1a58eafd31173f1448bd4e6ce4dd1c8981b7a Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@redhat.com>
Date: Tue, 24 Nov 2009 19:43:08 -0200
Subject: [PATCH 10/11] build fix: add pci_get_bus_and_slot() to compat_apis

RH-Author: Eduardo Habkost <ehabkost@redhat.com>
Message-id: <20091120194430.GB30651@blackpad.lan.raisama.net>
Patchwork-id: 3747
O-Subject: [RHEL-5.5 KVM PATCH] build fix: add pci_get_bus_and_slot() to
	compat_apis
Bugzilla: 539589
RH-Acked-by: Juan Quintela <quintela@redhat.com>
RH-Acked-by: john cooper <john.cooper@redhat.com>
RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com>

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=539589

kernel-2.6.18-174.el5 now includes a native pci_get_bus_and_slot(), that
conflicts with our compat version of the function.

Like on the smp_call_function() case, this patch only changes the compat code
to not conflict with the native function, so we can get KVM to compile again
without any behavior changes.

After we fix the build and restore the previous behavior, we can change KVM to
use the native version of the function. This will be tracked at:
https://bugzilla.redhat.com/show_bug.cgi?id=539642

This issue is preventing us from submitting new RHEL-5.5 KVM packages to
build on Brew.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 kernel/external-module-compat-comm.h |    2 +-
 kernel/external-module-compat.c      |    2 +-
 kernel/x86/hack-module.awk           |    3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 kernel/external-module-compat-comm.h |    2 +-
 kernel/external-module-compat.c      |    2 +-
 kernel/x86/hack-module.awk           |    3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/external-module-compat-comm.h b/kernel/external-module-compat-comm.h
index e26be1a..8536c87 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -562,7 +562,7 @@ static inline int cancel_work_sync(struct work_struct *work)
 
 struct pci_dev;
 
-struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
+struct pci_dev *kvm_pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
 
 #endif
 
diff --git a/kernel/external-module-compat.c b/kernel/external-module-compat.c
index 53d7983..1889500 100644
--- a/kernel/external-module-compat.c
+++ b/kernel/external-module-compat.c
@@ -311,7 +311,7 @@ struct timespec kvm_ns_to_timespec(const s64 nsec)
 
 #include <linux/pci.h>
 
-struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn)
+struct pci_dev *kvm_pci_get_bus_and_slot(unsigned int bus, unsigned int devfn)
 {
 	struct pci_dev *dev = NULL;
 
diff --git a/kernel/x86/hack-module.awk b/kernel/x86/hack-module.awk
index 5f1cb41..4949906 100644
--- a/kernel/x86/hack-module.awk
+++ b/kernel/x86/hack-module.awk
@@ -3,7 +3,8 @@ BEGIN { split("INIT_WORK tsc_khz desc_struct ldttss_desc64 desc_ptr " \
 	      "hrtimer_get_expires_ns hrtimer_start_expires " \
 	      "hrtimer_expires_remaining smp_send_reschedule " \
 	      "on_each_cpu relay_open request_irq free_irq " \
-	      "get_user_pages_fast smp_call_function_many" , compat_apis); }
+	      "get_user_pages_fast smp_call_function_many " \
+	      "pci_get_bus_and_slot" , compat_apis); }
 
 /^int kvm_init\(/ { anon_inodes = 1 }
 
-- 
1.6.3.rc4.29.g8146