From ed8a70cdf5c42fd896879888bfc03f9dd2ecfbe7519891ca3c56e7fc8e78c0d2 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Tue, 17 Apr 2018 12:58:34 +0000 Subject: [PATCH] - 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 --- fixes_for_4.17.patch | 31 +++++++++++++++++++++++++++++++ virtualbox.changes | 5 +++++ virtualbox.spec | 3 +++ 3 files changed, 39 insertions(+) create mode 100644 fixes_for_4.17.patch diff --git a/fixes_for_4.17.patch b/fixes_for_4.17.patch new file mode 100644 index 0000000..c9e3903 --- /dev/null +++ b/fixes_for_4.17.patch @@ -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 + +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) diff --git a/virtualbox.changes b/virtualbox.changes index 2abc344..d55c2d0 100644 --- a/virtualbox.changes +++ b/virtualbox.changes @@ -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 diff --git a/virtualbox.spec b/virtualbox.spec index 4c42c82..134b9e2 100644 --- a/virtualbox.spec +++ b/virtualbox.spec @@ -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