git: 2db7c8763897 - main - emulators/virtualbox-ose-additions(-legacy): Fix build on recent head

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Sat, 05 Feb 2022 20:39:45 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2db7c8763897e352fb8d74bfd60d9e32622ba82c

commit 2db7c8763897e352fb8d74bfd60d9e32622ba82c
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2022-02-05 20:37:14 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2022-02-05 20:37:14 +0000

    emulators/virtualbox-ose-additions(-legacy): Fix build on recent head
    
    On recent head, after src commit 66c5fbca7719dc, the insmntque1(9)
    function arguments changed.
    
    Adapt virtualbox code, following what has been done in base with
    other filesystems migrating to insmntque(9).
---
 ...tch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c | 14 +++++++++++---
 ...tch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c | 14 +++++++++++---
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/emulators/virtualbox-ose-legacy/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c b/emulators/virtualbox-ose-legacy/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
index 068f98f21d1c..a191d66946cf 100644
--- a/emulators/virtualbox-ose-legacy/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
+++ b/emulators/virtualbox-ose-legacy/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
@@ -1,6 +1,6 @@
---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2021-07-28 16:16:27 UTC
+--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2020-07-09 16:50:11 UTC
 +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c
-@@ -14,228 +14,1354 @@
+@@ -14,228 +14,1362 @@
   * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
   * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
   */
@@ -352,9 +352,17 @@
 +	if (vp->v_type != VFIFO)
 +		VN_LOCK_ASHARE(vp);
 +
++#if __FreeBSD_version < 1400051
 +	error = insmntque1(vp, mp, vboxfs_insmntque_dtr, NULL);
-+	if (error)
++#else
++	error = insmntque(vp, mp);
++#endif
++	if (error) {
++#if __FreeBSD_version >= 1400051
++		vboxfs_insmntque_dtr(vp, NULL);
++#endif
 +		vp = NULL;
++	}
 +
 +unlock:
 +	VBOXFS_NODE_LOCK(node);
diff --git a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
index 068f98f21d1c..a1a69874a29e 100644
--- a/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
+++ b/emulators/virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c
@@ -1,6 +1,6 @@
---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2021-07-28 16:16:27 UTC
+--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig	2022-01-13 18:49:34 UTC
 +++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c
-@@ -14,228 +14,1354 @@
+@@ -14,228 +14,1362 @@
   * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
   * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
   */
@@ -352,9 +352,17 @@
 +	if (vp->v_type != VFIFO)
 +		VN_LOCK_ASHARE(vp);
 +
++#if __FreeBSD_version < 1400051
 +	error = insmntque1(vp, mp, vboxfs_insmntque_dtr, NULL);
-+	if (error)
++#else
++	error = insmntque(vp, mp);
++#endif
++	if (error) {
++#if __FreeBSD_version >= 1400051
++		vboxfs_insmntque_dtr(vp, NULL);
++#endif
 +		vp = NULL;
++	}
 +
 +unlock:
 +	VBOXFS_NODE_LOCK(node);