From 0613a84ab5e9f8e95074eb81b39a41f246df0c043f5d206b8136e657971841c2 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Wed, 20 Mar 2019 19:32:50 +0000 Subject: [PATCH] - Fix API changes for kernel 5.1.0 - add file "fixes_for_5.1.patch". OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=473 --- fixes_for_5.1.patch | 42 ++++++++++++++++++++++++++++++++++++++++++ virtualbox.changes | 5 +++++ virtualbox.spec | 4 ++++ 3 files changed, 51 insertions(+) create mode 100644 fixes_for_5.1.patch diff --git a/fixes_for_5.1.patch b/fixes_for_5.1.patch new file mode 100644 index 0000000..d15034d --- /dev/null +++ b/fixes_for_5.1.patch @@ -0,0 +1,42 @@ +Index: VirtualBox-6.0.4/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +=================================================================== +--- VirtualBox-6.0.4.orig/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c ++++ VirtualBox-6.0.4/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c +@@ -38,6 +38,9 @@ + #include + #include + #include "internal/memobj.h" ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) ++#include ++#endif + + + /********************************************************************************************************************************* +Index: VirtualBox-6.0.4/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c +=================================================================== +--- VirtualBox-6.0.4.orig/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c ++++ VirtualBox-6.0.4/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c +@@ -372,7 +372,7 @@ static int vboxPciFileWrite(struct file* + mm_segment_t fs_save; + + fs_save = get_fs(); +- set_fs(get_ds()); ++ set_fs(KERNEL_DS); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) + ret = kernel_write(file, data, size, &offset); + #else +Index: VirtualBox-6.0.4/src/VBox/Additions/linux/sharedfolders/regops.c +=================================================================== +--- VirtualBox-6.0.4.orig/src/VBox/Additions/linux/sharedfolders/regops.c ++++ VirtualBox-6.0.4/src/VBox/Additions/linux/sharedfolders/regops.c +@@ -588,7 +588,9 @@ static int sf_reg_release(struct inode * + return 0; + } + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) ++static vm_fault_t sf_reg_fault(struct vm_fault *vmf) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) + static int sf_reg_fault(struct vm_fault *vmf) + #elif LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25) + static int sf_reg_fault(struct vm_area_struct *vma, struct vm_fault *vmf) diff --git a/virtualbox.changes b/virtualbox.changes index 4cf8f14..def803a 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Mar 20 19:31:19 UTC 2019 - Larry Finger + +- Fix API changes for kernel 5.1.0 - add file "fixes_for_5.1.patch". + ------------------------------------------------------------------- Wed Feb 20 16:31:23 UTC 2019 - Larry Finger diff --git a/virtualbox.spec b/virtualbox.spec index 2fb9c3c..06a91fb 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -133,6 +133,9 @@ Patch126: fixes_for_5.0.patch Patch128: fix_lib_search.patch # Fixes for modified kernel in Leap 15.1 Patch129: fixes_for_Leap15.1.patch +# Fixes for kernel 5.1 +Patch130: fixes_for_5.1.patch +#endif # BuildRequires: LibVNCServer-devel BuildRequires: SDL-devel @@ -434,6 +437,7 @@ as an "extpack" for VirtualBox. The implementation is licensed under GPL. %patch126 -p1 %patch128 -p1 %patch129 -p1 +%patch130 -p1 #copy user manual cp %{SOURCE1} UserManual.pdf