1
0
forked from pool/virtualbox

Accepting request 965783 from home:lwfinger:branches:Virtualization

- Update fixes for kernel 5.17.
  Add fixes for kernel 5.18 - file "fixes_for_kernel_5.18.patch" added

- Fix build error for guest modules in Leap 15.3

OBS-URL: https://build.opensuse.org/request/show/965783
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=628
This commit is contained in:
Larry Finger 2022-03-30 01:06:55 +00:00 committed by Git OBS Bridge
parent 61d06d19c9
commit aa9cd92c07
5 changed files with 210 additions and 1 deletions

View File

@ -0,0 +1,68 @@
Index: VirtualBox-6.1.32/src/VBox/Additions/linux/drm/vbox_drv.c
===================================================================
--- VirtualBox-6.1.32.orig/src/VBox/Additions/linux/drm/vbox_drv.c
+++ VirtualBox-6.1.32/src/VBox/Additions/linux/drm/vbox_drv.c
@@ -50,6 +50,19 @@
#include "version-generated.h"
#include "revision-generated.h"
+/** Detect whether kernel mode setting is OFF. */
+#if defined(CONFIG_VGA_CONSOLE)
+# if RTLNX_VER_MIN(5,17,0)
+# define VBOX_VIDEO_NOMODESET() drm_firmware_drivers_only() && vbox_modeset == -1
+# elif RTLNX_VER_MIN(4,7,0)
+# define VBOX_VIDEO_NOMODESET() vgacon_text_force() && vbox_modeset == -1
+# else /* < 4.7.0 */
+# define VBOX_VIDEO_NOMODESET() 0
+# endif /* < 4.7.0 */
+#else /* !CONFIG_VGA_CONSOLE */
+# define VBOX_VIDEO_NOMODESET() 0
+#endif /* !CONFIG_VGA_CONSOLE */
+
static int vbox_modeset = -1;
MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
@@ -401,15 +414,13 @@ static struct drm_driver driver = {
static int __init vbox_init(void)
{
printk("vboxvideo: loading version " VBOX_VERSION_STRING " r" __stringify(VBOX_SVN_REV) "\n");
-#if defined(CONFIG_VGA_CONSOLE) || RTLNX_VER_MIN(4,7,0)
- if (vgacon_text_force() && vbox_modeset == -1)
+ if (VBOX_VIDEO_NOMODESET())
{
printk("vboxvideo: kernel is running with *nomodeset* parameter,\n");
printk("vboxvideo: please consider either to remove it or load driver\n");
printk("vboxvideo: with parameter modeset=1, unloading\n");
return -EINVAL;
}
-#endif
if (vbox_modeset == 0)
{
Index: VirtualBox-6.1.32/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
===================================================================
--- VirtualBox-6.1.32.orig/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
+++ VirtualBox-6.1.32/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
@@ -66,6 +66,12 @@
#define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface))
+/** Set netdev MAC address. */
+#if RTLNX_VER_MIN(5,17,0)
+# define VBOX_DEV_ADDR_SET(dev, addr, len) dev_addr_mod(dev, 0, addr, len)
+#else /* < 5.17.0 */
+# define VBOX_DEV_ADDR_SET(dev, addr, len) memcpy(dev->dev_addr, addr, len)
+#endif
/*********************************************************************************************************************************
* Internal Functions *
@@ -303,7 +309,7 @@ int vboxNetAdpOsCreate(PVBOXNETADP pThis
if (pNetDev->dev_addr)
{
- memcpy(pNetDev->dev_addr, pMACAddress, ETH_ALEN);
+ VBOX_DEV_ADDR_SET(pNetDev, pMACAddress, ETH_ALEN);
Log2(("vboxNetAdpOsCreate: pNetDev->dev_addr = %.6Rhxd\n", pNetDev->dev_addr));
/*

View File

@ -0,0 +1,18 @@
Index: VirtualBox-6.1.32/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
===================================================================
--- VirtualBox-6.1.32.orig/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
+++ VirtualBox-6.1.32/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c
@@ -2314,8 +2314,13 @@ int vboxNetFltPortOsXmit(PVBOXNETFLTINS
{
vboxNetFltDumpPacket(pSG, true, "host", (fDst & INTNETTRUNKDIR_WIRE) ? 0 : 1);
Log6(("vboxNetFltPortOsXmit: pBuf->cb dump:\n%.*Rhxd\n", sizeof(pBuf->cb), pBuf->cb));
+# if RTLNX_VER_MAX(5, 18, 0)
Log6(("vboxNetFltPortOsXmit: netif_rx_ni(%p)\n", pBuf));
err = netif_rx_ni(pBuf);
+#else
+ Log6(("vboxNetFltPortOsXmit: netif_rx(%p)\n", pBuf));
+ err = netif_rx(pBuf);
+#endif
if (err)
rc = RTErrConvertFromErrno(err);
}

View File

@ -25,7 +25,7 @@ Index: VirtualBox-6.1.26/src/VBox/Additions/linux/drm/vbox_drv.c
- .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ |
+#if RTLNX_VER_MAX(5,4,0)
+ .driver_features =
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
+#if defined(OPENSUSE_152)
+ DRIVER_PRIME |
+#endif
# if RTLNX_VER_MAX(5,1,0) && !RTLNX_RHEL_MAJ_PREREQ(8,1)

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Tue Mar 29 19:01:11 UTC 2022 - Larry Finger <Larry.Finger@gmail.com>
- Update fixes for kernel 5.17.
Add fixes for kernel 5.18 - file "fixes_for_kernel_5.18.patch" added
-------------------------------------------------------------------
Fri Mar 11 18:45:02 UTC 2022 - Larry Finger <Larry.Finger@gmail.com>
- Fix build error for guest modules in Leap 15.3
-------------------------------------------------------------------
Thu Jan 20 17:19:56 UTC 2022 - Larry Finger <Larry.Finger@gmail.com>

View File

@ -179,6 +179,8 @@ Patch137: handle_gsoap_208103.patch
Patch142: fixes_for_leap15.3.patch
Patch143: vb-6.1.16-modal-dialog-parent.patch
Patch144: fixes_for_leap15.4.patch
Patch145: fixes_for_kernel_5.17.patch
Patch146: fixes_for_kernel_5.18.patch
Patch999: virtualbox-fix-ui-background-color.patch
#
# Common BuildRequires for both virtualbox and virtualbox-kmp
@ -310,12 +312,24 @@ the terms of the GNU Public License (GPL).
##########################################
%package qt
Summary: Qt GUI part for %{name}
Group: System/Emulators/PC
@ -340,12 +354,24 @@ This package contains the code for the GUI used to control VMs.
#########################################
%package websrv
Summary: WebService GUI part for %{name}
Group: System/Emulators/PC
@ -364,12 +390,24 @@ The VirtualBox web server is used to control headless VMs using a browser.
#########################################
%package guest-x11
Summary: VirtualBox X11 drivers for mouse and video
Group: System/X11/Servers/XF86_4
@ -391,12 +429,24 @@ This package contains X11 guest utilities and X11 guest mouse and video drivers
###########################################
%package guest-tools
Summary: VirtualBox guest tools
Group: System/Emulators/PC
@ -422,12 +472,24 @@ VirtualBox guest addition tools.
###########################################
%package -n python3-%{name}
Summary: Python bindings for %{name}
Group: Development/Libraries/Python
@ -453,12 +515,24 @@ Python XPCOM bindings to %{name}. Used e.g. by vboxgtk package.
###########################################
%package devel
Summary: Devel files for %{name}
Group: Development/Libraries/Other
@ -479,12 +553,24 @@ Development file for %{name}
###########################################
%package host-source
Summary: Source files for %{name} host kernel modules
Group: Development/Sources
@ -522,12 +608,24 @@ sudo %{_sbindir}/vboxguestconfig
###########################################
%package guest-desktop-icons
Summary: Icons for guest desktop files
Group: System/Emulators/PC
@ -546,12 +644,24 @@ This package contains icons for guest desktop files that were created on the des
###########################################
%package vnc
Summary: VNC desktop sharing
Group: System/Emulators/PC
@ -627,6 +737,8 @@ This package contains the kernel-modules that VirtualBox uses to create or run v
%patch144 -p1
%endif
%patch143 -p1
%patch145 -p1
%patch146 -p1
# make VB UI background colors look sane again
%patch999 -p1