From 201f26e6c84da0c16609468e814ada67e5e73ac4 Mon Sep 17 00:00:00 2001 From: decke Date: Mon, 30 Apr 2012 17:18:04 +0000 Subject: - Update to 4.1.14 - Remove debugging fprintf in MachineImpl.cpp to fix build with GCC 4.6 [1] - Add support for VLAN interfaces to NetIfList() [2] - Add support for VIMAGE to VBoxNetAdp [3] - Fix a kernel crash on FreeBSD 10-CURRENT hosts with VIMAGE enabled when a VM is powered off [3] Submitted by: Andriy Gapon [1] Landon J Fuller [2] Mikolaj Golub [3] Sponsored by: Plausible Labs Cooperative, Inc [2] --- emulators/virtualbox-ose-additions/Makefile | 2 +- emulators/virtualbox-ose-additions/distinfo | 4 +- emulators/virtualbox-ose-kmod/Makefile | 2 +- emulators/virtualbox-ose-kmod/distinfo | 4 +- ...rc-VBox-HostDrivers-VBoxNetAdp-freebsd-Makefile | 16 +++++++ ...Drivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c | 55 ++++++++++++++++++++++ ...Drivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c | 31 ++++++++++++ emulators/virtualbox-ose/Makefile | 2 +- emulators/virtualbox-ose/distinfo | 8 ++-- ...ch-src-VBox-HostServices-auth-pam-VBoxAuthPAM.c | 4 ++ .../patch-src-VBox-Main-src-server-MachineImpl.cpp | 13 +++++ ...-VBox-Main-src-server-freebsd-NetIf-freebsd.cpp | 26 ++++++++++ 12 files changed, 156 insertions(+), 11 deletions(-) create mode 100644 emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-Makefile create mode 100644 emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c create mode 100644 emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c create mode 100644 emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-MachineImpl.cpp create mode 100644 emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-NetIf-freebsd.cpp diff --git a/emulators/virtualbox-ose-additions/Makefile b/emulators/virtualbox-ose-additions/Makefile index f4631d9e59ed..ec4aa5dce167 100644 --- a/emulators/virtualbox-ose-additions/Makefile +++ b/emulators/virtualbox-ose-additions/Makefile @@ -6,7 +6,7 @@ # PORTNAME= virtualbox-ose -DISTVERSION= 4.1.12 +DISTVERSION= 4.1.14 CATEGORIES= emulators kld MASTER_SITES= http://tmp.chruetertee.ch/ \ http://freebsd.unixfreunde.de/sources/ \ diff --git a/emulators/virtualbox-ose-additions/distinfo b/emulators/virtualbox-ose-additions/distinfo index c574d8aadef4..cb0b23c10583 100644 --- a/emulators/virtualbox-ose-additions/distinfo +++ b/emulators/virtualbox-ose-additions/distinfo @@ -1,2 +1,2 @@ -SHA256 (VirtualBox-4.1.12.tar.bz2) = 4e4b9181a61ee9ccbe5fd28dbf528dde708fba490af5de6fac0d138b283b1d02 -SIZE (VirtualBox-4.1.12.tar.bz2) = 73250628 +SHA256 (VirtualBox-4.1.14.tar.bz2) = 034cfd19d5dd701cd1375b994ad6f2d41c207b6760c6b8c5fe3005e53134dff8 +SIZE (VirtualBox-4.1.14.tar.bz2) = 73260319 diff --git a/emulators/virtualbox-ose-kmod/Makefile b/emulators/virtualbox-ose-kmod/Makefile index 818c28a54e86..76dc8b3733d4 100644 --- a/emulators/virtualbox-ose-kmod/Makefile +++ b/emulators/virtualbox-ose-kmod/Makefile @@ -6,7 +6,7 @@ # PORTNAME= virtualbox-ose -DISTVERSION= 4.1.12 +DISTVERSION= 4.1.14 CATEGORIES= emulators kld MASTER_SITES= http://tmp.chruetertee.ch/ \ http://freebsd.unixfreunde.de/sources/ \ diff --git a/emulators/virtualbox-ose-kmod/distinfo b/emulators/virtualbox-ose-kmod/distinfo index c574d8aadef4..cb0b23c10583 100644 --- a/emulators/virtualbox-ose-kmod/distinfo +++ b/emulators/virtualbox-ose-kmod/distinfo @@ -1,2 +1,2 @@ -SHA256 (VirtualBox-4.1.12.tar.bz2) = 4e4b9181a61ee9ccbe5fd28dbf528dde708fba490af5de6fac0d138b283b1d02 -SIZE (VirtualBox-4.1.12.tar.bz2) = 73250628 +SHA256 (VirtualBox-4.1.14.tar.bz2) = 034cfd19d5dd701cd1375b994ad6f2d41c207b6760c6b8c5fe3005e53134dff8 +SIZE (VirtualBox-4.1.14.tar.bz2) = 73260319 diff --git a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-Makefile b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-Makefile new file mode 100644 index 000000000000..821c767192e1 --- /dev/null +++ b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-Makefile @@ -0,0 +1,16 @@ +This patch adds support for VIMAGE to VBoxNetAdp and thus +also fixes that panic. + +Submitted by: Mikolaj Golub +--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile 2012-03-13 15:15:44.000000000 +0200 ++++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile 2012-04-01 13:27:16.000000000 +0300 +@@ -18,7 +18,7 @@ + + KMOD = vboxnetadp + +-CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING ++CFLAGS += -DRT_OS_FREEBSD -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX -DRT_WITH_VBOX -Iinclude -I. -Ir0drv -w -DVBOX_WITH_HARDENING -DVIMAGE + + .if (${MACHINE_ARCH} == "i386") + CFLAGS += -DRT_ARCH_X86 +diff -rpu VirtualBox-4.1.10.orig/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c VirtualBox-4.1.10/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c diff --git a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c new file mode 100644 index 000000000000..189755c1b242 --- /dev/null +++ b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetAdp-freebsd-VBoxNetAdp-freebsd.c @@ -0,0 +1,55 @@ +This patch adds support for VIMAGE to VBoxNetAdp and thus +also fixes that panic. + +Submitted by: Mikolaj Golub +--- src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c 2012-03-13 15:15:44.000000000 +0200 ++++ src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c 2012-04-01 13:23:58.000000000 +0300 +@@ -68,6 +68,22 @@ + #define VBOXNETADP_OS_SPECFIC 1 + #include "../VBoxNetAdpInternal.h" + ++#if defined(__FreeBSD_version) && __FreeBSD_version >= 800500 ++# include ++# include ++ ++# define VBOXCURVNET_SET(arg) CURVNET_SET_QUIET(arg) ++# define VBOXCURVNET_SET_FROM_UCRED() VBOXCURVNET_SET(CRED_TO_VNET(curthread->td_ucred)) ++# define VBOXCURVNET_RESTORE() CURVNET_RESTORE() ++ ++#else /* !defined(__FreeBSD_version) || __FreeBSD_version < 800500 */ ++ ++# define VBOXCURVNET_SET(arg) ++# define VBOXCURVNET_SET_FROM_UCRED() ++# define VBOXCURVNET_RESTORE() ++ ++#endif /* !defined(__FreeBSD_version) || __FreeBSD_version < 800500 */ ++ + static int VBoxNetAdpFreeBSDCtrlioctl(struct cdev *, u_long, caddr_t, int flags, + struct thread *); + static struct cdevsw vboxnetadp_cdevsw = +@@ -260,6 +276,7 @@ int vboxNetAdpOsCreate(PVBOXNETADP pThis + { + struct ifnet *ifp; + ++ VBOXCURVNET_SET_FROM_UCRED(); + ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) + return VERR_NO_MEMORY; +@@ -279,6 +296,7 @@ int vboxNetAdpOsCreate(PVBOXNETADP pThis + + strncpy(pThis->szName, ifp->if_xname, VBOXNETADP_MAX_NAME_LEN); + pThis->u.s.ifp = ifp; ++ VBOXCURVNET_RESTORE(); + return 0; + } + +@@ -286,7 +304,9 @@ void vboxNetAdpOsDestroy(PVBOXNETADP pTh + { + struct ifnet *ifp; + ++ VBOXCURVNET_SET(ifp->if_vnet); + ifp = pThis->u.s.ifp; + ether_ifdetach(ifp); + if_free(ifp); ++ VBOXCURVNET_RESTORE(); + } diff --git a/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c new file mode 100644 index 000000000000..185931e4f504 --- /dev/null +++ b/emulators/virtualbox-ose-kmod/files/patch-src-VBox-HostDrivers-VBoxNetFlt-freebsd-VBoxNetFlt-freebsd.c @@ -0,0 +1,31 @@ +The attached patch fixes a kernel crash on FreeBSD 10-CURRENT hosts +with VIMAGE enabled when a VM is powered off. + +Submitted by: Mikolaj Golub +--- src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2012-03-13 15:15:44.000000000 +0200 ++++ src/VBox/HostDrivers/VBoxNetFlt/freebsd/VBoxNetFlt-freebsd.c 2012-04-01 13:43:02.000000000 +0300 +@@ -651,13 +651,13 @@ bool vboxNetFltOsMaybeRediscovered(PVBOX + ng_rmnode_self(pThis->u.s.node); + pThis->u.s.node = NULL; + } ++ VBOXCURVNET_RESTORE(); + + if (ifp0 != NULL) + { + vboxNetFltOsDeleteInstance(pThis); + vboxNetFltOsInitInstance(pThis, NULL); + } +- VBOXCURVNET_RESTORE(); + + return !ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost); + } +@@ -671,8 +671,10 @@ void vboxNetFltOsDeleteInstance(PVBOXNET + mtx_destroy(&pThis->u.s.inq.ifq_mtx); + mtx_destroy(&pThis->u.s.outq.ifq_mtx); + ++ VBOXCURVNET_SET_FROM_UCRED(); + if (pThis->u.s.node != NULL) + ng_rmnode_self(pThis->u.s.node); ++ VBOXCURVNET_RESTORE(); + pThis->u.s.node = NULL; + } diff --git a/emulators/virtualbox-ose/Makefile b/emulators/virtualbox-ose/Makefile index e7f6d5662f51..465e73846e29 100644 --- a/emulators/virtualbox-ose/Makefile +++ b/emulators/virtualbox-ose/Makefile @@ -6,7 +6,7 @@ # PORTNAME= virtualbox-ose -DISTVERSION= 4.1.12 +DISTVERSION= 4.1.14 CATEGORIES= emulators MASTER_SITES= http://tmp.chruetertee.ch/ \ http://freebsd.unixfreunde.de/sources/ \ diff --git a/emulators/virtualbox-ose/distinfo b/emulators/virtualbox-ose/distinfo index 6de747f5ba52..e18a2018c7ae 100644 --- a/emulators/virtualbox-ose/distinfo +++ b/emulators/virtualbox-ose/distinfo @@ -1,4 +1,4 @@ -SHA256 (VirtualBox-4.1.12.tar.bz2) = 4e4b9181a61ee9ccbe5fd28dbf528dde708fba490af5de6fac0d138b283b1d02 -SIZE (VirtualBox-4.1.12.tar.bz2) = 73250628 -SHA256 (VBoxGuestAdditions_4.1.12.iso) = 7dce13dd99c8b4757d56f5bada19a61a3ad50c69d7e0d9c245c0b88f50c0c245 -SIZE (VBoxGuestAdditions_4.1.12.iso) = 50776064 +SHA256 (VirtualBox-4.1.14.tar.bz2) = 034cfd19d5dd701cd1375b994ad6f2d41c207b6760c6b8c5fe3005e53134dff8 +SIZE (VirtualBox-4.1.14.tar.bz2) = 73260319 +SHA256 (VBoxGuestAdditions_4.1.14.iso) = a12785fd1f202ff784da27ae75bd3fd43edaa824736b5b30499d9db993c1db64 +SIZE (VBoxGuestAdditions_4.1.14.iso) = 50780160 diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-HostServices-auth-pam-VBoxAuthPAM.c b/emulators/virtualbox-ose/files/patch-src-VBox-HostServices-auth-pam-VBoxAuthPAM.c index 89f0370d7f0f..1344f3f2bd60 100644 --- a/emulators/virtualbox-ose/files/patch-src-VBox-HostServices-auth-pam-VBoxAuthPAM.c +++ b/emulators/virtualbox-ose/files/patch-src-VBox-HostServices-auth-pam-VBoxAuthPAM.c @@ -1,3 +1,7 @@ +- Fix path for libpam.so on FreeBSD + +Submitted by: Landon Fuller +Sponsored by: Plausible Labs Cooperative, Inc. --- src/VBox/HostServices/auth/pam/VBoxAuthPAM.c.orig 2012-04-03 14:11:56.000000000 +0200 +++ src/VBox/HostServices/auth/pam/VBoxAuthPAM.c 2012-04-05 12:44:48.000000000 +0200 @@ -62,6 +62,8 @@ diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-MachineImpl.cpp b/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-MachineImpl.cpp new file mode 100644 index 000000000000..fce7b85eefa3 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-MachineImpl.cpp @@ -0,0 +1,13 @@ +- Remove debugging fprintf in MachineImpl.cpp to fix build with GCC 4.6 + +Submitted by: Andriy Gapon +--- src/VBox/Main/src-server/MachineImpl.cpp.orig 2012-04-03 14:12:01.000000000 +0200 ++++ src/VBox/Main/src-server/MachineImpl.cpp 2012-04-13 10:49:25.000000000 +0200 +@@ -6643,7 +6643,6 @@ + + Utf8Str idStr = mData->mUuid.toString(); + const char * args[] = {szPath, "--comment", mUserData->s.strName.c_str(), "--startvm", idStr.c_str(), 0 }; +- fprintf(stderr, "SDL=%s\n", szPath); + vrc = RTProcCreate(szPath, args, env, 0, &pid); + } + #else /* !VBOX_WITH_VBOXSDL */ diff --git a/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-NetIf-freebsd.cpp b/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-NetIf-freebsd.cpp new file mode 100644 index 000000000000..bf6264a3b578 --- /dev/null +++ b/emulators/virtualbox-ose/files/patch-src-VBox-Main-src-server-freebsd-NetIf-freebsd.cpp @@ -0,0 +1,26 @@ +This patch adds support for IFT_L2VLAN interfaces in the +FreeBSD implementation of NetIfList(), treating them +identically as IFT_ETHER interfaces. + +Submitted by: Landon J Fuller +Sponsored by: Plausible Labs Cooperative, Inc +--- src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp.orig 2012-04-10 11:28:41.552067907 -0400 ++++ src/VBox/Main/src-server/freebsd/NetIf-freebsd.cpp 2012-04-10 11:28:45.872069027 -0400 +@@ -268,7 +268,7 @@ + pNext += pIfAddrMsg->ifam_msglen; + } + +- if (pSdl->sdl_type == IFT_ETHER) ++ if (pSdl->sdl_type == IFT_ETHER || pSdl->sdl_type == IFT_L2VLAN) + { + struct ifreq IfReq; + strcpy(IfReq.ifr_name, pNew->szShortName); +@@ -373,7 +373,7 @@ + pNext += pIfAddrMsg->ifam_msglen; + } + +- if (!fSkip && pSdl->sdl_type == IFT_ETHER) ++ if (!fSkip && (pSdl->sdl_type == IFT_ETHER || pSdl->sdl_type == IFT_L2VLAN)) + { + size_t cbNameLen = pSdl->sdl_nlen + 1; + memcpy(pInfo->MACAddress.au8, LLADDR(pSdl), sizeof(pInfo->MACAddress.au8)); -- cgit