View | Details | Raw Unified | Return to bug 234878 | Differences between
and this patch

Collapse All | Expand All

(-)emulators/virtualbox-ose/Makefile (-3 / +10 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	virtualbox-ose
4
PORTNAME=	virtualbox-ose
5
PORTVERSION=	5.2.26
5
PORTVERSION=	6.0.4
6
CATEGORIES=	emulators
6
CATEGORIES=	emulators
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
8
DISTFILES=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS}
8
DISTFILES=	VirtualBox-${PORTVERSION}${EXTRACT_SUFX} ${GUESTADDITIONS}
Lines 53-59 VBOX_PROGS= VBoxAutostart VBoxBalloonCtrl VBoxBugR Link Here
53
VBOX_UTILS=	VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \
53
VBOX_UTILS=	VBoxExtPackHelperApp VBoxNetAdpCtl VBoxNetDHCP VBoxNetNAT \
54
		VBoxSVC VBoxXPCOMIPCD
54
		VBoxSVC VBoxXPCOMIPCD
55
55
56
OPTIONS_DEFINE=	ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS PULSEAUDIO \
56
OPTIONS_DEFINE=	ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS OPUS PULSEAUDIO \
57
		PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11
57
		PYTHON QT5 R0LOGGING UDPTUNNEL VDE VNC WEBSERVICE VPX X11
58
OPTIONS_DEFAULT=	DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11
58
OPTIONS_DEFAULT=	DBUS QT5 UDPTUNNEL VNC WEBSERVICE X11
59
OPTIONS_SUB=	yes
59
OPTIONS_SUB=	yes
Lines 62-67 DEBUG_DESC= Debug symbols, additional logs and ass Link Here
62
GUESTADDITIONS_DESC=	Build with Guest Additions
62
GUESTADDITIONS_DESC=	Build with Guest Additions
63
MANUAL_DESC=	Build with user manual
63
MANUAL_DESC=	Build with user manual
64
NLS_DESC=	Native language support (requires QT5)
64
NLS_DESC=	Native language support (requires QT5)
65
OPUS_DESC=	Use libvpx for audio recording (requires VPX)
65
QT5_DESC=	Build with QT5 frontend (requires X11)
66
QT5_DESC=	Build with QT5 frontend (requires X11)
66
R0LOGGING_DESC=	Enable R0 logging (requires DEBUG)
67
R0LOGGING_DESC=	Enable R0 logging (requires DEBUG)
67
UDPTUNNEL_DESC=	Build with UDP tunnel support
68
UDPTUNNEL_DESC=	Build with UDP tunnel support
Lines 78-83 DEBUG_CONFIGURE_ON= --build-debug Link Here
78
MANUAL_BUILD_DEPENDS=	${LOCALBASE}/share/xml/docbook/4.4/docbookx.dtd:textproc/docbook-xml
79
MANUAL_BUILD_DEPENDS=	${LOCALBASE}/share/xml/docbook/4.4/docbookx.dtd:textproc/docbook-xml
79
MANUAL_CONFIGURE_OFF=	--disable-docs
80
MANUAL_CONFIGURE_OFF=	--disable-docs
80
NLS_IMPLIES=		QT5
81
NLS_IMPLIES=		QT5
82
OPUS_CONFIGURE_OFF=	--disable-libopus
83
OPUS_LIB_DEPENDS=	libopus.so:audio/opus
84
OPUS_IMPLIES=		VPX
81
PULSEAUDIO_CONFIGURE_OFF=	--disable-pulse
85
PULSEAUDIO_CONFIGURE_OFF=	--disable-pulse
82
PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
86
PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
83
PYTHON_CONFIGURE_OFF=	--disable-python
87
PYTHON_CONFIGURE_OFF=	--disable-python
Lines 154-160 USE_QT= buildtools_build core dbus gui linguistto Link Here
154
USE_QT+=	printsupport widgets x11extras
158
USE_QT+=	printsupport widgets x11extras
155
USE_XORG=	xcb
159
USE_XORG=	xcb
156
INSTALLS_ICONS=	yes
160
INSTALLS_ICONS=	yes
157
VBOX_PROGS+=	VirtualBox
161
VBOX_PROGS+=	VirtualBox VirtualBoxVM
158
VBOX_UTILS+=	VBoxTestOGL
162
VBOX_UTILS+=	VBoxTestOGL
159
VBOX_WITH_QT=	1
163
VBOX_WITH_QT=	1
160
.else
164
.else
Lines 275-280 post-patch: Link Here
275
	@${ECHO} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \
279
	@${ECHO} 'VBOX_GCC_PEDANTIC_CXX = -Wshadow $$(VBOX_GCC_WARN) -Wno-long-long' >> \
276
	    ${WRKSRC}/LocalConfig.kmk
280
	    ${WRKSRC}/LocalConfig.kmk
277
.endif
281
.endif
282
.if empty(PORT_OPTIONS:MX11)
283
	@${ECHO} 'VBOX_WITH_VMSVGA3D =' >> ${WRKSRC}/LocalConfig.kmk
284
.endif
278
.if ${COMPILER_TYPE} == clang
285
.if ${COMPILER_TYPE} == clang
279
	@${REINPLACE_CMD} -e 's| -finline-limit=8000||' \
286
	@${REINPLACE_CMD} -e 's| -finline-limit=8000||' \
280
	    -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk
287
	    -e 's| -mpreferred-stack-boundary=2||' ${WRKSRC}/Config.kmk
(-)emulators/virtualbox-ose/distinfo (-5 / +5 lines)
Lines 1-5 Link Here
1
TIMESTAMP = 1548732081
1
TIMESTAMP = 1548976366
2
SHA256 (VirtualBox-5.2.26.tar.bz2) = 4debe583463be3917ac60ad76a31f6db27586423d86f1f53c060d70d5e70d467
2
SHA256 (VirtualBox-6.0.4.tar.bz2) = f80b0c68182c946fb74ada8034960c38159ad91085b153da1277e4f191af6e1f
3
SIZE (VirtualBox-5.2.26.tar.bz2) = 118371765
3
SIZE (VirtualBox-6.0.4.tar.bz2) = 155233564
4
SHA256 (VBoxGuestAdditions_5.2.26.iso) = b927c5d0d4c97a9da2522daad41fe96b616ed06bfb0c883f9c42aad2244f7c38
4
SHA256 (VBoxGuestAdditions_6.0.4.iso) = 749b0c76aa6b588e3310d718fc90ea472fdc0b7c8953f7419c20be7e7fa6584a
5
SIZE (VBoxGuestAdditions_5.2.26.iso) = 58433536
5
SIZE (VBoxGuestAdditions_6.0.4.iso) = 85917696
(-)emulators/virtualbox-ose/files/extrapatch-Config.kmk (-10 / +10 lines)
Lines 1-22 Link Here
1
--- Config.kmk.orig	2016-07-18 11:50:32 UTC
1
--- Config.kmk.orig	2019-01-25 18:10:01 UTC
2
+++ Config.kmk
2
+++ Config.kmk
3
@@ -3537,6 +3537,7 @@ ifdef VBOX_WITH_RAW_MODE
3
@@ -4249,6 +4249,7 @@ ifdef VBOX_WITH_RAW_MODE
4
  TEMPLATE_VBoxRc_TOOL                = $(VBOX_GCC32_TOOL)
4
  TEMPLATE_VBoxRc_TOOL                = $(VBOX_GCC32_TOOL)
5
  TEMPLATE_VBoxRc_CXXFLAGS            = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
5
  TEMPLATE_VBoxRc_CXXFLAGS            = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
6
  TEMPLATE_VBoxRc_CFLAGS              = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C)   $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK)
6
  TEMPLATE_VBoxRc_CFLAGS              = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C)   $(VBOX_GCC32_Wno-variadic-macros) -fno-exceptions $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_IPRT_FMT_CHECK)
7
+ TEMPLATE_VBoxRc_CXXFLAGS.freebsd    = -fno-builtin
7
+ TEMPLATE_VBoxRc_CXXFLAGS.freebsd    = -fno-builtin
8
   ifeq ($(KBUILD_TARGET),solaris)
8
   if $(VBOX_GCC32_VERSION_CC) < 30400
9
    TEMPLATE_VBoxRc_LDFLAGS           = -r
9
    TEMPLATE_VBoxRc_DEFS             += RT_WITHOUT_PRAGMA_ONCE
10
   else
10
   endif
11
@@ -3677,6 +3678,7 @@ ifeq ($(VBOX_LDR_FMT),elf)
11
@@ -4396,6 +4397,7 @@ ifeq ($(VBOX_LDR_FMT),elf)
12
 TEMPLATE_VBoxR0_TOOL                = $(VBOX_GCC_TOOL)
12
 TEMPLATE_VBoxR0_TOOL                = $(VBOX_GCC_TOOL)
13
 TEMPLATE_VBoxR0_CFLAGS              = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C)   $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK)
13
 TEMPLATE_VBoxR0_CFLAGS              = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_C)   $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-hidden) -std=gnu99 $(VBOX_GCC_IPRT_FMT_CHECK)
14
 TEMPLATE_VBoxR0_CXXFLAGS            = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
14
 TEMPLATE_VBoxR0_CXXFLAGS            = -fno-pie -nostdinc -g $(VBOX_GCC_pipe) $(VBOX_GCC_WERR) $(VBOX_GCC_PEDANTIC_CXX) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) -fno-strict-aliasing -fno-exceptions $(VBOX_GCC_fno-stack-protector) -fno-common $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden) -fno-rtti $(VBOX_GCC_IPRT_FMT_CHECK)
15
+TEMPLATE_VBoxR0_CXXFLAGS.freebsd    = -fno-builtin
15
+TEMPLATE_VBoxR0_CXXFLAGS.freebsd    = -fno-builtin
16
 TEMPLATE_VBoxR0_CFLAGS.amd64        = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
16
 TEMPLATE_VBoxR0_CFLAGS.amd64        = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables -ffreestanding
17
 TEMPLATE_VBoxR0_CXXFLAGS.amd64      = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
17
 TEMPLATE_VBoxR0_CXXFLAGS.amd64      = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fasynchronous-unwind-tables
18
 ifeq ($(KBUILD_TARGET),solaris)
18
  if $(VBOX_GCC_VERSION_CC) < 30400
19
@@ -3945,7 +3947,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CM
19
@@ -4815,7 +4817,7 @@ define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS
20
 		| xargs -J% objcopy % $(out)
20
 		| xargs -J% objcopy % $(out)
21
 
21
 
22
 ## Strip debug info (comment out if debugging or something).
22
 ## Strip debug info (comment out if debugging or something).
(-)emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderAdditions.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp.orig	2017-01-17 07:26:50 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp
3
@@ -143,7 +143,7 @@ void UIDownloaderAdditions::handleVerifi
4
         {
5
             const QString strFileName = strRecord.section(" *", 1);
6
             const QString strDownloadedSumm = strRecord.section(" *", 0, 0);
7
-            if (strFileName == source().fileName())
8
+            if (strFileName == QFileInfo(source().toString()).fileName())
9
             {
10
                 /* Calc the SHA-256 on the bytes, creating a string: */
11
                 uint8_t abHash[RTSHA256_HASH_SIZE];
(-)emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_net_UIDownloaderExtensionPack.cpp (-11 lines)
Lines 1-11 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp.orig	2017-01-17 07:26:50 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp
3
@@ -127,7 +127,7 @@ void UIDownloaderExtensionPack::handleVe
4
         {
5
             const QString strFileName = strRecord.section(" *", 1);
6
             const QString strDownloadedSumm = strRecord.section(" *", 0, 0);
7
-            if (strFileName == source().fileName())
8
+            if (strFileName == QFileInfo(source().toString()).fileName())
9
             {
10
                 /* Calc the SHA-256 on the bytes, creating a string: */
11
                 uint8_t abHash[RTSHA256_HASH_SIZE];
(-)emulators/virtualbox-ose/files/extrapatch-src_VBox_Frontends_VirtualBox_src_settings_global_UIGlobalSettingsNetworkDetailsHost.cpp (-10 lines)
Lines 1-10 Link Here
1
--- src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsHost.cpp.orig	2017-03-08 17:19:57 UTC
2
+++ src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetworkDetailsHost.cpp
3
@@ -243,6 +243,6 @@ QString UIGlobalSettingsNetworkDetailsHo
4
         address.prepend(QString::number(uPart));
5
         uAddress = uAddress >> 8;
6
     }
7
-    return address.join('.');
8
+    return address.join(".");
9
 }
10
 
(-)emulators/virtualbox-ose/files/patch-Config.kmk (-39 / +50 lines)
Lines 1-6 Link Here
1
--- Config.kmk.orig	2019-01-14 14:53:56 UTC
1
--- Config.kmk.orig	2019-01-25 18:10:01 UTC
2
+++ Config.kmk
2
+++ Config.kmk
3
@@ -445,11 +445,11 @@ ifn1of ($(KBUILD_TARGET), win darwin)
3
@@ -456,11 +456,11 @@ ifn1of ($(KBUILD_TARGET), win darwin)
4
  # Enable OSS audio support.
4
  # Enable OSS audio support.
5
  VBOX_WITH_AUDIO_OSS = 1
5
  VBOX_WITH_AUDIO_OSS = 1
6
 endif
6
 endif
Lines 14-20 Link Here
14
  # Enable PulseAudio audio support.
14
  # Enable PulseAudio audio support.
15
  VBOX_WITH_AUDIO_PULSE = 1
15
  VBOX_WITH_AUDIO_PULSE = 1
16
 endif
16
 endif
17
@@ -464,11 +464,11 @@ VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT = 1
17
@@ -475,11 +475,11 @@ VBOX_WITH_AUDIO_MMNOTIFICATION_CLIENT = 1
18
 # Enable PCI passthrough support.
18
 # Enable PCI passthrough support.
19
 VBOX_WITH_PCI_PASSTHROUGH = 1
19
 VBOX_WITH_PCI_PASSTHROUGH = 1
20
 # Enable statically linked dbus support.
20
 # Enable statically linked dbus support.
Lines 28-43 Link Here
28
  VBOX_WITH_PAM = 1
28
  VBOX_WITH_PAM = 1
29
 endif
29
 endif
30
 # Enable internal networking.
30
 # Enable internal networking.
31
@@ -664,7 +664,7 @@ VBOX_WITH_TESTCASES = 1
31
@@ -487,7 +487,7 @@ VBOX_WITH_INTERNAL_NETWORKING = 1
32
 VBOX_WITH_VDITOOL =
32
 # Enable vmsvga (svga2) graphics device variant, 2D part
33
 # Enable this to build vbox-img even if VBOX_WITH_TESTCASES is disabled
33
 VBOX_WITH_VMSVGA = 1
34
 VBOX_WITH_VBOX_IMG =
34
 # Enable vmsvga (svga2) graphics device variant, 3D part
35
-if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64)
35
-if1of ($(KBUILD_TARGET), darwin linux win)
36
+if1of ($(KBUILD_TARGET).$(KBUILD_TARGET_ARCH), darwin.x86 darwin.amd64 freebsd.x86 freebsd.amd64 linux.x86 linux.amd64 solaris.amd64 win.x86 win.amd64)
36
+if1of ($(KBUILD_TARGET), darwin freebsd linux win)
37
  # Enables the video capturing support.
37
  VBOX_WITH_VMSVGA3D = 1
38
  VBOX_WITH_VIDEOREC = 1
38
 endif
39
  # Enable VPX (VP8 / VP9 codec), used for video capturing.
39
 # Enable Host Guest Shared Memory Interface.
40
@@ -992,10 +992,6 @@ ifeq ($(KBUILD_TARGET),darwin)
40
@@ -1029,10 +1029,6 @@ ifeq ($(KBUILD_TARGET),darwin)
41
  VBOX_WITH_VBOXSDL=
41
  VBOX_WITH_VBOXSDL=
42
 endif
42
 endif
43
 
43
 
Lines 48-54 Link Here
48
 ifeq ($(KBUILD_TARGET),haiku)
48
 ifeq ($(KBUILD_TARGET),haiku)
49
  # Don't bother with SDL ttf for now.
49
  # Don't bother with SDL ttf for now.
50
  VBOX_WITH_SECURELABEL=
50
  VBOX_WITH_SECURELABEL=
51
@@ -1155,7 +1151,7 @@ ifdef VBOX_OSE
51
@@ -1195,7 +1191,7 @@ ifdef VBOX_OSE
52
  VBOX_WITH_KCHMVIEWER=
52
  VBOX_WITH_KCHMVIEWER=
53
  VBOX_WITH_PLUGIN_CRYPT=
53
  VBOX_WITH_PLUGIN_CRYPT=
54
  VBOX_WITH_DRAG_AND_DROP_PROMISES=
54
  VBOX_WITH_DRAG_AND_DROP_PROMISES=
Lines 57-81 Link Here
57
   VBOX_WITH_DOCS=
57
   VBOX_WITH_DOCS=
58
   VBOX_WITH_DOCS_PACKING=
58
   VBOX_WITH_DOCS_PACKING=
59
  endif
59
  endif
60
@@ -1176,13 +1172,13 @@ ifdef VBOX_OSE
60
@@ -4782,7 +4778,7 @@ TEMPLATE_VBOXR0DRV_CFLAGS              =  \
61
  ifn1of ($(KBUILD_TARGET), darwin linux solaris win)
62
   VBOX_WITH_INSTALLER=
63
  endif
64
+ # Undefine codec libraries which are not needed.
65
+ VBOX_WITH_LIBOPUS=
66
+ # Disable video recording (with audio support).
67
+ VBOX_WITH_AUDIO_VIDEOREC=
68
  if1of ($(KBUILD_TARGET), win)
69
-  # Undefine codec libraries which are not needed.
70
   VBOX_WITH_LIBVPX=
71
-  VBOX_WITH_LIBOPUS=
72
-  # Disable video recording (with audio support).
73
   VBOX_WITH_VIDEOREC=
74
-  VBOX_WITH_AUDIO_VIDEOREC=
75
  endif
76
  # branding
77
  VBOX_BRAND_LICENSE_HTML             := $(PATH_ROOT)/doc/License-gpl-2.0.html
78
@@ -4541,7 +4537,7 @@ TEMPLATE_VBOXR0DRV_CFLAGS              =  \
79
 	-O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \
61
 	-O2 -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \
80
 	$(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
62
 	$(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_R0_OPT) $(VBOX_GCC_R0_FP) \
81
 	-nostdinc -std=c99
63
 	-nostdinc -std=c99
Lines 84-90 Link Here
84
 TEMPLATE_VBOXR0DRV_CFLAGS.amd64        = -m64 --param inline-unit-growth=100 --param large-function-growth=1000 \
66
 TEMPLATE_VBOXR0DRV_CFLAGS.amd64        = -m64 --param inline-unit-growth=100 --param large-function-growth=1000 \
85
 	-fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \
67
 	-fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx \
86
 	-mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -Wundef
68
 	-mno-3dnow -msoft-float -fno-asynchronous-unwind-tables -Wundef
87
@@ -4878,12 +4874,8 @@ TEMPLATE_VBOXR3EXE_LDFLAGS            += -fno-pic
69
@@ -5101,6 +5097,7 @@ TEMPLATE_VBOXR3EXE_LDFLAGS.x86         = -m32
70
 TEMPLATE_VBOXR3EXE_LDFLAGS.amd64       = -m64
71
 TEMPLATE_VBOXR3EXE_LDFLAGS.sparc32     = -m32
72
 TEMPLATE_VBOXR3EXE_LDFLAGS.sparc64     = -m64
73
+TEMPLATE_VBOXR3EXE_LDFLAGS.freebsd     = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
74
 TEMPLATE_VBOXR3EXE_LDFLAGS.linux       = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
75
 TEMPLATE_VBOXR3EXE_LDFLAGS.solaris     = -Wl,-z,ignore # same as VBOX_LD_as_needed
76
 TEMPLATE_VBOXR3EXE_LDFLAGS.debug       = $(VBOX_GCC_SANITIZER_FLAGS)
77
@@ -5138,12 +5135,8 @@ TEMPLATE_VBOXR3EXE_LDFLAGS            += -fno-pic
88
 TEMPLATE_VBOXR3EXE_TOOL                = GXX3
78
 TEMPLATE_VBOXR3EXE_TOOL                = GXX3
89
 TEMPLATE_VBOXR3EXE_LIBS                = pthread
79
 TEMPLATE_VBOXR3EXE_LIBS                = pthread
90
 TEMPLATE_VBOXR3EXE_INCS               += \
80
 TEMPLATE_VBOXR3EXE_INCS               += \
Lines 97-103 Link Here
97
 	/usr/local/lib
87
 	/usr/local/lib
98
  else ifeq ($(KBUILD_TARGET),netbsd)
88
  else ifeq ($(KBUILD_TARGET),netbsd)
99
 TEMPLATE_VBOXR3EXE_TOOL                = GXX3
89
 TEMPLATE_VBOXR3EXE_TOOL                = GXX3
100
@@ -5168,7 +5160,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT!
90
@@ -5452,7 +5445,7 @@ ifeq ($(KBUILD_TARGET),win) # No CRT!
101
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.win.amd64 = $(TEMPLATE_VBOXR3EXE_LDFLAGS.win.amd64) /entry:suplibHardenedWindowsMain
91
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.win.amd64 = $(TEMPLATE_VBOXR3EXE_LDFLAGS.win.amd64) /entry:suplibHardenedWindowsMain
102
  TEMPLATE_VBOXR3HARDENEDEXE_LIBS.x86       = $(NOT_SUCH_VARIABLE)
92
  TEMPLATE_VBOXR3HARDENEDEXE_LIBS.x86       = $(NOT_SUCH_VARIABLE)
103
  TEMPLATE_VBOXR3HARDENEDEXE_LIBS.amd64     = $(NOT_SUCH_VARIABLE)
93
  TEMPLATE_VBOXR3HARDENEDEXE_LIBS.amd64     = $(NOT_SUCH_VARIABLE)
Lines 106-113 Link Here
106
  # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH)
96
  # We want to keep the RPATH on Solaris to be able to find libgcc_1/libstdc++ within $(VBOX_WITH_RUNPATH)
107
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS       = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
97
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS       = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
108
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
98
  TEMPLATE_VBOXR3HARDENEDEXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
109
@@ -5699,12 +5691,8 @@ TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTI
99
@@ -6032,14 +6025,11 @@ TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
100
 TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME) network stdc++ supc++
101
  else if1of ($(KBUILD_TARGET), freebsd openbsd)
110
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
102
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
103
+TEMPLATE_VBOXMAINEXE_LDFLAGS.freebsd     = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
111
 TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME)
104
 TEMPLATE_VBOXMAINEXE_LIBS                = $(LIB_RUNTIME)
112
 TEMPLATE_VBOXMAINEXE_INCS               += \
105
 TEMPLATE_VBOXMAINEXE_INCS               += \
113
-	/usr/include \
106
-	/usr/include \
Lines 119-127 Link Here
119
 	/usr/local/lib
112
 	/usr/local/lib
120
  else ifeq ($(KBUILD_TARGET),netbsd)
113
  else ifeq ($(KBUILD_TARGET),netbsd)
121
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
114
 TEMPLATE_VBOXMAINEXE_TOOL                = GXX3
122
@@ -6238,12 +6226,8 @@ ifdef VBOX_WITH_QTGUI
115
@@ -6622,13 +6612,10 @@ ifdef VBOX_WITH_QTGUI
116
    TEMPLATE_VBOXQTGUIEXE_LIBPATH += \
123
 	$(VBOX_LIBPATH_X11)
117
 	$(VBOX_LIBPATH_X11)
124
    ifeq ($(KBUILD_TARGET),freebsd)
118
    ifeq ($(KBUILD_TARGET),freebsd)
119
+    TEMPLATE_VBOXQTGUIEXE_LDFLAGS.freebsd = -Wl,-z,noexecstack,-z,relro $(VBOX_LD_as_needed)
125
     TEMPLATE_VBOXQTGUIEXE_INCS += \
120
     TEMPLATE_VBOXQTGUIEXE_INCS += \
126
-	/usr/include \
121
-	/usr/include \
127
-	/usr/X11R6/include \
122
-	/usr/X11R6/include \
Lines 132-138 Link Here
132
 	/usr/local/lib
127
 	/usr/local/lib
133
    endif
128
    endif
134
    ifeq ($(KBUILD_TARGET),solaris)
129
    ifeq ($(KBUILD_TARGET),solaris)
135
@@ -6466,12 +6450,8 @@ TEMPLATE_VBoxBldProg_LIBPATH            += \
130
@@ -6871,12 +6858,8 @@ TEMPLATE_VBoxBldProg_LIBPATH            += \
136
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
131
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
137
 TEMPLATE_VBoxBldProg_LIBS                = pthread
132
 TEMPLATE_VBoxBldProg_LIBS                = pthread
138
 TEMPLATE_VBoxBldProg_INCS               += \
133
 TEMPLATE_VBoxBldProg_INCS               += \
Lines 145-151 Link Here
145
 	/usr/local/lib
140
 	/usr/local/lib
146
  else ifeq ($(KBUILD_HOST),netbsd)
141
  else ifeq ($(KBUILD_HOST),netbsd)
147
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
142
 TEMPLATE_VBoxBldProg_TOOL                = GXX3
148
@@ -6872,6 +6852,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin  += \
143
@@ -7018,6 +7001,7 @@ TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux    = \
144
 	$(VBOX_GCC_fno-stack-protector)
145
 TEMPLATE_VBOXGUESTR3EXE_CFLAGS.linux      = $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS.linux)
146
 # The GNU_HASH ELF tag is not supported by older systems.
147
+TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.freebsd    += $(VBOX_LD_hash_style_sysv)
148
 TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux      += $(VBOX_LD_hash_style_sysv)
149
 
150
 #
151
@@ -7228,6 +7212,7 @@ TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TYPE)      =
152
 TEMPLATE_VBOXGUESTR3XF86MOD_LIBS.$(KBUILD_TARGET)    = $(NO_SUCH_VARIABLE)
153
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TARGET) = $(NO_SUCH_VARIABLE)
154
 # The GNU_HASH ELF tag is not supported by older glibc dynamic linkers.
155
+TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.freebsd = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv))
156
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.linux = $(subst -Wl$(COMMA),,$(VBOX_LD_hash_style_sysv))
157
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.$(KBUILD_TYPE)   = $(NO_SUCH_VARIABLE)
158
 TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS          = -r
159
@@ -7337,6 +7322,7 @@ TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.darwin  += \
149
 	-current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
160
 	-current_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
150
 	-compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
161
 	-compatibility_version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
151
 TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux    = -Wl,--no-as-needed
162
 TEMPLATE_VBOXCROGLR3HOSTDLL_LDFLAGS.linux    = -Wl,--no-as-needed
(-)emulators/virtualbox-ose/files/patch-configure (-20 / +11 lines)
Lines 1-6 Link Here
1
--- configure.orig	2018-07-16 14:56:48 UTC
1
--- configure.orig	2019-01-25 18:10:01 UTC
2
+++ configure
2
+++ configure
3
@@ -138,10 +138,14 @@ CXX_FLAGS=""
3
@@ -139,10 +139,14 @@ CXX_FLAGS=""
4
 if [ "$OS" = "freebsd" ]; then
4
 if [ "$OS" = "freebsd" ]; then
5
   INCCURL="-I/usr/local/include"
5
   INCCURL="-I/usr/local/include"
6
   LIBCURL="-L/usr/local/lib -lcurl"
6
   LIBCURL="-L/usr/local/lib -lcurl"
Lines 15-21 Link Here
15
 else
15
 else
16
   INCCURL=""
16
   INCCURL=""
17
   LIBCURL="-lcurl"
17
   LIBCURL="-lcurl"
18
@@ -436,6 +440,9 @@ check_gcc()
18
@@ -445,6 +449,9 @@ check_gcc()
19
       elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
19
       elif [ $cc_maj -eq 4 -a $cc_min -eq 0 -a "$OS" = "darwin" ]; then
20
         log_success "found version $cc_ver"
20
         log_success "found version $cc_ver"
21
       # gcc-4.0 is allowed for Darwin only
21
       # gcc-4.0 is allowed for Darwin only
Lines 24-31 Link Here
24
+      # gcc-4.2 is allowed for FreeBSD only
24
+      # gcc-4.2 is allowed for FreeBSD only
25
       elif [ $cc_maj -lt 4 \
25
       elif [ $cc_maj -lt 4 \
26
              -o \( $cc_maj -eq 4 -a $cc_min -lt 4 -a "$OS" != "darwin" \) \
26
              -o \( $cc_maj -eq 4 -a $cc_min -lt 4 -a "$OS" != "darwin" \) \
27
              -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS"  = "darwin" \) \
27
              -o \( $cc_maj -eq 4 -a $cc_min -lt 2 -a "$OS"  = "darwin" \) ]; then
28
@@ -1204,7 +1211,7 @@ extern "C" int main(void)
28
@@ -1214,7 +1221,7 @@ extern "C" int main(void)
29
 #endif
29
 #endif
30
 }
30
 }
31
 EOF
31
 EOF
Lines 34-40 Link Here
34
     test_execute
34
     test_execute
35
   fi
35
   fi
36
 }
36
 }
37
@@ -1504,8 +1511,7 @@ EOF
37
@@ -1514,8 +1521,7 @@ EOF
38
         if [ $? -eq 0 ]; then
38
         if [ $? -eq 0 ]; then
39
           echo "(Qt5 from pkg-config)" >> $LOG
39
           echo "(Qt5 from pkg-config)" >> $LOG
40
           FLGQT5=`pkg-config Qt5Core --cflags`
40
           FLGQT5=`pkg-config Qt5Core --cflags`
Lines 44-50 Link Here
44
           INCQT5=`strip_I "$FLGQT5"`
44
           INCQT5=`strip_I "$FLGQT5"`
45
           LIBDIR5=`pkg-config Qt5Core --variable=libdir`
45
           LIBDIR5=`pkg-config Qt5Core --variable=libdir`
46
           LIBQT5=`pkg-config Qt5Core --libs`
46
           LIBQT5=`pkg-config Qt5Core --libs`
47
@@ -1644,7 +1650,7 @@ check_libopus()
47
@@ -1654,7 +1660,7 @@ check_libopus()
48
       fi
48
       fi
49
       cat > $ODIR.tmp_src.cc << EOF
49
       cat > $ODIR.tmp_src.cc << EOF
50
 #include <cstdio>
50
 #include <cstdio>
Lines 53-59 Link Here
53
 extern "C" int main(void)
53
 extern "C" int main(void)
54
 {
54
 {
55
   OpusEncoder *test;
55
   OpusEncoder *test;
56
@@ -1976,8 +1982,8 @@ EOF
56
@@ -1986,8 +1992,8 @@ EOF
57
         echo "compiling the following source file:" >> $LOG
57
         echo "compiling the following source file:" >> $LOG
58
         cat $ODIR.tmp_src.cc >> $LOG
58
         cat $ODIR.tmp_src.cc >> $LOG
59
         echo "using the following command line:" >> $LOG
59
         echo "using the following command line:" >> $LOG
Lines 64-70 Link Here
64
         if [ $? -eq 0 ]; then
64
         if [ $? -eq 0 ]; then
65
           found=1
65
           found=1
66
           break
66
           break
67
@@ -2449,7 +2455,7 @@ for option in "$@"; do
67
@@ -2463,7 +2469,7 @@ for option in "$@"; do
68
     --with-openssl-dir=*)
68
     --with-openssl-dir=*)
69
       OPENSSLDIR=`echo $option | cut -d'=' -f2`
69
       OPENSSLDIR=`echo $option | cut -d'=' -f2`
70
       INCCRYPTO="-I${OPENSSLDIR}/include"
70
       INCCRYPTO="-I${OPENSSLDIR}/include"
Lines 73-88 Link Here
73
       ;;
73
       ;;
74
     --with-ow-dir=*)
74
     --with-ow-dir=*)
75
       WATCOM=`echo $option | cut -d'=' -f2`
75
       WATCOM=`echo $option | cut -d'=' -f2`
76
@@ -2763,7 +2769,7 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then
76
@@ -2805,13 +2811,20 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then
77
   check_ssl
78
   check_curl
79
   [ $WITH_LIBVPX -eq 1 ] && check_vpx
80
-  check_libopus
81
+  [ $OSE -eq 0 -a "$OS" != "win" ] && check_libopus
82
  [ "$OS" != "darwin"  ] && check_z
83
   [ "$OS" != "darwin"  ] && check_png
84
   [ $OSE -eq 0 -a "$OS" = "linux" ] && check_pam
85
@@ -2784,13 +2790,20 @@ if [ $ONLY_ADDITIONS -eq 0 ]; then
86
   [ $WITH_PYTHON -eq 1 ] && check_python
77
   [ $WITH_PYTHON -eq 1 ] && check_python
87
   [ $WITH_JAVA   -eq 1 ] && check_java
78
   [ $WITH_JAVA   -eq 1 ] && check_java
88
 
79
 
Lines 104-110 Link Here
104
  fi
95
  fi
105
 fi
96
 fi
106
 
97
 
107
@@ -2806,14 +2819,6 @@ if [ "$OS" = "linux" ]; then
98
@@ -2827,14 +2840,6 @@ if [ "$OS" = "linux" ]; then
108
     cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1"
99
     cnf_append "VBOX_WITHOUT_LINUX_TEST_BUILDS" "1"
109
   fi
100
   fi
110
   if [ $ONLY_ADDITIONS -eq 0 ]; then
101
   if [ $ONLY_ADDITIONS -eq 0 ]; then
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-VBoxGuest-freebsd.c (-18 / +38 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig	2017-10-18 07:06:43 UTC
1
--- src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c.orig	2019-01-25 18:12:28 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c
2
+++ src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c
3
@@ -93,8 +93,6 @@ struct VBoxGuestDeviceState
3
@@ -45,6 +45,7 @@
4
 #include <sys/uio.h>
5
 #include <sys/bus.h>
6
 #include <sys/poll.h>
7
+#include <sys/proc.h>
8
 #include <sys/selinfo.h>
9
 #include <sys/queue.h>
10
 #include <sys/lock.h>
11
@@ -61,6 +62,7 @@
12
 #include <VBox/version.h>
13
 #include <VBox/log.h>
14
 #include <iprt/assert.h>
15
+#include <iprt/err.h>
16
 #include <iprt/initterm.h>
17
 #include <iprt/process.h>
18
 #include <iprt/string.h>
19
@@ -102,8 +104,6 @@ struct VBoxGuestDeviceState
4
     struct resource   *pIrqRes;
20
     struct resource   *pIrqRes;
5
     /** Pointer to the IRQ handler. */
21
     /** Pointer to the IRQ handler. */
6
     void              *pfnIrqHandler;
22
     void              *pfnIrqHandler;
Lines 9-15 Link Here
9
 };
25
 };
10
 
26
 
11
 
27
 
12
@@ -104,8 +102,7 @@ struct VBoxGuestDeviceState
28
@@ -113,8 +113,7 @@ struct VBoxGuestDeviceState
13
 /*
29
 /*
14
  * Character device file handlers.
30
  * Character device file handlers.
15
  */
31
  */
Lines 19-25 Link Here
19
 static d_ioctl_t  vgdrvFreeBSDIOCtl;
35
 static d_ioctl_t  vgdrvFreeBSDIOCtl;
20
 static int        vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd);
36
 static int        vgdrvFreeBSDIOCtlSlow(PVBOXGUESTSESSION pSession, u_long ulCmd, caddr_t pvData, struct thread *pTd);
21
 static d_write_t  vgdrvFreeBSDWrite;
37
 static d_write_t  vgdrvFreeBSDWrite;
22
@@ -136,8 +133,7 @@ static struct cdevsw    g_vgdrvFreeBSDCh
38
@@ -145,8 +144,7 @@ static struct cdevsw    g_vgdrvFreeBSDChrDevSW =
23
 {
39
 {
24
     .d_version =        D_VERSION,
40
     .d_version =        D_VERSION,
25
     .d_flags =          D_TRACKCLOSE | D_NEEDMINOR,
41
     .d_flags =          D_TRACKCLOSE | D_NEEDMINOR,
Lines 29-35 Link Here
29
     .d_ioctl =          vgdrvFreeBSDIOCtl,
45
     .d_ioctl =          vgdrvFreeBSDIOCtl,
30
     .d_read =           vgdrvFreeBSDRead,
46
     .d_read =           vgdrvFreeBSDRead,
31
     .d_write =          vgdrvFreeBSDWrite,
47
     .d_write =          vgdrvFreeBSDWrite,
32
@@ -145,81 +141,28 @@ static struct cdevsw    g_vgdrvFreeBSDCh
48
@@ -154,81 +152,28 @@ static struct cdevsw    g_vgdrvFreeBSDChrDevSW =
33
     .d_name =           "vboxguest"
49
     .d_name =           "vboxguest"
34
 };
50
 };
35
 
51
 
Lines 118-124 Link Here
118
 {
134
 {
119
     int                 rc;
135
     int                 rc;
120
     PVBOXGUESTSESSION   pSession;
136
     PVBOXGUESTSESSION   pSession;
121
@@ -227,25 +170,18 @@ static int vgdrvFreeBSDOpen(struct cdev 
137
@@ -240,12 +185,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
122
     LogFlow(("vgdrvFreeBSDOpen:\n"));
138
     LogFlow(("vgdrvFreeBSDOpen:\n"));
123
 
139
 
124
     /*
140
     /*
Lines 130-136 Link Here
130
-    /*
146
-    /*
131
      * Create a new session.
147
      * Create a new session.
132
      */
148
      */
133
     rc = VGDrvCommonCreateUserSession(&g_DevExt, &pSession);
149
     fRequestor = VMMDEV_REQUESTOR_USERMODE | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN;
150
@@ -262,14 +201,13 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
151
     rc = VGDrvCommonCreateUserSession(&g_DevExt, fRequestor, &pSession);
134
     if (RT_SUCCESS(rc))
152
     if (RT_SUCCESS(rc))
135
     {
153
     {
136
-        if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42))
154
-        if (ASMAtomicCmpXchgPtr(&pDev->si_drv1, pSession, (void *)0x42))
Lines 150-156 Link Here
150
     }
168
     }
151
 
169
 
152
     LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc));
170
     LogRel(("vgdrvFreeBSDOpen: failed. rc=%d\n", rc));
153
@@ -253,33 +189,6 @@ static int vgdrvFreeBSDOpen(struct cdev 
171
@@ -277,33 +215,6 @@ static int vgdrvFreeBSDOpen(struct cdev *pDev, int fOp
154
 }
172
 }
155
 
173
 
156
 /**
174
 /**
Lines 184-203 Link Here
184
  * I/O control request.
202
  * I/O control request.
185
  *
203
  *
186
  * @returns depends...
204
  * @returns depends...
187
@@ -292,7 +201,11 @@ static int vgdrvFreeBSDClose(struct cdev
205
@@ -316,8 +227,12 @@ static int vgdrvFreeBSDClose(struct cdev *pDev, int fF
188
 static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd)
206
 static int vgdrvFreeBSDIOCtl(struct cdev *pDev, u_long ulCmd, caddr_t pvData, int fFile, struct thread *pTd)
189
 {
207
 {
190
     PVBOXGUESTSESSION pSession;
208
     PVBOXGUESTSESSION pSession;
191
-    devfs_get_cdevpriv((void **)&pSession);
209
-    devfs_get_cdevpriv((void **)&pSession);
192
+    int rc;
210
+    int rc;
193
+
211
 
194
+    rc = devfs_get_cdevpriv((void **)&pSession);
212
+    rc = devfs_get_cdevpriv((void **)&pSession);
195
+    if (rc)
213
+    if (rc)
196
+        return rc;
214
+        return rc;
197
 
215
+
198
     /*
216
     /*
199
      * Deal with the fast ioctl path first.
217
      * Deal with the fast ioctl path first.
200
@@ -488,12 +401,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSessio
218
      */
219
@@ -512,12 +427,14 @@ int VBOXCALL VBoxGuestIDC(void *pvSession, uintptr_t u
201
 
220
 
202
 static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td)
221
 static int vgdrvFreeBSDPoll(struct cdev *pDev, int fEvents, struct thread *td)
203
 {
222
 {
Lines 215-235 Link Here
215
         Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev)));
234
         Log(("vgdrvFreeBSDPoll: no state data for %s\n", devtoname(pDev)));
216
         return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM));
235
         return (fEvents & (POLLHUP|POLLIN|POLLRDNORM|POLLOUT|POLLWRNORM));
217
     }
236
     }
218
@@ -534,10 +449,7 @@ static int vgdrvFreeBSDDetach(device_t p
237
@@ -558,11 +475,8 @@ static int vgdrvFreeBSDDetach(device_t pDevice)
219
     /*
238
     /*
220
      * Reverse what we did in vgdrvFreeBSDAttach.
239
      * Reverse what we did in vgdrvFreeBSDAttach.
221
      */
240
      */
222
-    if (g_vgdrvFreeBSDEHTag != NULL)
241
-    if (g_vgdrvFreeBSDEHTag != NULL)
223
-        EVENTHANDLER_DEREGISTER(dev_clone, g_vgdrvFreeBSDEHTag);
242
-        EVENTHANDLER_DEREGISTER(dev_clone, g_vgdrvFreeBSDEHTag);
224
-
225
-    clone_cleanup(&g_pvgdrvFreeBSDClones);
226
+    destroy_dev(g_pDev);
243
+    destroy_dev(g_pDev);
227
 
244
 
245
-    clone_cleanup(&g_pvgdrvFreeBSDClones);
246
-
228
     vgdrvFreeBSDRemoveIRQ(pDevice, pState);
247
     vgdrvFreeBSDRemoveIRQ(pDevice, pState);
229
 
248
 
230
@@ -689,18 +601,21 @@ static int vgdrvFreeBSDAttach(device_t p
249
     if (pState->pVMMDevMemRes)
231
                 if (RT_SUCCESS(rc))
250
@@ -727,18 +641,21 @@ static int vgdrvFreeBSDAttach(device_t pDevice)
232
                 {
251
                     VGDrvCommonProcessOptionsFromHost(&g_DevExt);
252
 
233
                     /*
253
                     /*
234
-                     * Configure device cloning.
254
-                     * Configure device cloning.
235
+                     * Configure device.
255
+                     * Configure device.
(-)emulators/virtualbox-ose/files/patch-src-VBox-Additions-common-VBoxGuest-freebsd-files_vboxguest (-4 / +12 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig	2017-10-18 07:06:43 UTC
1
--- src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest.orig	2019-01-25 18:12:28 UTC
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest
2
+++ src/VBox/Additions/common/VBoxGuest/freebsd/files_vboxguest
3
@@ -99,6 +99,7 @@ FILES_VBOXGUEST_NOBIN=" \
3
@@ -63,6 +63,7 @@ FILES_VBOXGUEST_NOBIN=" \
4
     ${PATH_ROOT}/include/iprt/time.h=>include/iprt/time.h \
5
     ${PATH_ROOT}/include/iprt/timer.h=>include/iprt/timer.h \
6
     ${PATH_ROOT}/include/iprt/types.h=>include/iprt/types.h \
7
+    ${PATH_ROOT}/include/iprt/uni.h=>include/iprt/uni.h \
8
     ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
9
     ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
10
     ${PATH_ROOT}/include/iprt/crc.h=>include/iprt/crc.h \
11
@@ -111,6 +112,7 @@ FILES_VBOXGUEST_NOBIN=" \
4
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
12
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
5
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
13
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
6
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
14
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
Lines 8-14 Link Here
8
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
16
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
9
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \
17
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg1Weak.cpp=>common/misc/RTAssertMsg1Weak.c \
10
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \
18
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/RTAssertMsg2.cpp=>common/misc/RTAssertMsg2.c \
11
@@ -160,6 +161,7 @@ FILES_VBOXGUEST_NOBIN=" \
19
@@ -181,6 +183,7 @@ FILES_VBOXGUEST_NOBIN=" \
12
     ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \
20
     ${PATH_ROOT}/src/VBox/Runtime/generic/errvars-generic.cpp=>generic/errvars-generic.c \
13
     ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \
21
     ${PATH_ROOT}/src/VBox/Runtime/generic/timer-generic.cpp=>generic/timer-generic.c \
14
     ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \
22
     ${PATH_ROOT}/src/VBox/Runtime/generic/mppresent-generic.cpp=>generic/mppresent-generic.c \
Lines 16-22 Link Here
16
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \
24
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.cpp=>r0drv/alloc-r0drv.c \
17
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \
25
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/alloc-r0drv.h=>r0drv/alloc-r0drv.h \
18
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \
26
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/initterm-r0drv.cpp=>r0drv/initterm-r0drv.c \
19
@@ -186,6 +188,7 @@ FILES_VBOXGUEST_NOBIN=" \
27
@@ -207,6 +210,7 @@ FILES_VBOXGUEST_NOBIN=" \
20
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \
28
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/sleepqueue-r0drv-freebsd.h=>r0drv/freebsd/sleepqueue-r0drv-freebsd.h \
21
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \
29
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c=>r0drv/generic/semspinmutex-r0drv-generic.c \
22
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \
30
     ${PATH_ROOT}/src/VBox/Runtime/r0drv/generic/mpnotification-r0drv-generic.cpp=>r0drv/generic/mpnotification-r0drv-generic.c \
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-Makefile (-3 / +4 lines)
Lines 1-6 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig	2016-07-18 11:56:20 UTC
1
--- src/VBox/HostDrivers/Support/freebsd/Makefile.orig	2019-01-25 18:19:55 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/Makefile
2
+++ src/VBox/HostDrivers/Support/freebsd/Makefile
3
@@ -81,6 +81,7 @@ SRCS += \
3
@@ -82,6 +82,7 @@ SRCS += \
4
 	assert.c \
4
 	assert.c \
5
 	handletable.c \
5
 	handletable.c \
6
 	handletablectx.c \
6
 	handletablectx.c \
Lines 8-19 Link Here
8
 	once.c \
8
 	once.c \
9
 	term.c \
9
 	term.c \
10
 	thread.c
10
 	thread.c
11
@@ -92,13 +93,14 @@ SRCS += \
11
@@ -94,14 +95,15 @@ SRCS += \
12
 	RTStrCopy.c \
12
 	RTStrCopy.c \
13
 	RTStrCopyEx.c \
13
 	RTStrCopyEx.c \
14
 	RTStrCopyP.c \
14
 	RTStrCopyP.c \
15
+	memchr.c \
15
+	memchr.c \
16
 	strformat.c \
16
 	strformat.c \
17
 	strformatnum.c \
17
 	strformatrt.c \
18
 	strformatrt.c \
18
 	strformattype.c \
19
 	strformattype.c \
19
+	stringalloc.c \
20
+	stringalloc.c \
(-)emulators/virtualbox-ose/files/patch-src-VBox-HostDrivers-Support-freebsd-files_vboxdrv (-3 / +4 lines)
Lines 1-6 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig	2016-07-18 11:56:20 UTC
1
--- src/VBox/HostDrivers/Support/freebsd/files_vboxdrv.orig	2019-01-25 18:19:55 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv
2
+++ src/VBox/HostDrivers/Support/freebsd/files_vboxdrv
3
@@ -116,6 +116,7 @@ FILES_VBOXDRV_NOBIN=" \
3
@@ -119,6 +119,7 @@ FILES_VBOXDRV_NOBIN=" \
4
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \
4
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.cpp=>common/misc/handletable.c \
5
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
5
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletable.h=>common/misc/handletable.h \
6
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
6
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/handletablectx.cpp=>common/misc/handletablectx.c \
Lines 8-19 Link Here
8
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
8
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/once.cpp=>common/misc/once.c \
9
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \
9
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/term.cpp=>common/misc/term.c \
10
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
10
     ${PATH_ROOT}/src/VBox/Runtime/common/misc/thread.cpp=>common/misc/thread.c \
11
@@ -124,13 +125,14 @@ FILES_VBOXDRV_NOBIN=" \
11
@@ -128,14 +129,15 @@ FILES_VBOXDRV_NOBIN=" \
12
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyEx.cpp=>common/string/RTStrCopyEx.c \
12
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrCopyEx.cpp=>common/string/RTStrCopyEx.c \
13
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \
13
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNCmp.cpp=>common/string/RTStrNCmp.c \
14
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNLen.cpp=>common/string/RTStrNLen.c \
14
     ${PATH_ROOT}/src/VBox/Runtime/common/string/RTStrNLen.cpp=>common/string/RTStrNLen.c \
15
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \
15
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/memchr.cpp=>common/string/memchr.c \
16
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \
16
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformat.cpp=>common/string/strformat.c \
17
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatnum.cpp=>common/string/strformatnum.c \
17
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \
18
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformatrt.cpp=>common/string/strformatrt.c \
18
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \
19
     ${PATH_ROOT}/src/VBox/Runtime/common/string/strformattype.cpp=>common/string/strformattype.c \
19
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
20
+    ${PATH_ROOT}/src/VBox/Runtime/common/string/stringalloc.cpp=>common/string/stringalloc.c \
(-)emulators/virtualbox-ose/files/patch-src-VBox-Installer-freebsd-VBox.sh (-1 / +4 lines)
Lines 1-6 Link Here
1
--- src/VBox/Installer/freebsd/VBox.sh.orig	2016-08-27 05:10:34 UTC
1
--- src/VBox/Installer/freebsd/VBox.sh.orig	2016-08-27 05:10:34 UTC
2
+++ src/VBox/Installer/freebsd/VBox.sh
2
+++ src/VBox/Installer/freebsd/VBox.sh
3
@@ -0,0 +1,64 @@
3
@@ -0,0 +1,67 @@
4
+#!/bin/sh
4
+#!/bin/sh
5
+#
5
+#
6
+# Oracle VM VirtualBox startup script, FreeBSD hosts.
6
+# Oracle VM VirtualBox startup script, FreeBSD hosts.
Lines 38-43 Link Here
38
+    VirtualBox|virtualbox)
38
+    VirtualBox|virtualbox)
39
+        exec "$INSTALL_DIR/VirtualBox" "$@"
39
+        exec "$INSTALL_DIR/VirtualBox" "$@"
40
+        ;;
40
+        ;;
41
+    VirtualBoxVM|virtualboxvm)
42
+        exec "$INSTALL_DIR/VirtualBoxVM" "$@"
43
+        ;;
41
+    VBoxManage|vboxmanage)
44
+    VBoxManage|vboxmanage)
42
+        exec "$INSTALL_DIR/VBoxManage" "$@"
45
+        exec "$INSTALL_DIR/VBoxManage" "$@"
43
+        ;;
46
+        ;;
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vfsops.c (-164 / +144 lines)
Lines 1-6 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig	2017-04-28 16:59:22.000000000 +0200
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c.orig	2019-01-25 18:12:34 UTC
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c	2017-07-12 19:24:26.109029000 +0200
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vfsops.c
3
@@ -1,10 +1,5 @@
3
@@ -1,8 +1,3 @@
4
-/* $Id: vboxvfs_vfsops.c $ */
4
-/* $Id: vboxvfs_vfsops.c $ */
5
-/** @file
5
-/** @file
6
- * Description.
6
- * Description.
Lines 7-17 Link Here
7
- */
7
- */
8
-
8
-
9
 /*
9
 /*
10
  * Copyright (C) 2008-2017 Oracle Corporation
10
  * Copyright (C) 2008-2019 Oracle Corporation
11
  *
11
  *
12
  * This file is part of VirtualBox Open Source Edition (OSE), as
12
@@ -14,245 +9,478 @@
13
  * available from http://www.virtualbox.org. This file is free software;
14
@@ -14,245 +9,479 @@
15
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
13
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
14
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17
  */
15
  */
Lines 38-57 Link Here
38
+#include <sys/sbuf.h>
36
+#include <sys/sbuf.h>
39
 
37
 
40
-#include <iprt/mem.h>
38
-#include <iprt/mem.h>
41
-
42
-#define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data)
43
-
44
-static int vboxvfs_version = VBOXVFS_VERSION;
45
+#include <geom/geom.h>
39
+#include <geom/geom.h>
46
+#include <geom/geom_vfs.h>
40
+#include <geom/geom_vfs.h>
47
 
41
 
42
+#include "vboxvfs.h"
43
+
44
 #define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data)
45
 
46
-static int vboxvfs_version = VBOXVFS_VERSION;
47
+#ifdef MALLOC_DECLARE
48
+MALLOC_DEFINE(M_VBOXVFS, "vboxvfs", "VBOX VFS");
49
+#endif
50
 
48
-SYSCTL_NODE(_vfs, OID_AUTO, vboxvfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem");
51
-SYSCTL_NODE(_vfs, OID_AUTO, vboxvfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem");
49
-SYSCTL_INT(_vfs_vboxvfs, OID_AUTO, version, CTLFLAG_RD, &vboxvfs_version, 0, "");
52
-SYSCTL_INT(_vfs_vboxvfs, OID_AUTO, version, CTLFLAG_RD, &vboxvfs_version, 0, "");
50
+#include "vboxvfs.h"
53
+static sfp_connection_t *sfprov = NULL;
51
 
54
 
52
-/* global connection to the host service. */
55
-/* global connection to the host service. */
53
-static VBGLSFCLIENT g_vboxSFClient;
56
-static VBGLSFCLIENT g_vboxSFClient;
54
+#define VFSMP2SFGLOBINFO(mp) ((struct sf_glob_info *)mp->mnt_data)
57
+static int vboxfs_version = VBOXVFS_VERSION;
58
+u_int vboxvfs_debug = 1;
55
 
59
 
56
-static vfs_init_t       vboxvfs_init;
60
-static vfs_init_t       vboxvfs_init;
57
-static vfs_uninit_t     vboxvfs_uninit;
61
-static vfs_uninit_t     vboxvfs_uninit;
Lines 61-67 Link Here
61
-static vfs_quotactl_t   vboxvfs_quotactl;
65
-static vfs_quotactl_t   vboxvfs_quotactl;
62
-static vfs_statfs_t     vboxvfs_statfs;
66
-static vfs_statfs_t     vboxvfs_statfs;
63
-static vfs_unmount_t    vboxvfs_unmount;
67
-static vfs_unmount_t    vboxvfs_unmount;
64
-
68
+SYSCTL_NODE(_vfs, OID_AUTO, vboxfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem");
69
+SYSCTL_INT(_vfs_vboxfs, OID_AUTO, version, CTLFLAG_RD, &vboxfs_version, 0, "");
70
+SYSCTL_UINT(_vfs_vboxfs, OID_AUTO, debug, CTLFLAG_RW, &vboxvfs_debug, 0, "Debug level");
71
 
65
-static struct vfsops vboxvfs_vfsops = {
72
-static struct vfsops vboxvfs_vfsops = {
66
-    .vfs_init     =    vboxvfs_init,
73
-    .vfs_init     =    vboxvfs_init,
67
-    .vfs_cmount   =    vboxvfs_cmount,
74
-    .vfs_cmount   =    vboxvfs_cmount,
Lines 72-90 Link Here
72
-    .vfs_sync     =    vfs_stdsync,
79
-    .vfs_sync     =    vfs_stdsync,
73
-    .vfs_uninit   =    vboxvfs_uninit,
80
-    .vfs_uninit   =    vboxvfs_uninit,
74
-    .vfs_unmount  =    vboxvfs_unmount,
81
-    .vfs_unmount  =    vboxvfs_unmount,
75
+#ifdef MALLOC_DECLARE
76
+MALLOC_DEFINE(M_VBOXVFS, "vboxvfs", "VBOX VFS");
77
+#endif
78
+
79
+static sfp_connection_t *sfprov = NULL;
80
+
81
+static int vboxfs_version = VBOXVFS_VERSION;
82
+u_int vboxvfs_debug = 1;
83
+
84
+SYSCTL_NODE(_vfs, OID_AUTO, vboxfs, CTLFLAG_RW, 0, "VirtualBox shared filesystem");
85
+SYSCTL_INT(_vfs_vboxfs, OID_AUTO, version, CTLFLAG_RD, &vboxfs_version, 0, "");
86
+SYSCTL_UINT(_vfs_vboxfs, OID_AUTO, debug, CTLFLAG_RW, &vboxvfs_debug, 0, "Debug level");
87
+
88
+static vfs_init_t	vboxfs_init;
82
+static vfs_init_t	vboxfs_init;
89
+static vfs_uninit_t	vboxfs_uninit;
83
+static vfs_uninit_t	vboxfs_uninit;
90
+static vfs_cmount_t	vboxfs_cmount;
84
+static vfs_cmount_t	vboxfs_cmount;
Lines 141-157 Link Here
141
 {
135
 {
142
-    struct vboxvfs_mount_info args;
136
-    struct vboxvfs_mount_info args;
143
-    int rc = 0;
137
-    int rc = 0;
144
-
145
-    printf("%s: Enter\n", __FUNCTION__);
146
-
147
-    rc = copyin(data, &args, sizeof(struct vboxvfs_mount_info));
148
-    if (rc)
149
-        return rc;
150
+	struct vboxfs_node *nnode;
138
+	struct vboxfs_node *nnode;
151
 
139
 
152
-    ma = mount_argf(ma, "uid", "%d", args.uid);
140
-    printf("%s: Enter\n", __FUNCTION__);
153
-    ma = mount_argf(ma, "gid", "%d", args.gid);
154
-    ma = mount_arg(ma, "from", args.name, -1);
155
+	if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) {
141
+	if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) {
156
+		/*
142
+		/*
157
+		 * When a new tmpfs node is created for fully
143
+		 * When a new tmpfs node is created for fully
Lines 169-178 Link Here
169
+		 */
155
+		 */
170
+		return (EBUSY);
156
+		return (EBUSY);
171
+	}
157
+	}
172
+
158
 
159
-    rc = copyin(data, &args, sizeof(struct vboxvfs_mount_info));
160
-    if (rc)
161
-        return rc;
173
+	nnode = (struct vboxfs_node *)uma_zalloc_arg(
162
+	nnode = (struct vboxfs_node *)uma_zalloc_arg(
174
+				vsfmp->sf_node_pool, vsfmp, M_WAITOK);
163
+				vsfmp->sf_node_pool, vsfmp, M_WAITOK);
175
+
164
 
165
-    ma = mount_argf(ma, "uid", "%d", args.uid);
166
-    ma = mount_argf(ma, "gid", "%d", args.gid);
167
-    ma = mount_arg(ma, "from", args.name, -1);
176
+	/* Generic initialization. */
168
+	/* Generic initialization. */
177
+	nnode->sf_type = type;
169
+	nnode->sf_type = type;
178
+	nnode->sf_ino = vsfmp->sf_ino++;
170
+	nnode->sf_ino = vsfmp->sf_ino++;
Lines 179-185 Link Here
179
+	nnode->sf_path = strdup(fullpath, M_VBOXVFS);
171
+	nnode->sf_path = strdup(fullpath, M_VBOXVFS);
180
+	nnode->sf_parent = parent;
172
+	nnode->sf_parent = parent;
181
+	nnode->vboxfsmp = vsfmp;
173
+	nnode->vboxfsmp = vsfmp;
182
+
174
 
175
-    rc = kernel_mount(ma, flags);
183
+	/* Type-specific initialization. */
176
+	/* Type-specific initialization. */
184
+	switch (nnode->sf_type) {
177
+	switch (nnode->sf_type) {
185
+	case VBLK:
178
+	case VBLK:
Lines 190-204 Link Here
190
+	case VLNK:
183
+	case VLNK:
191
+	case VREG:
184
+	case VREG:
192
+		break;
185
+		break;
193
+
186
 
187
-    printf("%s: Leave rc=%d\n", __FUNCTION__, rc);
194
+	default:
188
+	default:
195
+		panic("vboxfs_alloc_node: type %p %d", nnode, (int)nnode->sf_type);
189
+		panic("vboxfs_alloc_node: type %p %d", nnode, (int)nnode->sf_type);
196
+	}
190
+	}
197
 
191
 
198
-    rc = kernel_mount(ma, flags);
199
-
200
-    printf("%s: Leave rc=%d\n", __FUNCTION__, rc);
201
-
202
-    return rc;
192
-    return rc;
203
+	*node = nnode;
193
+	*node = nnode;
204
+	return 0;
194
+	return 0;
Lines 219-251 Link Here
219
-    struct sf_glob_info *pShFlGlobalInfo;
209
-    struct sf_glob_info *pShFlGlobalInfo;
220
-    SHFLSTRING *pShFlShareName = NULL;
210
-    SHFLSTRING *pShFlShareName = NULL;
221
-    int cbShFlShareName;
211
-    int cbShFlShareName;
222
-
212
 
223
-    printf("%s: Enter\n", __FUNCTION__);
213
-    printf("%s: Enter\n", __FUNCTION__);
224
-
225
-    if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
226
-        return EOPNOTSUPP;
227
-
228
-    if (vfs_filteropt(mp->mnt_optnew, vboxvfs_opts))
229
-    {
230
-        vfs_mount_error(mp, "%s", "Invalid option");
231
-        return EINVAL;
232
-    }
233
-
234
-    rc = vfs_getopt(mp->mnt_optnew, "from", (void **)&pszShare, &cbShare);
235
-    if (rc || pszShare[cbShare-1] != '\0' || cbShare > 0xfffe)
236
-        return EINVAL;
237
-
238
-    rc = vfs_getopt(mp->mnt_optnew, "gid", (void **)&gid, &cbOption);
239
-    if ((rc != ENOENT) && (rc || cbOption != sizeof(gid)))
240
-        return EINVAL;
241
-
242
-    rc = vfs_getopt(mp->mnt_optnew, "uid", (void **)&uid, &cbOption);
243
-    if ((rc != ENOENT) && (rc || cbOption != sizeof(uid)))
244
-        return EINVAL;
245
 
246
-    pShFlGlobalInfo = RTMemAllocZ(sizeof(struct sf_glob_info));
247
-    if (!pShFlGlobalInfo)
248
-        return ENOMEM;
249
+#ifdef INVARIANTS
214
+#ifdef INVARIANTS
250
+	TMPFS_NODE_LOCK(node);
215
+	TMPFS_NODE_LOCK(node);
251
+	MPASS(node->sf_vnode == NULL);
216
+	MPASS(node->sf_vnode == NULL);
Lines 255-270 Link Here
255
+	if (node->sf_path)
220
+	if (node->sf_path)
256
+		free(node->sf_path, M_VBOXVFS);
221
+		free(node->sf_path, M_VBOXVFS);
257
 
222
 
258
-    cbShFlShareName = offsetof (SHFLSTRING, String.utf8) + cbShare + 1;
223
-    if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
259
-    pShFlShareName  = RTMemAllocZ(cbShFlShareName);
224
-        return EOPNOTSUPP;
260
-    if (!pShFlShareName)
261
-        return VERR_NO_MEMORY;
262
+	uma_zfree(vboxfs->sf_node_pool, node);
225
+	uma_zfree(vboxfs->sf_node_pool, node);
263
+}
226
+}
264
 
227
 
265
-    pShFlShareName->u16Length = cbShare;
228
-    if (vfs_filteropt(mp->mnt_optnew, vboxvfs_opts))
266
-    pShFlShareName->u16Size   = cbShare + 1;
229
-    {
267
-    memcpy (pShFlShareName->String.utf8, pszShare, cbShare + 1);
230
-        vfs_mount_error(mp, "%s", "Invalid option");
231
-        return EINVAL;
232
-    }
268
+static int
233
+static int
269
+vboxfs_cmount(struct mntarg *ma, void *data, uint64_t flags)
234
+vboxfs_cmount(struct mntarg *ma, void *data, uint64_t flags)
270
+{
235
+{
Lines 271-284 Link Here
271
+	struct vboxfs_mount_info args;
236
+	struct vboxfs_mount_info args;
272
+	int error = 0;
237
+	int error = 0;
273
 
238
 
274
-    rc = VbglR0SfMapFolder (&g_vboxSFClient, pShFlShareName, &pShFlGlobalInfo->map);
239
-    rc = vfs_getopt(mp->mnt_optnew, "from", (void **)&pszShare, &cbShare);
275
-    RTMemFree(pShFlShareName);
240
-    if (rc || pszShare[cbShare-1] != '\0' || cbShare > 0xfffe)
241
-        return EINVAL;
276
+	if (data == NULL)
242
+	if (data == NULL)
277
+		return (EINVAL);
243
+		return (EINVAL);
278
+	error = copyin(data, &args, sizeof(struct vboxfs_mount_info));
244
+	error = copyin(data, &args, sizeof(struct vboxfs_mount_info));
279
+	if (error)
245
+	if (error)
280
+		return (error);
246
+		return (error);
281
+
247
 
248
-    rc = vfs_getopt(mp->mnt_optnew, "gid", (void **)&gid, &cbOption);
249
-    if ((rc != ENOENT) && (rc || cbOption != sizeof(gid)))
250
-        return EINVAL;
282
+  	ma = mount_argf(ma, "uid", "%d", args.uid);
251
+  	ma = mount_argf(ma, "uid", "%d", args.uid);
283
+	ma = mount_argf(ma, "gid", "%d", args.gid);
252
+	ma = mount_argf(ma, "gid", "%d", args.gid);
284
+	ma = mount_argf(ma, "file_mode", "%d", args.fmode);
253
+	ma = mount_argf(ma, "file_mode", "%d", args.fmode);
Lines 285-301 Link Here
285
+	ma = mount_argf(ma, "dir_mode", "%d", args.dmode);
254
+	ma = mount_argf(ma, "dir_mode", "%d", args.dmode);
286
+	ma = mount_arg(ma, "from", args.name, -1);
255
+	ma = mount_arg(ma, "from", args.name, -1);
287
 
256
 
288
-    if (RT_FAILURE (rc))
257
-    rc = vfs_getopt(mp->mnt_optnew, "uid", (void **)&uid, &cbOption);
289
-    {
258
-    if ((rc != ENOENT) && (rc || cbOption != sizeof(uid)))
290
-        RTMemFree(pShFlGlobalInfo);
259
-        return EINVAL;
291
-        printf("VbglR0SfMapFolder failed rc=%d\n", rc);
292
-        return EPROTO;
293
-    }
294
+	return (kernel_mount(ma, flags));
260
+	return (kernel_mount(ma, flags));
295
+}
261
+}
296
 
262
 
297
-    pShFlGlobalInfo->uid = uid;
263
-    pShFlGlobalInfo = RTMemAllocZ(sizeof(struct sf_glob_info));
298
-    pShFlGlobalInfo->gid = gid;
264
-    if (!pShFlGlobalInfo)
265
-        return ENOMEM;
299
+static const char *vboxfs_opts[] = {
266
+static const char *vboxfs_opts[] = {
300
+	"fstype",
267
+	"fstype",
301
+	"fspath",
268
+	"fspath",
Lines 308-314 Link Here
308
+	NULL
275
+	NULL
309
+};
276
+};
310
 
277
 
311
-    mp->mnt_data = pShFlGlobalInfo;
278
-    cbShFlShareName = offsetof (SHFLSTRING, String.utf8) + cbShare + 1;
279
-    pShFlShareName  = RTMemAllocZ(cbShFlShareName);
280
-    if (!pShFlShareName)
281
-        return VERR_NO_MEMORY;
312
+#define	VBOX_INTOPT(optname, val, base) do {				\
282
+#define	VBOX_INTOPT(optname, val, base) do {				\
313
+	char *ep, *optarg = NULL;					\
283
+	char *ep, *optarg = NULL;					\
314
+	if (vfs_getopt(opts, optname, (void **)&optarg, NULL) == 0) {	\
284
+	if (vfs_getopt(opts, optname, (void **)&optarg, NULL) == 0) {	\
Lines 328-393 Link Here
328
+	}								\
298
+	}								\
329
+} while (0)
299
+} while (0)
330
 
300
 
331
-    /** @todo root vnode. */
301
-    pShFlShareName->u16Length = cbShare;
302
-    pShFlShareName->u16Size   = cbShare + 1;
303
-    memcpy (pShFlShareName->String.utf8, pszShare, cbShare + 1);
332
+static int
304
+static int
333
+vboxfs_node_ctor(void *mem, int size, void *arg, int flags)
305
+vboxfs_node_ctor(void *mem, int size, void *arg, int flags)
334
+{
306
+{
335
+	struct vboxfs_node *node = (struct vboxfs_node *)mem;
307
+	struct vboxfs_node *node = (struct vboxfs_node *)mem;
336
 
308
 
337
-    vfs_getnewfsid(mp);
309
-    rc = VbglR0SfMapFolder (&g_vboxSFClient, pShFlShareName, &pShFlGlobalInfo->map);
338
-    vfs_mountedfrom(mp, pszShare);
310
-    RTMemFree(pShFlShareName);
339
+	node->sf_vnode = NULL;
311
+	node->sf_vnode = NULL;
340
+	node->sf_vpstate = 0;
312
+	node->sf_vpstate = 0;
341
 
313
 
342
-    printf("%s: Leave rc=0\n", __FUNCTION__);
314
-    if (RT_FAILURE (rc))
315
-    {
316
-        RTMemFree(pShFlGlobalInfo);
317
-        printf("VbglR0SfMapFolder failed rc=%d\n", rc);
318
-        return EPROTO;
319
-    }
343
+	return (0);
320
+	return (0);
344
+}
321
+}
345
 
322
 
346
-    return 0;
323
-    pShFlGlobalInfo->uid = uid;
324
-    pShFlGlobalInfo->gid = gid;
347
+static void
325
+static void
348
+vboxfs_node_dtor(void *mem, int size, void *arg)
326
+vboxfs_node_dtor(void *mem, int size, void *arg)
349
+{
327
+{
350
+	struct vboxfs_node *node = (struct vboxfs_node *)mem;
328
+	struct vboxfs_node *node = (struct vboxfs_node *)mem;
351
+	node->sf_type = VNON;
329
+	node->sf_type = VNON;
352
 }
330
+}
353
 
331
 
354
-static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td)
332
-    mp->mnt_data = pShFlGlobalInfo;
355
+static int
333
+static int
356
+vboxfs_node_init(void *mem, int size, int flags)
334
+vboxfs_node_init(void *mem, int size, int flags)
357
 {
335
+{
358
-    struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp);
359
-    int rc;
360
-    int flags = 0;
361
+	struct vboxfs_node *node = (struct vboxfs_node *)mem;
336
+	struct vboxfs_node *node = (struct vboxfs_node *)mem;
362
+	node->sf_ino = 0;
337
+	node->sf_ino = 0;
363
 
338
 
364
-    rc = VbglR0SfUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map);
339
-    /** @todo root vnode. */
365
-    if (RT_FAILURE(rc))
366
-        printf("Failed to unmap shared folder\n");
367
+	mtx_init(&node->sf_interlock, "tmpfs node interlock", NULL, MTX_DEF);
340
+	mtx_init(&node->sf_interlock, "tmpfs node interlock", NULL, MTX_DEF);
368
 
341
 
369
-    if (mntflags & MNT_FORCE)
342
-    vfs_getnewfsid(mp);
370
-        flags |= FORCECLOSE;
343
-    vfs_mountedfrom(mp, pszShare);
371
+	return (0);
344
+	return (0);
372
+}
345
+}
373
 
346
 
374
-    /* There is 1 extra root vnode reference (vnode_root). */
347
-    printf("%s: Leave rc=0\n", __FUNCTION__);
375
-    rc = vflush(mp, 1, flags, td);
376
-    if (rc)
377
-        return rc;
378
+static void
348
+static void
379
+vboxfs_node_fini(void *mem, int size)
349
+vboxfs_node_fini(void *mem, int size)
380
+{
350
+{
381
+	struct vboxfs_node *node = (struct vboxfs_node *)mem;
351
+	struct vboxfs_node *node = (struct vboxfs_node *)mem;
382
 
352
 
353
-    return 0;
383
+	mtx_destroy(&node->sf_interlock);
354
+	mtx_destroy(&node->sf_interlock);
384
+}
355
 }
385
 
356
 
386
-    RTMemFree(pShFlGlobalInfo);
357
-static int vboxvfs_unmount(struct mount *mp, int mntflags, struct thread *td)
387
-    mp->mnt_data = NULL;
388
+static int
358
+static int
389
+vboxfs_mount(struct mount *mp)
359
+vboxfs_mount(struct mount *mp)
390
+{
360
 {
361
-    struct sf_glob_info *pShFlGlobalInfo = VFSMP2SFGLOBINFO(mp);
362
-    int rc;
363
-    int flags = 0;
391
+	struct vboxfs_mnt *vboxfsmp = NULL;
364
+	struct vboxfs_mnt *vboxfsmp = NULL;
392
+	struct vfsoptlist *opts = mp->mnt_optnew;
365
+	struct vfsoptlist *opts = mp->mnt_optnew;
393
+	sfp_mount_t *handle = NULL;
366
+	sfp_mount_t *handle = NULL;
Lines 399-425 Link Here
399
+	uid_t uid = 0;
372
+	uid_t uid = 0;
400
+	gid_t gid = 0;
373
+	gid_t gid = 0;
401
+	struct vboxfs_node *root;
374
+	struct vboxfs_node *root;
402
+
375
 
376
-    rc = VbglR0SfUnmapFolder(&g_vboxSFClient, &pShFlGlobalInfo->map);
377
-    if (RT_FAILURE(rc))
378
-        printf("Failed to unmap shared folder\n");
403
+	if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
379
+	if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS))
404
+		return (EOPNOTSUPP);
380
+		return (EOPNOTSUPP);
405
+
381
 
382
-    if (mntflags & MNT_FORCE)
383
-        flags |= FORCECLOSE;
406
+	if (vfs_filteropt(opts, vboxfs_opts)) {
384
+	if (vfs_filteropt(opts, vboxfs_opts)) {
407
+		vfs_mount_error(mp, "%s", "Invalid option");
385
+		vfs_mount_error(mp, "%s", "Invalid option");
408
+		return (EINVAL);
386
+		return (EINVAL);
409
+	}
387
+	}
410
+
388
 
389
-    /* There is 1 extra root vnode reference (vnode_root). */
390
-    rc = vflush(mp, 1, flags, td);
391
-    if (rc)
392
-        return rc;
411
+	VBOX_INTOPT("uid", uid, 10);
393
+	VBOX_INTOPT("uid", uid, 10);
412
+	VBOX_INTOPT("gid", gid, 10);
394
+	VBOX_INTOPT("gid", gid, 10);
413
+	VBOX_INTOPT("file_mode", file_mode, 8);
395
+	VBOX_INTOPT("file_mode", file_mode, 8);
414
+	VBOX_INTOPT("dir_mode", dir_mode, 8);
396
+	VBOX_INTOPT("dir_mode", dir_mode, 8);
415
+	VBOX_INTOPT("ro", readonly, 10);
397
+	VBOX_INTOPT("ro", readonly, 10);
416
+
398
 
417
+	error = vfs_getopt(opts, "from", (void **)&share_name, &share_len);
399
+	error = vfs_getopt(opts, "from", (void **)&share_name, &share_len);
418
+	if (error != 0 || share_len == 0) {
400
+	if (error != 0 || share_len == 0) {
419
+		vfs_mount_error(mp, "Invalid from");
401
+		vfs_mount_error(mp, "Invalid from");
420
+		return (EINVAL);
402
+		return (EINVAL);
421
+	}
403
+	}
422
+
404
 
405
-    RTMemFree(pShFlGlobalInfo);
406
-    mp->mnt_data = NULL;
423
+	vboxfsmp = malloc(sizeof(struct vboxfs_mnt), M_VBOXVFS, M_WAITOK | M_ZERO);
407
+	vboxfsmp = malloc(sizeof(struct vboxfs_mnt), M_VBOXVFS, M_WAITOK | M_ZERO);
424
+	vboxfsmp->sf_uid = uid;
408
+	vboxfsmp->sf_uid = uid;
425
+	vboxfsmp->sf_gid = gid;
409
+	vboxfsmp->sf_gid = gid;
Lines 427-433 Link Here
427
+	vboxfsmp->sf_dmode = dir_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
411
+	vboxfsmp->sf_dmode = dir_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
428
+	vboxfsmp->sf_ino = 3;
412
+	vboxfsmp->sf_ino = 3;
429
+	vboxfsmp->sf_stat_ttl = 200;
413
+	vboxfsmp->sf_stat_ttl = 200;
430
+
414
 
415
-    return 0;
431
+	/* Invoke Hypervisor mount interface before proceeding */
416
+	/* Invoke Hypervisor mount interface before proceeding */
432
+	error = sfprov_mount(share_name, &handle);
417
+	error = sfprov_mount(share_name, &handle);
433
+	if (error)
418
+	if (error)
Lines 466-472 Link Here
466
+
451
+
467
+	MNT_ILOCK(mp);
452
+	MNT_ILOCK(mp);
468
+	mp->mnt_data = vboxfsmp;
453
+	mp->mnt_data = vboxfsmp;
469
+	bzero(&mp->mnt_stat.f_fsid, sizeof(&mp->mnt_stat.f_fsid));
470
+	/* f_fsid is int32_t but serial is uint32_t, convert */
454
+	/* f_fsid is int32_t but serial is uint32_t, convert */
471
+	memcpy(&mp->mnt_stat.f_fsid, &fsinfo.serial, sizeof(mp->mnt_stat.f_fsid));
455
+	memcpy(&mp->mnt_stat.f_fsid, &fsinfo.serial, sizeof(mp->mnt_stat.f_fsid));
472
+	mp->mnt_flag |= MNT_LOCAL;
456
+	mp->mnt_flag |= MNT_LOCAL;
Lines 480-487 Link Here
480
+#endif
464
+#endif
481
+	MNT_IUNLOCK(mp);
465
+	MNT_IUNLOCK(mp);
482
+	vfs_mountedfrom(mp, share_name);
466
+	vfs_mountedfrom(mp, share_name);
483
 
467
+
484
-    return 0;
485
+	return (0);
468
+	return (0);
486
 }
469
 }
487
 
470
 
Lines 502-556 Link Here
502
+	struct thread *td;
485
+	struct thread *td;
503
+	int error;
486
+	int error;
504
+	int flags;
487
+	int flags;
505
+
488
 
489
-    printf("%s: Enter\n", __FUNCTION__);
506
+	vboxfsmp = VFSTOVBOXFS(mp);
490
+	vboxfsmp = VFSTOVBOXFS(mp);
507
+	td = curthread;
491
+	td = curthread;
508
+	flags = 0;
492
+	flags = 0;
509
+	if (mntflags & MNT_FORCE)
493
+	if (mntflags & MNT_FORCE)
510
+		flags |= FORCECLOSE;
494
+		flags |= FORCECLOSE;
511
+
495
 
496
-    vp = pShFlGlobalInfo->vnode_root;
497
-    VREF(vp);
512
+	error = vflush(mp, 0, flags, td);
498
+	error = vflush(mp, 0, flags, td);
513
+	if (error)
499
+	if (error)
514
+		return (error);
500
+		return (error);
515
+
501
 
502
-    vn_lock(vp, flags | LK_RETRY, td);
503
-    *vpp = vp;
516
+	/* Invoke Hypervisor unmount interface before proceeding */
504
+	/* Invoke Hypervisor unmount interface before proceeding */
517
+	error = sfprov_unmount(vboxfsmp->sf_handle);
505
+	error = sfprov_unmount(vboxfsmp->sf_handle);
518
+	if (error != 0) {
506
+	if (error != 0) {
519
+		/* TBD anything here? */
507
+		/* TBD anything here? */
520
+	}
508
+	}
521
+
509
 
510
-    printf("%s: Leave\n", __FUNCTION__);
522
+	uma_zdestroy(vboxfsmp->sf_node_pool);
511
+	uma_zdestroy(vboxfsmp->sf_node_pool);
523
+
512
 
513
-    return rc;
524
+	free(vboxfsmp, M_VBOXVFS);
514
+	free(vboxfsmp, M_VBOXVFS);
525
+	MNT_ILOCK(mp);
515
+	MNT_ILOCK(mp);
526
+	mp->mnt_data = NULL;
516
+	mp->mnt_data = NULL;
527
+	mp->mnt_flag &= ~MNT_LOCAL;
517
+	mp->mnt_flag &= ~MNT_LOCAL;
528
+	MNT_IUNLOCK(mp);
518
+	MNT_IUNLOCK(mp);
529
 
519
+
530
-    printf("%s: Enter\n", __FUNCTION__);
531
-
532
-    vp = pShFlGlobalInfo->vnode_root;
533
-    VREF(vp);
534
+	return (0);
520
+	return (0);
535
+}
521
 }
536
 
522
 
537
-    vn_lock(vp, flags | LK_RETRY, td);
523
-static int vboxvfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, struct thread *td)
538
-    *vpp = vp;
539
+static int
524
+static int
540
+vboxfs_root(struct mount *mp, int flags, struct vnode **vpp)
525
+vboxfs_root(struct mount *mp, int flags, struct vnode **vpp)
541
+{
526
 {
527
-    return EOPNOTSUPP;
542
+	int error;
528
+	int error;
543
+	error = vboxfs_alloc_vp(mp, VFSTOVBOXFS(mp)->sf_root, flags, vpp);
529
+	error = vboxfs_alloc_vp(mp, VFSTOVBOXFS(mp)->sf_root, flags, vpp);
544
 
530
+
545
-    printf("%s: Leave\n", __FUNCTION__);
546
+	if (!error)
531
+	if (!error)
547
+		(*vpp)->v_vflag |= VV_ROOT;
532
+		(*vpp)->v_vflag |= VV_ROOT;
548
 
533
+
549
-    return rc;
550
+	return error;
534
+	return error;
551
 }
535
 }
552
 
536
 
553
-static int vboxvfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, struct thread *td)
537
-int vboxvfs_init(struct vfsconf *vfsp)
554
+/*
538
+/*
555
+ * Do operation associated with quotas, not supported
539
+ * Do operation associated with quotas, not supported
556
+ */
540
+ */
Lines 557-582 Link Here
557
+static int
541
+static int
558
+vboxfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg)
542
+vboxfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg)
559
 {
543
 {
560
-    return EOPNOTSUPP;
544
-    int rc;
561
+	return (EOPNOTSUPP);
545
+	return (EOPNOTSUPP);
562
 }
546
+}
563
 
547
 
564
-int vboxvfs_init(struct vfsconf *vfsp)
548
-    /* Initialize the R0 guest library. */
549
-    rc = VbglR0SfInit();
550
-    if (RT_FAILURE(rc))
551
-        return ENXIO;
565
+/*
552
+/*
566
+ * Initialize the filesystem globals.
553
+ * Initialize the filesystem globals.
567
+ */
554
+ */
568
+static int
555
+static int
569
+vboxfs_init(struct vfsconf *vfsp)
556
+vboxfs_init(struct vfsconf *vfsp)
570
 {
557
+{
571
-    int rc;
572
+	int error;
558
+	int error;
573
 
559
 
574
-    /* Initialize the R0 guest library. */
575
-    rc = VbglR0SfInit();
576
-    if (RT_FAILURE(rc))
577
-        return ENXIO;
578
+	DROP_GIANT();
579
 
580
-    /* Connect to the host service. */
560
-    /* Connect to the host service. */
581
-    rc = VbglR0SfConnect(&g_vboxSFClient);
561
-    rc = VbglR0SfConnect(&g_vboxSFClient);
582
-    if (RT_FAILURE(rc))
562
-    if (RT_FAILURE(rc))
Lines 585-612 Link Here
585
-        VbglR0SfTerm();
565
-        VbglR0SfTerm();
586
-        return ENXIO;
566
-        return ENXIO;
587
-    }
567
-    }
568
+	DROP_GIANT();
569
 
570
-    rc = VbglR0SfSetUtf8(&g_vboxSFClient);
571
-    if (RT_FAILURE (rc))
572
-    {
573
-        printf("VbglR0SfSetUtf8 failed, rc=%d\n", rc);
574
-        VbglR0SfDisconnect(&g_vboxSFClient);
575
-        VbglR0SfTerm();
576
-        return EPROTO;
577
-    }
588
+	sfprov = sfprov_connect(SFPROV_VERSION);
578
+	sfprov = sfprov_connect(SFPROV_VERSION);
589
+	if (sfprov == NULL) {
579
+	if (sfprov == NULL) {
590
+		printf("%s: couldn't connect to sf provider", __func__);
580
+		printf("%s: couldn't connect to sf provider", __func__);
591
+		return (ENODEV);
581
+		return (ENODEV);
592
+	}
582
+	}
593
+
583
 
584
-    printf("Successfully loaded shared folder module\n");
594
+	error = sfprov_set_show_symlinks();
585
+	error = sfprov_set_show_symlinks();
595
+	if (error != 0)
586
+	if (error != 0)
596
+		printf("%s: host unable to show symlinks, error=%d\n",
587
+		printf("%s: host unable to show symlinks, error=%d\n",
597
+		    __func__, error);
588
+		    __func__, error);
598
 
589
 
599
-    rc = VbglR0SfSetUtf8(&g_vboxSFClient);
600
-    if (RT_FAILURE (rc))
601
-    {
602
-        printf("VbglR0SfSetUtf8 failed, rc=%d\n", rc);
603
-        VbglR0SfDisconnect(&g_vboxSFClient);
604
-        VbglR0SfTerm();
605
-        return EPROTO;
606
-    }
607
-
608
-    printf("Successfully loaded shared folder module\n");
609
-
610
-    return 0;
590
-    return 0;
611
+	PICKUP_GIANT();
591
+	PICKUP_GIANT();
612
+	return (0);
592
+	return (0);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c (-199 / +164 lines)
Lines 1-5 Link Here
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2017-04-28 16:59:22.000000000 +0200
1
--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2019-01-25 18:12:34 UTC
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c	2017-07-14 14:22:09.045026515 +0200
2
+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c
3
@@ -1,10 +1,6 @@
3
@@ -1,10 +1,6 @@
4
-/* $Id: vboxvfs_vnops.c $ */
4
-/* $Id: vboxvfs_vnops.c $ */
5
-/** @file
5
-/** @file
Lines 7-18 Link Here
7
- */
7
- */
8
-
8
-
9
 /*
9
 /*
10
  * Copyright (C) 2008-2017 Oracle Corporation
10
  * Copyright (C) 2008-2019 Oracle Corporation
11
+ * Copyright (C) 2017 Mahdi Mokhtari
11
+ * Copyright (C) 2017 Mahdi Mokhtari
12
  *
12
  *
13
  * This file is part of VirtualBox Open Source Edition (OSE), as
13
  * This file is part of VirtualBox Open Source Edition (OSE), as
14
  * available from http://www.virtualbox.org. This file is free software;
14
  * available from http://www.virtualbox.org. This file is free software;
15
@@ -14,228 +9,1334 @@
15
@@ -14,228 +10,1334 @@
16
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16
  * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
17
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17
  * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18
  */
18
  */
Lines 45-53 Link Here
45
-#include <vm/vm.h>
45
-#include <vm/vm.h>
46
-#include <vm/vm_extern.h>
46
-#include <vm/vm_extern.h>
47
+#include <vm/uma.h>
47
+#include <vm/uma.h>
48
 
49
+#include "vboxvfs.h"
48
+
50
+
49
+#include "vboxvfs.h"
50
 
51
 /*
51
 /*
52
  * Prototypes for VBOXVFS vnode operations
52
  * Prototypes for VBOXVFS vnode operations
53
  */
53
  */
Lines 79-88 Link Here
79
-static vop_inactive_t   vboxvfs_inactive;
79
-static vop_inactive_t   vboxvfs_inactive;
80
-static vop_putpages_t   vboxvfs_putpages;
80
-static vop_putpages_t   vboxvfs_putpages;
81
-static vop_reclaim_t    vboxvfs_reclaim;
81
-static vop_reclaim_t    vboxvfs_reclaim;
82
-
82
+static vop_create_t	vboxfs_create;
83
+static vop_open_t	vboxfs_open;
84
+static vop_close_t	vboxfs_close;
85
+static vop_access_t	vboxfs_access;
86
+static vop_getattr_t	vboxfs_getattr;
87
+static vop_setattr_t	vboxfs_setattr;
88
+static vop_read_t	vboxfs_read;
89
+static vop_readlink_t	vboxfs_readlink;
90
+static vop_write_t	vboxfs_write;
91
+static vop_fsync_t	vboxfs_fsync;
92
+static vop_remove_t	vboxfs_remove;
93
+static vop_link_t	vboxfs_link;
94
+static vop_cachedlookup_t	vboxfs_lookup;
95
+static vop_rename_t	vboxfs_rename;
96
+static vop_mkdir_t	vboxfs_mkdir;
97
+static vop_rmdir_t	vboxfs_rmdir;
98
+static vop_symlink_t	vboxfs_symlink;
99
+static vop_readdir_t	vboxfs_readdir;
100
+static vop_print_t	vboxfs_print;
101
+static vop_pathconf_t	vboxfs_pathconf;
102
+static vop_advlock_t	vboxfs_advlock;
103
+static vop_ioctl_t	vboxfs_ioctl;
104
+static vop_inactive_t	vboxfs_inactive;
105
+static vop_reclaim_t	vboxfs_reclaim;
106
+static vop_vptofh_t	vboxfs_vptofh;
107
 
83
-struct vop_vector vboxvfs_vnodeops = {
108
-struct vop_vector vboxvfs_vnodeops = {
84
-    .vop_default    =   &default_vnodeops,
109
-    .vop_default    =   &default_vnodeops,
85
-
110
+struct vop_vector vboxfs_vnodeops = {
111
+	.vop_default	= &default_vnodeops,
112
 
86
-    .vop_access     =   vboxvfs_access,
113
-    .vop_access     =   vboxvfs_access,
87
-    .vop_advlock    =   vboxvfs_advlock,
114
-    .vop_advlock    =   vboxvfs_advlock,
88
-    .vop_close      =   vboxvfs_close,
115
-    .vop_close      =   vboxvfs_close,
Lines 111-145 Link Here
111
-    .vop_strategy   =   vboxvfs_strategy,
138
-    .vop_strategy   =   vboxvfs_strategy,
112
-    .vop_symlink    =   vboxvfs_symlink,
139
-    .vop_symlink    =   vboxvfs_symlink,
113
-    .vop_write      =   vboxvfs_write,
140
-    .vop_write      =   vboxvfs_write,
114
+static vop_create_t	vboxfs_create;
115
+static vop_open_t	vboxfs_open;
116
+static vop_close_t	vboxfs_close;
117
+static vop_access_t	vboxfs_access;
118
+static vop_getattr_t	vboxfs_getattr;
119
+static vop_setattr_t	vboxfs_setattr;
120
+static vop_read_t	vboxfs_read;
121
+static vop_readlink_t	vboxfs_readlink;
122
+static vop_write_t	vboxfs_write;
123
+static vop_fsync_t	vboxfs_fsync;
124
+static vop_remove_t	vboxfs_remove;
125
+static vop_link_t	vboxfs_link;
126
+static vop_cachedlookup_t	vboxfs_lookup;
127
+static vop_rename_t	vboxfs_rename;
128
+static vop_mkdir_t	vboxfs_mkdir;
129
+static vop_rmdir_t	vboxfs_rmdir;
130
+static vop_symlink_t	vboxfs_symlink;
131
+static vop_readdir_t	vboxfs_readdir;
132
+static vop_print_t	vboxfs_print;
133
+static vop_pathconf_t	vboxfs_pathconf;
134
+static vop_advlock_t	vboxfs_advlock;
135
+static vop_ioctl_t	vboxfs_ioctl;
136
+static vop_inactive_t	vboxfs_inactive;
137
+static vop_reclaim_t	vboxfs_reclaim;
138
+static vop_vptofh_t	vboxfs_vptofh;
139
+
140
+struct vop_vector vboxfs_vnodeops = {
141
+	.vop_default	= &default_vnodeops,
142
+
143
+	.vop_access	= vboxfs_access,
141
+	.vop_access	= vboxfs_access,
144
+	.vop_advlock	= VOP_EOPNOTSUPP,
142
+	.vop_advlock	= VOP_EOPNOTSUPP,
145
+	.vop_close	= vboxfs_close,
143
+	.vop_close	= vboxfs_close,
Lines 176-197 Link Here
176
+vsfnode_cur_time_usec(void)
174
+vsfnode_cur_time_usec(void)
177
 {
175
 {
178
-    return 0;
176
-    return 0;
179
-}
180
+	struct timeval now;
177
+	struct timeval now;
181
 
178
+
182
-static int vboxvfs_open(struct vop_open_args *ap)
183
-{
184
-    return 0;
185
-}
186
+	getmicrotime(&now);
179
+	getmicrotime(&now);
187
 
180
+
188
-static int vboxvfs_close(struct vop_close_args *ap)
189
-{
190
-    return 0;
191
+	return (now.tv_sec*1000 + now.tv_usec);
181
+	return (now.tv_sec*1000 + now.tv_usec);
192
 }
182
 }
193
 
183
 
194
-static int vboxvfs_getattr(struct vop_getattr_args *ap)
184
-static int vboxvfs_open(struct vop_open_args *ap)
195
+static int
185
+static int
196
+vsfnode_stat_cached(struct vboxfs_node *np)
186
+vsfnode_stat_cached(struct vboxfs_node *np)
197
 {
187
 {
Lines 200-217 Link Here
200
+	    np->vboxfsmp->sf_stat_ttl * 1000UL;
190
+	    np->vboxfsmp->sf_stat_ttl * 1000UL;
201
 }
191
 }
202
 
192
 
203
-static int vboxvfs_setattr(struct vop_setattr_args *ap)
193
-static int vboxvfs_close(struct vop_close_args *ap)
204
+static int
194
+static int
205
+vsfnode_update_stat_cache(struct vboxfs_node *np)
195
+vsfnode_update_stat_cache(struct vboxfs_node *np)
206
 {
196
 {
207
-    return 0;
197
-    return 0;
208
-}
209
+	int error;
198
+	int error;
210
 
199
+
211
-static int vboxvfs_read(struct vop_read_args *ap)
212
-{
213
-    return 0;
214
-}
215
+	error = sfprov_get_attr(np->vboxfsmp->sf_handle, np->sf_path,
200
+	error = sfprov_get_attr(np->vboxfsmp->sf_handle, np->sf_path,
216
+	    &np->sf_stat);
201
+	    &np->sf_stat);
217
+#if 0
202
+#if 0
Lines 220-233 Link Here
220
+#endif
205
+#endif
221
+	if (error == 0)
206
+	if (error == 0)
222
+		np->sf_stat_time = vsfnode_cur_time_usec();
207
+		np->sf_stat_time = vsfnode_cur_time_usec();
223
 
208
+
224
-static int vboxvfs_write(struct vop_write_args *ap)
225
-{
226
-    return 0;
227
+	return (error);
209
+	return (error);
228
 }
210
 }
229
 
211
 
230
-static int vboxvfs_create(struct vop_create_args *ap)
212
-static int vboxvfs_getattr(struct vop_getattr_args *ap)
231
+/*
213
+/*
232
+ * Need to clear v_object for insmntque failure.
214
+ * Need to clear v_object for insmntque failure.
233
+ */
215
+ */
Lines 235-245 Link Here
235
+vboxfs_insmntque_dtr(struct vnode *vp, void *dtr_arg)
217
+vboxfs_insmntque_dtr(struct vnode *vp, void *dtr_arg)
236
 {
218
 {
237
-    return 0;
219
-    return 0;
238
-}
220
+
239
 
240
-static int vboxvfs_remove(struct vop_remove_args *ap)
241
-{
242
-    return 0;
243
+	// XXX: vboxfs_destroy_vobject(vp, vp->v_object);
221
+	// XXX: vboxfs_destroy_vobject(vp, vp->v_object);
244
+	vp->v_object = NULL;
222
+	vp->v_object = NULL;
245
+	vp->v_data = NULL;
223
+	vp->v_data = NULL;
Lines 248-257 Link Here
248
+	vput(vp);
226
+	vput(vp);
249
 }
227
 }
250
 
228
 
251
-static int vboxvfs_rename(struct vop_rename_args *ap)
229
-static int vboxvfs_setattr(struct vop_setattr_args *ap)
252
-{
253
-    return 0;
254
-}
255
+/*
230
+/*
256
+ * Allocates a new vnode for the node node or returns a new reference to
231
+ * Allocates a new vnode for the node node or returns a new reference to
257
+ * an existing one if the node had already a vnode referencing it.  The
232
+ * an existing one if the node had already a vnode referencing it.  The
Lines 262-268 Link Here
262
+int
237
+int
263
+vboxfs_alloc_vp(struct mount *mp, struct vboxfs_node *node, int lkflag,
238
+vboxfs_alloc_vp(struct mount *mp, struct vboxfs_node *node, int lkflag,
264
+    struct vnode **vpp)
239
+    struct vnode **vpp)
265
+{
240
 {
241
-    return 0;
266
+	struct vnode *vp;
242
+	struct vnode *vp;
267
+	int error;
243
+	int error;
268
+
244
+
Lines 406-419 Link Here
406
+		VBOXFS_NODE_UNLOCK(node);
382
+		VBOXFS_NODE_UNLOCK(node);
407
+	}
383
+	}
408
+#endif
384
+#endif
409
 
385
+
410
-static int vboxvfs_link(struct vop_link_args *ap)
411
-{
412
-    return EOPNOTSUPP;
413
+	return error;
386
+	return error;
414
 }
387
 }
415
 
388
 
416
-static int vboxvfs_symlink(struct vop_symlink_args *ap)
389
-static int vboxvfs_read(struct vop_read_args *ap)
417
+/*
390
+/*
418
+ * Destroys the association between the vnode vp and the node it
391
+ * Destroys the association between the vnode vp and the node it
419
+ * references.
392
+ * references.
Lines 421-439 Link Here
421
+void
394
+void
422
+vboxfs_free_vp(struct vnode *vp)
395
+vboxfs_free_vp(struct vnode *vp)
423
 {
396
 {
424
-    return EOPNOTSUPP;
397
-    return 0;
425
-}
426
+	struct vboxfs_node *node;
398
+	struct vboxfs_node *node;
427
 
399
+
428
-static int vboxvfs_mknod(struct vop_mknod_args *ap)
429
-{
430
-    return EOPNOTSUPP;
431
-}
432
+	node = VP_TO_VBOXFS_NODE(vp);
400
+	node = VP_TO_VBOXFS_NODE(vp);
433
 
401
+
434
-static int vboxvfs_mkdir(struct vop_mkdir_args *ap)
435
-{
436
-    return 0;
437
+	VBOXFS_NODE_ASSERT_LOCKED(node);
402
+	VBOXFS_NODE_ASSERT_LOCKED(node);
438
+	node->sf_vnode = NULL;
403
+	node->sf_vnode = NULL;
439
+	if ((node->sf_vpstate & VBOXFS_VNODE_WRECLAIM) != 0)
404
+	if ((node->sf_vpstate & VBOXFS_VNODE_WRECLAIM) != 0)
Lines 442-448 Link Here
442
+	vp->v_data = NULL;
407
+	vp->v_data = NULL;
443
 }
408
 }
444
 
409
 
445
-static int vboxvfs_rmdir(struct vop_rmdir_args *ap)
410
-static int vboxvfs_write(struct vop_write_args *ap)
446
+/*
411
+/*
447
+ * Allocate new vboxfs_node and vnode for given file
412
+ * Allocate new vboxfs_node and vnode for given file
448
+ */
413
+ */
Lines 452-505 Link Here
452
+    int lkflag, struct vnode **vpp)
417
+    int lkflag, struct vnode **vpp)
453
 {
418
 {
454
-    return 0;
419
-    return 0;
455
-}
456
+	int error;
420
+	int error;
457
+	struct vboxfs_node *unode;
421
+	struct vboxfs_node *unode;
458
 
422
+
459
-static int vboxvfs_readdir(struct vop_readdir_args *ap)
460
-{
461
-    return 0;
462
-}
463
+	error = vboxfs_alloc_node(vboxfsmp->sf_vfsp, vboxfsmp, fullpath, type,
423
+	error = vboxfs_alloc_node(vboxfsmp->sf_vfsp, vboxfsmp, fullpath, type,
464
+	    vboxfsmp->sf_uid, vboxfsmp->sf_gid, mode, parent, &unode);
424
+	    vboxfsmp->sf_uid, vboxfsmp->sf_gid, mode, parent, &unode);
465
 
425
+
466
-static int vboxvfs_fsync(struct vop_fsync_args *ap)
467
-{
468
-    return 0;
469
-}
470
+	if (error)
426
+	if (error)
471
+		goto out;
427
+		goto out;
472
 
428
+
473
-static int vboxvfs_print (struct vop_print_args *ap)
474
-{
475
-    return 0;
476
-}
477
+	error = vboxfs_alloc_vp(vboxfsmp->sf_vfsp, unode, lkflag, vpp);
429
+	error = vboxfs_alloc_vp(vboxfsmp->sf_vfsp, unode, lkflag, vpp);
478
+	if (error)
430
+	if (error)
479
+		vboxfs_free_node(vboxfsmp, unode);
431
+		vboxfs_free_node(vboxfsmp, unode);
480
 
432
+
481
-static int vboxvfs_pathconf (struct vop_pathconf_args *ap)
482
-{
483
-    return 0;
484
+out:
433
+out:
485
+	return (error);
434
+	return (error);
486
 }
435
 }
487
 
436
 
488
-static int vboxvfs_strategy (struct vop_strategy_args *ap)
437
-static int vboxvfs_create(struct vop_create_args *ap)
489
+static int
438
+static int
490
+vboxfs_vn_get_ino_alloc(struct mount *mp, void *arg, int lkflags,
439
+vboxfs_vn_get_ino_alloc(struct mount *mp, void *arg, int lkflags,
491
+    struct vnode **rvp)
440
+    struct vnode **rvp)
492
 {
441
 {
493
-    return 0;
442
-    return 0;
494
-}
443
+
495
 
496
-static int vboxvfs_ioctl(struct vop_ioctl_args *ap)
497
-{
498
-    return ENOTTY;
499
+	return (vboxfs_alloc_vp(mp, arg, lkflags, rvp));
444
+	return (vboxfs_alloc_vp(mp, arg, lkflags, rvp));
500
 }
445
 }
501
 
446
 
502
-static int vboxvfs_getextattr(struct vop_getextattr_args *ap)
447
-static int vboxvfs_remove(struct vop_remove_args *ap)
503
+/*
448
+/*
504
+ * Construct a new pathname given an sfnode plus an optional tail
449
+ * Construct a new pathname given an sfnode plus an optional tail
505
+ * component of length len
450
+ * component of length len
Lines 509-521 Link Here
509
+sfnode_construct_path(struct vboxfs_node *node, char *tail, int len)
454
+sfnode_construct_path(struct vboxfs_node *node, char *tail, int len)
510
 {
455
 {
511
-    return 0;
456
-    return 0;
512
-}
513
+	char *p;
457
+	char *p;
514
 
458
+
515
-static int vboxvfs_advlock(struct vop_advlock_args *ap)
516
-{
517
-    return 0;
518
-}
519
+	if (len <= 2 && tail[0] == '.' && (len == 1 || tail[1] == '.'))
459
+	if (len <= 2 && tail[0] == '.' && (len == 1 || tail[1] == '.'))
520
+		panic("construct path for %s", tail);
460
+		panic("construct path for %s", tail);
521
+	p = malloc(strlen(node->sf_path) + 1 + len + 1, M_VBOXVFS, M_WAITOK);
461
+	p = malloc(strlen(node->sf_path) + 1 + len + 1, M_VBOXVFS, M_WAITOK);
Lines 523-533 Link Here
523
+	strcat(p, "/");
463
+	strcat(p, "/");
524
+	strcat(p, tail);
464
+	strcat(p, tail);
525
+	return (p);
465
+	return (p);
526
+}
466
 }
527
+
467
 
468
-static int vboxvfs_rename(struct vop_rename_args *ap)
528
+static int
469
+static int
529
+vboxfs_access(struct vop_access_args *ap)
470
+vboxfs_access(struct vop_access_args *ap)
530
+{
471
 {
472
-    return 0;
531
+	struct vnode *vp = ap->a_vp;
473
+	struct vnode *vp = ap->a_vp;
532
+	accmode_t accmode = ap->a_accmode;
474
+	accmode_t accmode = ap->a_accmode;
533
+	struct vboxfs_node *node;
475
+	struct vboxfs_node *node;
Lines 555-569 Link Here
555
+	else
497
+	else
556
+		error = vsfnode_update_stat_cache(node);
498
+		error = vsfnode_update_stat_cache(node);
557
+	m = (error == 0) ? node->sf_stat.sf_mode : 0;
499
+	m = (error == 0) ? node->sf_stat.sf_mode : 0;
558
 
500
+
559
-static int vboxvfs_lookup(struct vop_lookup_args *ap)
560
-{
561
-    return 0;
562
+	return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid,
501
+	return (vaccess(vp->v_type, m, node->vboxfsmp->sf_uid,
563
+	    node->vboxfsmp->sf_gid, accmode, ap->a_cred, NULL));
502
+	    node->vboxfsmp->sf_gid, accmode, ap->a_cred, NULL));
564
 }
503
 }
565
 
504
 
566
-static int vboxvfs_inactive(struct vop_inactive_args *ap)
505
-static int vboxvfs_link(struct vop_link_args *ap)
567
+/*
506
+/*
568
+ * Clears the (cached) directory listing for the node.
507
+ * Clears the (cached) directory listing for the node.
569
+ */
508
+ */
Lines 570-586 Link Here
570
+static void
509
+static void
571
+vfsnode_clear_dir_list(struct vboxfs_node *np)
510
+vfsnode_clear_dir_list(struct vboxfs_node *np)
572
 {
511
 {
573
-    return 0;
512
-    return EOPNOTSUPP;
574
+	while (np->sf_dir_list != NULL) {
513
+	while (np->sf_dir_list != NULL) {
575
+		sffs_dirents_t *next = np->sf_dir_list->sf_next;
514
+		sffs_dirents_t *next = np->sf_dir_list->sf_next;
576
+		free(np->sf_dir_list, M_VBOXVFS);
515
+		free(np->sf_dir_list, M_VBOXVFS);
577
+		np->sf_dir_list = next;
516
+		np->sf_dir_list = next;
578
+	}
517
+	}
579
+}
518
 }
580
+
519
 
520
-static int vboxvfs_symlink(struct vop_symlink_args *ap)
581
+static int
521
+static int
582
+vboxfs_open(struct vop_open_args *ap)
522
+vboxfs_open(struct vop_open_args *ap)
583
+{
523
 {
524
-    return EOPNOTSUPP;
584
+	struct vboxfs_node *np;
525
+	struct vboxfs_node *np;
585
+	sfp_file_t *fp;
526
+	sfp_file_t *fp;
586
+	int error;
527
+	int error;
Lines 599-615 Link Here
599
+	MPASS(VOP_ISLOCKED(vp));
540
+	MPASS(VOP_ISLOCKED(vp));
600
+
541
+
601
+	return (error);
542
+	return (error);
602
+}
543
 }
603
+
544
 
545
-static int vboxvfs_mknod(struct vop_mknod_args *ap)
604
+static void
546
+static void
605
+vfsnode_invalidate_stat_cache(struct vboxfs_node *np)
547
+vfsnode_invalidate_stat_cache(struct vboxfs_node *np)
606
+{
548
 {
549
-    return EOPNOTSUPP;
607
+	np->sf_stat_time = 0;
550
+	np->sf_stat_time = 0;
608
+}
551
 }
609
+
552
 
553
-static int vboxvfs_mkdir(struct vop_mkdir_args *ap)
610
+static int
554
+static int
611
+vboxfs_close(struct vop_close_args *ap)
555
+vboxfs_close(struct vop_close_args *ap)
612
+{
556
 {
557
-    return 0;
613
+	struct vnode *vp = ap->a_vp;
558
+	struct vnode *vp = ap->a_vp;
614
+	struct vboxfs_node *np;
559
+	struct vboxfs_node *np;
615
+
560
+
Lines 634-644 Link Here
634
+	}
579
+	}
635
+
580
+
636
+	return (0);
581
+	return (0);
637
+}
582
 }
638
+
583
 
584
-static int vboxvfs_rmdir(struct vop_rmdir_args *ap)
639
+static int
585
+static int
640
+vboxfs_getattr(struct vop_getattr_args *ap)
586
+vboxfs_getattr(struct vop_getattr_args *ap)
641
+{
587
 {
588
-    return 0;
642
+	struct vnode 		*vp = ap->a_vp;
589
+	struct vnode 		*vp = ap->a_vp;
643
+	struct vattr 		*vap = ap->a_vap;
590
+	struct vattr 		*vap = ap->a_vap;
644
+	struct vboxfs_node	*np = VP_TO_VBOXFS_NODE(vp);
591
+	struct vboxfs_node	*np = VP_TO_VBOXFS_NODE(vp);
Lines 713-723 Link Here
713
+
660
+
714
+done:
661
+done:
715
+	return (error);
662
+	return (error);
716
+}
663
 }
717
+
664
 
665
-static int vboxvfs_readdir(struct vop_readdir_args *ap)
718
+static int
666
+static int
719
+vboxfs_setattr(struct vop_setattr_args *ap)
667
+vboxfs_setattr(struct vop_setattr_args *ap)
720
+{
668
 {
669
-    return 0;
721
+	struct vnode 		*vp = ap->a_vp;
670
+	struct vnode 		*vp = ap->a_vp;
722
+	struct vattr 		*vap = ap->a_vap;
671
+	struct vattr 		*vap = ap->a_vap;
723
+	struct vboxfs_node	*np = VP_TO_VBOXFS_NODE(vp);
672
+	struct vboxfs_node	*np = VP_TO_VBOXFS_NODE(vp);
Lines 775-787 Link Here
775
+	}
724
+	}
776
+
725
+
777
+	return (error);
726
+	return (error);
778
+}
727
 }
779
+
728
 
729
-static int vboxvfs_fsync(struct vop_fsync_args *ap)
780
+#define blkoff(vboxfsmp, loc)	((loc) & (vboxfsmp)->bmask)
730
+#define blkoff(vboxfsmp, loc)	((loc) & (vboxfsmp)->bmask)
781
+
731
+
782
+static int
732
+static int
783
+vboxfs_read(struct vop_read_args *ap)
733
+vboxfs_read(struct vop_read_args *ap)
784
+{
734
 {
735
-    return 0;
785
+	struct vnode		*vp = ap->a_vp;
736
+	struct vnode		*vp = ap->a_vp;
786
+	struct uio 		*uio = ap->a_uio;
737
+	struct uio 		*uio = ap->a_uio;
787
+	struct vboxfs_node	*np = VP_TO_VBOXFS_NODE(vp);
738
+	struct vboxfs_node	*np = VP_TO_VBOXFS_NODE(vp);
Lines 829-839 Link Here
829
+		error = 0;
780
+		error = 0;
830
+
781
+
831
+	return (error);
782
+	return (error);
832
+}
783
 }
833
+
784
 
785
-static int vboxvfs_print (struct vop_print_args *ap)
834
+static int
786
+static int
835
+vboxfs_write(struct vop_write_args *ap)
787
+vboxfs_write(struct vop_write_args *ap)
836
+{
788
 {
789
-    return 0;
837
+	struct vnode		*vp = ap->a_vp;
790
+	struct vnode		*vp = ap->a_vp;
838
+	struct uio 		*uio = ap->a_uio;
791
+	struct uio 		*uio = ap->a_uio;
839
+	struct vboxfs_node	*np = VP_TO_VBOXFS_NODE(vp);
792
+	struct vboxfs_node	*np = VP_TO_VBOXFS_NODE(vp);
Lines 888-898 Link Here
888
+		error = 0;
841
+		error = 0;
889
+
842
+
890
+	return (error);
843
+	return (error);
891
+}
844
 }
892
+
845
 
846
-static int vboxvfs_pathconf (struct vop_pathconf_args *ap)
893
+static int
847
+static int
894
+vboxfs_create(struct vop_create_args *ap)
848
+vboxfs_create(struct vop_create_args *ap)
895
+{
849
 {
850
-    return 0;
896
+	struct vnode *dvp = ap->a_dvp;
851
+	struct vnode *dvp = ap->a_dvp;
897
+	struct vnode **vpp = ap->a_vpp;
852
+	struct vnode **vpp = ap->a_vpp;
898
+	struct componentname *cnp = ap->a_cnp;
853
+	struct componentname *cnp = ap->a_cnp;
Lines 926-936 Link Here
926
+	}
881
+	}
927
+
882
+
928
+	return (error);
883
+	return (error);
929
+}
884
 }
930
+
885
 
886
-static int vboxvfs_strategy (struct vop_strategy_args *ap)
931
+static int
887
+static int
932
+vboxfs_remove(struct vop_remove_args *ap)
888
+vboxfs_remove(struct vop_remove_args *ap)
933
+{
889
 {
890
-    return 0;
934
+	struct vnode *dvp = ap->a_dvp;
891
+	struct vnode *dvp = ap->a_dvp;
935
+	struct vnode *vp = ap->a_vp;
892
+	struct vnode *vp = ap->a_vp;
936
+	struct vboxfs_node *np, *dir;
893
+	struct vboxfs_node *np, *dir;
Lines 974-984 Link Here
974
+
931
+
975
+out:
932
+out:
976
+	return (error);
933
+	return (error);
977
+}
934
 }
978
+
935
 
936
-static int vboxvfs_ioctl(struct vop_ioctl_args *ap)
979
+static int
937
+static int
980
+vboxfs_rename(struct vop_rename_args *ap)
938
+vboxfs_rename(struct vop_rename_args *ap)
981
+{
939
 {
940
-    return ENOTTY;
982
+	struct vnode *fvp;
941
+	struct vnode *fvp;
983
+	struct vnode *fdvp;
942
+	struct vnode *fdvp;
984
+	struct vnode *tvp;
943
+	struct vnode *tvp;
Lines 1016-1032 Link Here
1016
+	vrele(fdvp);
975
+	vrele(fdvp);
1017
+	vrele(fvp);
976
+	vrele(fvp);
1018
+	return (ret);
977
+	return (ret);
1019
+}
978
 }
1020
+
979
 
980
-static int vboxvfs_getextattr(struct vop_getextattr_args *ap)
1021
+static int
981
+static int
1022
+vboxfs_link(struct vop_link_args *ap)
982
+vboxfs_link(struct vop_link_args *ap)
1023
+{
983
 {
984
-    return 0;
1024
+	return (EOPNOTSUPP);
985
+	return (EOPNOTSUPP);
1025
+}
986
 }
1026
+
987
 
988
-static int vboxvfs_advlock(struct vop_advlock_args *ap)
1027
+static int
989
+static int
1028
+vboxfs_symlink(struct vop_symlink_args *ap)
990
+vboxfs_symlink(struct vop_symlink_args *ap)
1029
+{
991
 {
992
-    return 0;
1030
+	struct vnode *dvp = ap->a_dvp;
993
+	struct vnode *dvp = ap->a_dvp;
1031
+	struct vnode **vpp = ap->a_vpp;
994
+	struct vnode **vpp = ap->a_vpp;
1032
+	struct componentname *cnp = ap->a_cnp;
995
+	struct componentname *cnp = ap->a_cnp;
Lines 1055-1065 Link Here
1055
+		vfsnode_clear_dir_list(dir);
1018
+		vfsnode_clear_dir_list(dir);
1056
+
1019
+
1057
+	return (error);
1020
+	return (error);
1058
+}
1021
 }
1059
+
1022
 
1023
-static int vboxvfs_lookup(struct vop_lookup_args *ap)
1060
+static int
1024
+static int
1061
+vboxfs_mkdir(struct vop_mkdir_args *ap)
1025
+vboxfs_mkdir(struct vop_mkdir_args *ap)
1062
+{
1026
 {
1027
-    return 0;
1063
+	struct vnode *dvp = ap->a_dvp;
1028
+	struct vnode *dvp = ap->a_dvp;
1064
+	struct vnode **vpp = ap->a_vpp;
1029
+	struct vnode **vpp = ap->a_vpp;
1065
+	struct componentname *cnp = ap->a_cnp;
1030
+	struct componentname *cnp = ap->a_cnp;
Lines 1090-1100 Link Here
1090
+		vfsnode_clear_dir_list(dir);
1055
+		vfsnode_clear_dir_list(dir);
1091
+
1056
+
1092
+	return (error);
1057
+	return (error);
1093
+}
1058
 }
1094
+
1059
 
1060
-static int vboxvfs_inactive(struct vop_inactive_args *ap)
1095
+static int
1061
+static int
1096
+vboxfs_rmdir(struct vop_rmdir_args *ap)
1062
+vboxfs_rmdir(struct vop_rmdir_args *ap)
1097
+{
1063
 {
1064
-    return 0;
1098
+	struct vnode *dvp = ap->a_dvp;
1065
+	struct vnode *dvp = ap->a_dvp;
1099
+	struct vnode *vp = ap->a_vp;
1066
+	struct vnode *vp = ap->a_vp;
1100
+	struct vboxfs_node *np, *dir;
1067
+	struct vboxfs_node *np, *dir;
Lines 1137-1147 Link Here
1137
+
1104
+
1138
+out:
1105
+out:
1139
+	return (error);
1106
+	return (error);
1140
+}
1107
 }
1141
+
1108
 
1109
-static int vboxvfs_reclaim(struct vop_reclaim_args *ap)
1142
+static int
1110
+static int
1143
+vboxfs_readdir(struct vop_readdir_args *ap)
1111
+vboxfs_readdir(struct vop_readdir_args *ap)
1144
+{
1112
 {
1113
-    return 0;
1145
+	int *eofp = ap->a_eofflag;
1114
+	int *eofp = ap->a_eofflag;
1146
+	struct vnode *vp = ap->a_vp;
1115
+	struct vnode *vp = ap->a_vp;
1147
+	struct uio *uio = ap->a_uio;
1116
+	struct uio *uio = ap->a_uio;
Lines 1260-1270 Link Here
1260
+	if (error != 0)
1229
+	if (error != 0)
1261
+		uio->uio_offset = orig_off;
1230
+		uio->uio_offset = orig_off;
1262
+	return (error);
1231
+	return (error);
1263
+}
1232
 }
1264
+
1233
 
1234
-static int vboxvfs_getpages(struct vop_getpages_args *ap)
1265
+static int
1235
+static int
1266
+vboxfs_readlink(struct vop_readlink_args *v)
1236
+vboxfs_readlink(struct vop_readlink_args *v)
1267
+{
1237
 {
1238
-    return 0;
1268
+	struct vnode *vp = v->a_vp;
1239
+	struct vnode *vp = v->a_vp;
1269
+	struct uio *uio = v->a_uio;
1240
+	struct uio *uio = v->a_uio;
1270
+
1241
+
Lines 1292-1302 Link Here
1292
+	if (tmpbuf)
1263
+	if (tmpbuf)
1293
+		contigfree(tmpbuf, MAXPATHLEN, M_DEVBUF);
1264
+		contigfree(tmpbuf, MAXPATHLEN, M_DEVBUF);
1294
+	return (error);
1265
+	return (error);
1295
+}
1266
 }
1296
+
1267
 
1268
-static int vboxvfs_putpages(struct vop_putpages_args *ap)
1297
+static int
1269
+static int
1298
+vboxfs_fsync(struct vop_fsync_args *ap)
1270
+vboxfs_fsync(struct vop_fsync_args *ap)
1299
+{
1271
 {
1272
-    return 0;
1300
+	struct vnode *vp;
1273
+	struct vnode *vp;
1301
+	struct vboxfs_node *np;
1274
+	struct vboxfs_node *np;
1302
+	int ret;
1275
+	int ret;
Lines 1307-1314 Link Here
1307
+		return (0);
1280
+		return (0);
1308
+	ret = sfprov_fsync(np->sf_file);
1281
+	ret = sfprov_fsync(np->sf_file);
1309
+	return (ret);
1282
+	return (ret);
1310
+}
1283
 }
1311
+
1284
 
1312
+static int
1285
+static int
1313
+vboxfs_print(struct vop_print_args *ap)
1286
+vboxfs_print(struct vop_print_args *ap)
1314
+{
1287
+{
Lines 1349-1370 Link Here
1349
+		break;
1322
+		break;
1350
+	}
1323
+	}
1351
+	return (error);
1324
+	return (error);
1352
 }
1325
+}
1353
 
1326
+
1354
-static int vboxvfs_reclaim(struct vop_reclaim_args *ap)
1355
+/*
1327
+/*
1356
+ * File specific ioctls.
1328
+ * File specific ioctls.
1357
+ */
1329
+ */
1358
+static int
1330
+static int
1359
+vboxfs_ioctl(struct vop_ioctl_args *ap)
1331
+vboxfs_ioctl(struct vop_ioctl_args *ap)
1360
 {
1332
+{
1361
-    return 0;
1362
+	return (ENOTTY);
1333
+	return (ENOTTY);
1363
 }
1334
+}
1364
 
1335
+
1365
-static int vboxvfs_getpages(struct vop_getpages_args *ap)
1366
-{
1367
-    return 0;
1368
+/*
1336
+/*
1369
+ * Lookup an entry in a directory and create a new vnode if found.
1337
+ * Lookup an entry in a directory and create a new vnode if found.
1370
+ */
1338
+ */
Lines 1495-1508 Link Here
1495
+	MPASS(vp->v_data == NULL);
1463
+	MPASS(vp->v_data == NULL);
1496
+
1464
+
1497
+	return (0);
1465
+	return (0);
1498
 }
1466
+}
1499
 
1467
+
1500
-static int vboxvfs_putpages(struct vop_putpages_args *ap)
1501
+static int
1468
+static int
1502
+vboxfs_vptofh(struct vop_vptofh_args *ap)
1469
+vboxfs_vptofh(struct vop_vptofh_args *ap)
1503
 {
1470
+{
1504
-    return 0;
1471
+
1505
-}
1506
 
1507
+	return (EOPNOTSUPP);
1472
+	return (EOPNOTSUPP);
1508
+}
1473
+}
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Graphics_DevVGA-SVGA3d-ogl.cpp (+38 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp.orig	2019-01-25 18:17:47 UTC
2
+++ src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
3
@@ -1150,7 +1150,7 @@ int vmsvga3dTerminate(PVGASTATE pThis)
4
     RTSemEventDestroy(pState->WndRequestSem);
5
 #elif defined(RT_OS_DARWIN)
6
 
7
-#elif defined(RT_OS_LINUX)
8
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
9
     /* signal to the thread that it is supposed to exit */
10
     pState->bTerminate = true;
11
     /* wait for it to terminate */
12
@@ -2850,7 +2850,7 @@ int vmsvga3dGenerateMipmaps(PVGASTATE pThis, uint32_t 
13
 }
14
 
15
 
16
-#ifdef RT_OS_LINUX
17
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
18
 /**
19
  * X11 event handling thread.
20
  *
21
@@ -2880,7 +2880,7 @@ DECLCALLBACK(int) vmsvga3dXEventThread(RTTHREAD hThrea
22
     }
23
     return VINF_SUCCESS;
24
 }
25
-#endif // RT_OS_LINUX
26
+#endif // RT_OS_FREEBSD || RT_OS_LINUX
27
 
28
 
29
 /**
30
@@ -3206,7 +3206,7 @@ static int vmsvga3dContextDestroyOgl(PVGASTATE pThis, 
31
     AssertRC(rc);
32
 #elif defined(RT_OS_DARWIN)
33
     vmsvga3dCocoaDestroyViewAndContext(pContext->cocoaView, pContext->cocoaContext);
34
-#elif defined(RT_OS_LINUX)
35
+#elif defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX)
36
     glXMakeCurrent(pState->display, None, NULL);
37
     glXDestroyContext(pState->display, pContext->glxContext);
38
     XDestroyWindow(pState->display, pContext->window);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Makefile.kmk (+20 lines)
Line 0 Link Here
1
--- src/VBox/Devices/Makefile.kmk.orig	2019-01-25 18:18:06 UTC
2
+++ src/VBox/Devices/Makefile.kmk
3
@@ -277,7 +277,7 @@ if !defined(VBOX_ONLY_EXTPACKS)         # Goes on almo
4
   VBoxDD_SOURCES        += Graphics/DevVGA-SVGA.cpp
5
  endif
6
  ifdef VBOX_WITH_VMSVGA3D
7
-  if1of ($(KBUILD_TARGET), linux win)
8
+  if1of ($(KBUILD_TARGET), freebsd linux win)
9
 # Dynamically load 3D library (opengl32, libGL).
10
 # This is a temporary solution. In future the 3D backend will be in a separate library.
11
 VBOX_WITH_VMSVGA3D_DYNAMIC_LOAD = 1
12
@@ -1484,6 +1484,8 @@ if defined(VBOX_WITH_VMSVGA3D) && !defined(VBOX_ONLY_E
13
  VBoxSVGA3D_INCS = $(VBOX_GRAPHICS_INCS)
14
  VBoxSVGA3D_INCS.win    := \
15
  	Graphics/shaderlib/libWineStub/include
16
+ VBoxSVGA3D_INCS.freebsd := \
17
+ 	Graphics/shaderlib/wine/include
18
  VBoxSVGA3D_INCS.linux  := \
19
  	Graphics/shaderlib/wine/include
20
  VBoxSVGA3D_INCS.darwin := \
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_Storage_DrvHostBase-freebsd.cpp (-3 / +22 lines)
Lines 1-10 Link Here
1
--- src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp.orig	2017-10-18 07:11:48 UTC
1
--- src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp.orig	2019-01-25 18:18:40 UTC
2
+++ src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp
2
+++ src/VBox/Devices/Storage/DrvHostBase-freebsd.cpp
3
@@ -24,6 +24,7 @@
3
@@ -24,6 +24,7 @@
4
 #include <sys/param.h>
5
 #include <errno.h>
6
 #include <stdio.h>
7
+#include <string.h>
8
 #include <cam/cam.h>
9
 #include <cam/cam_ccb.h>
4
 #include <cam/scsi/scsi_message.h>
10
 #include <cam/scsi/scsi_message.h>
5
 #include <cam/scsi/scsi_pass.h>
11
@@ -31,7 +32,9 @@
12
 #include <VBox/err.h>
13
 
6
 #include <VBox/scsi.h>
14
 #include <VBox/scsi.h>
7
+#include <iprt/file.h>
15
+#include <iprt/file.h>
8
 #include <iprt/log.h>
16
 #include <iprt/log.h>
17
+#include <iprt/string.h>
9
 
18
 
10
 /** Maximum buffer size supported by the CAM subsystem. */
19
 
20
 /*********************************************************************************************************************************
21
@@ -164,6 +167,8 @@ DECLHIDDEN(int) drvHostBaseScsiCmdOs(PDRVHOSTBASE pThi
22
         else
23
             rc = RTErrConvertFromErrno(errno);
24
     }
25
+
26
+    return rc;
27
 }
28
 
29
 
(-)emulators/virtualbox-ose/files/patch-src_VBox_Devices_VMMDev_VMMDevHGCM.cpp (+11 lines)
Line 0 Link Here
1
--- src/VBox/Devices/VMMDev/VMMDevHGCM.cpp.orig	2019-01-25 18:18:41 UTC
2
+++ src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
3
@@ -2390,7 +2390,7 @@ void vmmdevHGCMDestroy(PVMMDEV pThis)
4
         RTCritSectDelete(&pThis->critsectHGCMCmdList);
5
     }
6
 
7
-    AssertCompile((uintptr_t)NIL_RTMEMCACHE == 0);
8
+    AssertCompile(NIL_RTMEMCACHE == (RTMEMCACHE)0);
9
     if (pThis->hHgcmCmdCache != NIL_RTMEMCACHE)
10
     {
11
         RTMemCacheDestroy(pThis->hHgcmCmdCache);
(-)emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageHelp.cpp (-6 / +15 lines)
Lines 1-6 Link Here
1
--- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig	2016-08-16 19:59:52 UTC
1
--- src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp.orig	2019-01-25 18:19:18 UTC
2
+++ src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
2
+++ src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
3
@@ -797,7 +797,7 @@ void printUsage(USAGECATEGORY fCategory,
3
@@ -610,7 +610,7 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub
4
                      "                                             file <file>|\n"
5
                      "                                             <devicename>]\n"
6
                      "                            [--uarttype<1-N> 16450|16550A|16750\n"
7
-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
8
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
9
                      "                            [--lpt<1-N> off|<I/O base> <IRQ>]\n"
10
                      "                            [--lptmode<1-N> <devicename>]\n"
11
 #endif
12
@@ -624,7 +624,7 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub
4
             RTStrmPrintf(pStrm, "|dsound");
13
             RTStrmPrintf(pStrm, "|dsound");
5
 #endif
14
 #endif
6
         }
15
         }
Lines 9-18 Link Here
9
         {
18
         {
10
             RTStrmPrintf(pStrm, ""
19
             RTStrmPrintf(pStrm, ""
11
 #ifdef VBOX_WITH_AUDIO_OSS
20
 #ifdef VBOX_WITH_AUDIO_OSS
12
@@ -811,22 +811,6 @@ void printUsage(USAGECATEGORY fCategory,
21
@@ -637,22 +637,6 @@ void printUsage(USAGECATEGORY fCategory, uint32_t fSub
22
                                 "|pulse"
13
 #endif
23
 #endif
14
                         );
24
                         );
15
         }
25
-        }
16
-        if (fFreeBSD)
26
-        if (fFreeBSD)
17
-        {
27
-        {
18
-#ifdef VBOX_WITH_AUDIO_OSS
28
-#ifdef VBOX_WITH_AUDIO_OSS
Lines 28-34 Link Here
28
-#ifdef VBOX_WITH_AUDIO_PULSE
38
-#ifdef VBOX_WITH_AUDIO_PULSE
29
-            RTStrmPrintf(pStrm, "|pulse");
39
-            RTStrmPrintf(pStrm, "|pulse");
30
-#endif
40
-#endif
31
-        }
41
         }
32
         if (fDarwin)
42
         if (fDarwin)
33
         {
43
         {
34
             RTStrmPrintf(pStrm, "|coreaudio");
(-)emulators/virtualbox-ose/files/patch-src_VBox_Frontends_VBoxManage_VBoxManageModifyVM.cpp (+29 lines)
Line 0 Link Here
1
--- src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp.orig	2019-01-25 18:19:18.000000000 +0000
2
+++ src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp	2019-02-01 06:06:37.701231000 +0000
3
@@ -150,7 +150,7 @@ enum
4
     MODIFYVM_UARTMODE,
5
     MODIFYVM_UARTTYPE,
6
     MODIFYVM_UART,
7
-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
8
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
9
     MODIFYVM_LPTMODE,
10
     MODIFYVM_LPT,
11
 #endif
12
@@ -341,7 +341,7 @@ static const RTGETOPTDEF g_aModifyVMOptions[] =
13
     { "--uartmode",                 MODIFYVM_UARTMODE,                  RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
14
     { "--uarttype",                 MODIFYVM_UARTTYPE,                  RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
15
     { "--uart",                     MODIFYVM_UART,                      RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
16
-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
17
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
18
     { "--lptmode",                  MODIFYVM_LPTMODE,                   RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
19
     { "--lpt",                      MODIFYVM_LPT,                       RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
20
 #endif
21
@@ -2224,7 +2224,7 @@ RTEXITCODE handleModifyVM(HandlerArg *a)
22
                 break;
23
             }
24
 
25
-#if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
26
+#if defined(RT_OS_FREEBSD) || defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS)
27
             case MODIFYVM_LPTMODE:
28
             {
29
                 ComPtr<IParallelPort> lpt;
(-)emulators/virtualbox-ose/files/patch-src_VBox_HostDrivers_Support_freebsd_SUPDrv-freebsd.c (-10 / +15 lines)
Lines 1-4 Link Here
1
--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig	2018-10-15 14:30:57 UTC
1
--- src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c.orig	2019-01-25 18:19:55 UTC
2
+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
2
+++ src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
3
@@ -46,6 +46,7 @@
3
@@ -46,6 +46,7 @@
4
 #include <sys/uio.h>
4
 #include <sys/uio.h>
Lines 47-53 Link Here
47
             /*
47
             /*
48
              * Configure character devices. Add symbolic links for compatibility.
48
              * Configure character devices. Add symbolic links for compatibility.
49
              */
49
              */
50
@@ -311,7 +328,21 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo
50
@@ -311,11 +328,25 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo
51
     PSUPDRVSESSION pSession;
51
     PSUPDRVSESSION pSession;
52
     devfs_get_cdevpriv((void **)&pSession);
52
     devfs_get_cdevpriv((void **)&pSession);
53
 
53
 
Lines 68-77 Link Here
68
+    /*
68
+    /*
69
      * Deal with the fast ioctl path first.
69
      * Deal with the fast ioctl path first.
70
      */
70
      */
71
     if (   (   ulCmd == SUP_IOCTL_FAST_DO_RAW_RUN
71
     AssertCompile((SUP_IOCTL_FAST_DO_FIRST & 0xff) == (SUP_IOCTL_FLAG | 64));
72
@@ -325,6 +356,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo
72
-    if (   (uintptr_t)(iCmd - SUP_IOCTL_FAST_DO_FIRST) < (uintptr_t)32
73
+    if (   (uintptr_t)(ulCmd - SUP_IOCTL_FAST_DO_FIRST) < (uintptr_t)32
74
         && pSession->fUnrestricted)
75
         return supdrvIOCtlFast(ulCmd - SUP_IOCTL_FAST_DO_FIRST, *(uint32_t *)pvData, &g_VBoxDrvFreeBSDDevExt, pSession);
73
 
76
 
77
@@ -324,6 +355,45 @@ static int VBoxDrvFreeBSDIOCtl(struct cdev *pDev, u_lo
74
 
78
 
79
 
75
 /**
80
 /**
76
+ * Alternative Device I/O Control entry point on hosts with SMAP support.
81
+ * Alternative Device I/O Control entry point on hosts with SMAP support.
77
+ *
82
+ *
Lines 115-121 Link Here
115
  * Deal with the 'slow' I/O control requests.
120
  * Deal with the 'slow' I/O control requests.
116
  *
121
  *
117
  * @returns 0 on success, appropriate errno on failure.
122
  * @returns 0 on success, appropriate errno on failure.
118
@@ -373,11 +443,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes
123
@@ -372,11 +442,10 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes
119
          */
124
          */
120
         SUPREQHDR Hdr;
125
         SUPREQHDR Hdr;
121
         pvUser = *(void **)pvData;
126
         pvUser = *(void **)pvData;
Lines 130-136 Link Here
130
         }
135
         }
131
         if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC))
136
         if (RT_UNLIKELY((Hdr.fFlags & SUPREQHDR_FLAGS_MAGIC_MASK) != SUPREQHDR_FLAGS_MAGIC))
132
         {
137
         {
133
@@ -402,13 +471,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes
138
@@ -401,13 +470,12 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes
134
             OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd));
139
             OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: failed to allocate buffer of %d bytes; ulCmd=%#lx\n", cbReq, ulCmd));
135
             return ENOMEM;
140
             return ENOMEM;
136
         }
141
         }
Lines 148-154 Link Here
148
         }
153
         }
149
         if (Hdr.cbIn < cbReq)
154
         if (Hdr.cbIn < cbReq)
150
             RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn);
155
             RT_BZERO((uint8_t *)pHdr + Hdr.cbIn, cbReq - Hdr.cbIn);
151
@@ -436,9 +504,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes
156
@@ -435,9 +503,8 @@ static int VBoxDrvFreeBSDIOCtlSlow(PSUPDRVSESSION pSes
152
                 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd));
157
                 OSDBGPRINT(("VBoxDrvFreeBSDIOCtlSlow: too much output! %#x > %#x; uCmd=%#lx!\n", cbOut, cbReq, ulCmd));
153
                 cbOut = cbReq;
158
                 cbOut = cbReq;
154
             }
159
             }
Lines 160-166 Link Here
160
 
165
 
161
             Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd));
166
             Log(("VBoxDrvFreeBSDIOCtlSlow: returns %d / %d ulCmd=%lx\n", 0, pHdr->rc, ulCmd));
162
 
167
 
163
@@ -541,8 +608,7 @@ bool VBOXCALL  supdrvOSGetForcedAsyncTscMode(PSUPDRVDE
168
@@ -540,8 +607,7 @@ bool VBOXCALL  supdrvOSGetForcedAsyncTscMode(PSUPDRVDE
164
 
169
 
165
 bool VBOXCALL  supdrvOSAreCpusOfflinedOnSuspend(void)
170
 bool VBOXCALL  supdrvOSAreCpusOfflinedOnSuspend(void)
166
 {
171
 {
Lines 170-176 Link Here
170
 }
175
 }
171
 
176
 
172
 
177
 
173
@@ -616,11 +682,25 @@ int VBOXCALL    supdrvOSMsrProberModify(RTCPUID idCpu,
178
@@ -624,11 +690,25 @@ int VBOXCALL    supdrvOSMsrProberModify(RTCPUID idCpu,
174
 #endif /* SUPDRV_WITH_MSR_PROBER */
179
 #endif /* SUPDRV_WITH_MSR_PROBER */
175
 
180
 
176
 
181
 
Lines 196-202 Link Here
196
 
201
 
197
     va_start(va, pszFormat);
202
     va_start(va, pszFormat);
198
     cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va);
203
     cch = RTStrPrintfV(szMsg, sizeof(szMsg), pszFormat, va);
199
@@ -628,12 +708,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...)
204
@@ -636,12 +716,19 @@ SUPR0DECL(int) SUPR0Printf(const char *pszFormat, ...)
200
 
205
 
201
     printf("%s", szMsg);
206
     printf("%s", szMsg);
202
 
207
 
(-)emulators/virtualbox-ose/pkg-plist (-2 / +6 lines)
Lines 14-19 bin/vboxmanage Link Here
14
%%X11%%bin/vboxsdl
14
%%X11%%bin/vboxsdl
15
%%WEBSERVICE%%bin/vboxwebsrv
15
%%WEBSERVICE%%bin/vboxwebsrv
16
%%QT%%bin/virtualbox
16
%%QT%%bin/virtualbox
17
%%QT%%bin/virtualboxvm
17
include/virtualbox/VirtualBox_XPCOM.h
18
include/virtualbox/VirtualBox_XPCOM.h
18
include/virtualbox/ipcIClientObserver.h
19
include/virtualbox/ipcIClientObserver.h
19
include/virtualbox/ipcIDConnectService.h
20
include/virtualbox/ipcIDConnectService.h
Lines 385-390 lib/virtualbox/VBoxDDU.so Link Here
385
lib/virtualbox/VBoxEFI32.fd
386
lib/virtualbox/VBoxEFI32.fd
386
lib/virtualbox/VBoxEFI64.fd
387
lib/virtualbox/VBoxEFI64.fd
387
lib/virtualbox/VBoxExtPackHelperApp
388
lib/virtualbox/VBoxExtPackHelperApp
389
%%QT%%lib/virtualbox/VBoxGlobal.so
388
lib/virtualbox/VBoxGuestControlSvc.so
390
lib/virtualbox/VBoxGuestControlSvc.so
389
lib/virtualbox/VBoxGuestPropSvc.so
391
lib/virtualbox/VBoxGuestPropSvc.so
390
@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxHeadless
392
@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxHeadless
Lines 409-414 lib/virtualbox/VBoxRT.so Link Here
409
%%X11%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxSDL
411
%%X11%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VBoxSDL
410
%%X11%%lib/virtualbox/VBoxSDL.so
412
%%X11%%lib/virtualbox/VBoxSDL.so
411
lib/virtualbox/VBoxSVC
413
lib/virtualbox/VBoxSVC
414
%%X11%%lib/virtualbox/VBoxSVGA3D.so
412
%%X11%%lib/virtualbox/VBoxSharedClipboard.so
415
%%X11%%lib/virtualbox/VBoxSharedClipboard.so
413
%%X11%%lib/virtualbox/VBoxSharedCrOpenGL.so
416
%%X11%%lib/virtualbox/VBoxSharedCrOpenGL.so
414
lib/virtualbox/VBoxSharedFolders.so
417
lib/virtualbox/VBoxSharedFolders.so
Lines 420-427 lib/virtualbox/VBoxXPCOMC.so Link Here
420
lib/virtualbox/VBoxXPCOMIPCD
423
lib/virtualbox/VBoxXPCOMIPCD
421
lib/virtualbox/VMMR0.r0
424
lib/virtualbox/VMMR0.r0
422
lib/virtualbox/VMMRC.rc
425
lib/virtualbox/VMMRC.rc
423
%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBox
426
%%QT%%lib/virtualbox/VirtualBox
424
%%QT%%lib/virtualbox/VirtualBox.so
427
%%QT%%@(root,%%VBOXGROUP%%,4510) lib/virtualbox/VirtualBoxVM
428
%%QT%%lib/virtualbox/VirtualBoxVM.so
425
%%SDK%%lib/virtualbox/sdk
429
%%SDK%%lib/virtualbox/sdk
426
%%WEBSERVICE%%lib/virtualbox/vboxwebsrv
430
%%WEBSERVICE%%lib/virtualbox/vboxwebsrv
427
%%WEBSERVICE%%lib/virtualbox/webtest
431
%%WEBSERVICE%%lib/virtualbox/webtest
(-)emulators/virtualbox-ose-additions/Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	virtualbox-ose
4
PORTNAME=	virtualbox-ose
5
PORTVERSION=	5.2.26
5
PORTVERSION=	6.0.4
6
CATEGORIES=	emulators
6
CATEGORIES=	emulators
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
8
PKGNAMESUFFIX?=	-additions
8
PKGNAMESUFFIX?=	-additions
(-)emulators/virtualbox-ose-additions/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1548732081
1
TIMESTAMP = 1548976366
2
SHA256 (VirtualBox-5.2.26.tar.bz2) = 4debe583463be3917ac60ad76a31f6db27586423d86f1f53c060d70d5e70d467
2
SHA256 (VirtualBox-6.0.4.tar.bz2) = f80b0c68182c946fb74ada8034960c38159ad91085b153da1277e4f191af6e1f
3
SIZE (VirtualBox-5.2.26.tar.bz2) = 118371765
3
SIZE (VirtualBox-6.0.4.tar.bz2) = 155233564
(-)emulators/virtualbox-ose-additions-nox11/Makefile (-1 lines)
Lines 1-6 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTREVISION=	1
4
PKGNAMESUFFIX=	-additions-nox11
3
PKGNAMESUFFIX=	-additions-nox11
5
4
6
OPTIONS_EXCLUDE=	DBUS DEBUG OPENGL X11
5
OPTIONS_EXCLUDE=	DBUS DEBUG OPENGL X11
(-)emulators/virtualbox-ose-kmod/Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	virtualbox-ose
4
PORTNAME=	virtualbox-ose
5
PORTVERSION=	5.2.26
5
PORTVERSION=	6.0.4
6
CATEGORIES=	emulators
6
CATEGORIES=	emulators
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
7
MASTER_SITES=	https://download.virtualbox.org/virtualbox/${PORTVERSION}/
8
PKGNAMESUFFIX=	-kmod
8
PKGNAMESUFFIX=	-kmod
(-)emulators/virtualbox-ose-kmod/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1548732081
1
TIMESTAMP = 1548976366
2
SHA256 (VirtualBox-5.2.26.tar.bz2) = 4debe583463be3917ac60ad76a31f6db27586423d86f1f53c060d70d5e70d467
2
SHA256 (VirtualBox-6.0.4.tar.bz2) = f80b0c68182c946fb74ada8034960c38159ad91085b153da1277e4f191af6e1f
3
SIZE (VirtualBox-5.2.26.tar.bz2) = 118371765
3
SIZE (VirtualBox-6.0.4.tar.bz2) = 155233564
(-)emulators/virtualbox-ose-nox11/Makefile (-3 / +2 lines)
Lines 1-10 Link Here
1
# $FreeBSD$
1
# $FreeBSD$
2
2
3
PORTREVISION=	1
4
PKGNAMESUFFIX=	-nox11
3
PKGNAMESUFFIX=	-nox11
5
4
6
OPTIONS_EXCLUDE=	ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS PULSEAUDIO
5
OPTIONS_EXCLUDE=	ALSA DBUS DEBUG GUESTADDITIONS MANUAL NLS OPUS
7
OPTIONS_EXCLUDE+=	QT5 VPX X11
6
OPTIONS_EXCLUDE+=	PULSEAUDIO QT5 VPX X11
8
7
9
MASTERDIR=	${.CURDIR}/../virtualbox-ose
8
MASTERDIR=	${.CURDIR}/../virtualbox-ose
10
9

Return to bug 234878