- Add file "fixes_for_4.17.patch" to follow API changes in kernel 4.17.

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=416
This commit is contained in:
Larry Finger 2018-04-17 12:58:34 +00:00 committed by Git OBS Bridge
parent 3d213d7ef9
commit ed8a70cdf5
3 changed files with 39 additions and 0 deletions

31
fixes_for_4.17.patch Normal file
View File

@ -0,0 +1,31 @@
In kernel 4.17, pci_get_bus_and_slot() has been removed in favor of
pci_get_domain_bus_and_slot(). It appears that VirtualBox only uses
domain number 0, thus pci_get_domain_bus_and_slot(0, bus, devfn)
is a suitable replacement for pci_get_bus_and_slot(bus, devfn).
The resulting code compiles; however, I do not use PCI passthru, which
I think means that I have not actually tested the code.
This patch released under a combined MIT/GPLv2 license.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Index: VirtualBox-5.2.8/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
===================================================================
--- VirtualBox-5.2.8.orig/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
+++ VirtualBox-5.2.8/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c
@@ -89,7 +89,14 @@ MODULE_VERSION(VBOX_VERSION_STRING " r"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
# define PCI_DEV_GET(v,d,p) pci_get_device(v,d,p)
# define PCI_DEV_PUT(x) pci_dev_put(x)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
+/* assume the domain number to be zero - exactly the same assumption of
+ * pci_get_bus_and_slot()
+ */
+# define PCI_DEV_GET_SLOT(bus, devfn) pci_get_domain_bus_and_slot(0, bus, devfn)
+#else
# define PCI_DEV_GET_SLOT(bus, devfn) pci_get_bus_and_slot(bus, devfn)
+#endif
#else
# define PCI_DEV_GET(v,d,p) pci_find_device(v,d,p)
# define PCI_DEV_PUT(x) do { } while (0)

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Apr 17 12:57:03 UTC 2018 - Larry.Finger@lwfinger.net
- Add file "fixes_for_4.17.patch" to follow API changes in kernel 4.17.
-------------------------------------------------------------------
Thu Mar 22 19:32:44 UTC 2018 - Larry.Finger@lwfinger.net

View File

@ -117,6 +117,8 @@ Patch120: fixes_for_python.patch
Patch121: remove_vbox_video_build.patch
# Fix build for kernel 4.16
Patch122: fixes_for_4.16.patch
# Fix build for kernel 4.17
Patch123: fixes_for_4.17.patch
#
BuildRequires: LibVNCServer-devel
BuildRequires: SDL-devel
@ -413,6 +415,7 @@ as an "extpack" for VirtualBox. The implementation is licensed under GPL.
# The patch for kernel 4.16 interferes with Leap 15 fixes
%patch122 -p1
%endif
%patch123 -p1
#copy user manual
cp %{SOURCE1} UserManual.pdf