From: Eduardo Habkost <[EMAIL PROTECTED]>

On 2.6.21 a new parameter was added to relay_open(). Handle this parameter
on kvm_relay_open() if needed.

Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>

diff --git a/kernel/external-module-compat-comm.h 
b/kernel/external-module-compat-comm.h
index 2499277..30d17fa 100644
--- a/kernel/external-module-compat-comm.h
+++ b/kernel/external-module-compat-comm.h
@@ -532,6 +532,25 @@ struct pci_dev *pci_get_bus_and_slot(unsigned int bus, 
unsigned int devfn);
 
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
+
+#include <linux/relay.h>
+
+/* relay_open() interface has changed on 2.6.21 */
+
+struct rchan *kvm_relay_open(const char *base_filename,
+                        struct dentry *parent,
+                        size_t subbuf_size,
+                        size_t n_subbufs,
+                        struct rchan_callbacks *cb,
+                        void *private_data);
+
+#else
+
+#define kvm_relay_open relay_open
+
+#endif
+
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
 
 static inline int get_user_pages_fast(unsigned long start, int nr_pages,
diff --git a/kernel/external-module-compat.c b/kernel/external-module-compat.c
index 4b9a9f2..c0a0355 100644
--- a/kernel/external-module-compat.c
+++ b/kernel/external-module-compat.c
@@ -276,3 +276,25 @@ int intel_iommu_found()
 }
 
 #endif
+
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)
+
+/* relay_open() interface has changed on 2.6.21 */
+
+struct rchan *kvm_relay_open(const char *base_filename,
+                        struct dentry *parent,
+                        size_t subbuf_size,
+                        size_t n_subbufs,
+                        struct rchan_callbacks *cb,
+                        void *private_data)
+{
+       struct rchan *chan = relay_open(base_filename, parent,
+                                       subbuf_size, n_subbufs,
+                                       cb);
+       if (chan)
+               chan->private_data = private_data;
+       return chan;
+}
+
+#endif
diff --git a/kernel/x86/hack-module.awk b/kernel/x86/hack-module.awk
index 7f59483..c3fa51e 100644
--- a/kernel/x86/hack-module.awk
+++ b/kernel/x86/hack-module.awk
@@ -1,5 +1,5 @@
 BEGIN { split("INIT_WORK tsc_khz desc_struct ldttss_desc64 desc_ptr " \
-             "on_each_cpu" , compat_apis); }
+             "on_each_cpu relay_open" , compat_apis); }
 
 /^int kvm_init\(/ { anon_inodes = 1 }
 
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to