From owner-freebsd-emulation@freebsd.org Sat May 9 20:33:43 2020 Return-Path: Delivered-To: freebsd-emulation@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB5652F504D for ; Sat, 9 May 2020 20:33:43 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49KJnM3CLYz4JL6 for ; Sat, 9 May 2020 20:33:43 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: by mailman.nyi.freebsd.org (Postfix) id 6DDB02F504B; Sat, 9 May 2020 20:33:43 +0000 (UTC) Delivered-To: emulation@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DA332F504A for ; Sat, 9 May 2020 20:33:43 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KJnM141Kz4JL5 for ; Sat, 9 May 2020 20:33:43 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: by freefall.freebsd.org (Postfix) id EE842E617; Sat, 9 May 2020 20:33:42 +0000 (UTC) Delivered-To: vbox@localmail.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by freefall.freebsd.org (Postfix) with ESMTPS id E3F3AE431; Sat, 9 May 2020 20:33:42 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KJnK6rjlz4JL3; Sat, 9 May 2020 20:33:41 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 049KXas3044529 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 9 May 2020 13:33:37 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 049KXajl044528; Sat, 9 May 2020 13:33:36 -0700 (PDT) (envelope-from jmg) Date: Sat, 9 May 2020 13:33:36 -0700 From: John-Mark Gurney To: vbox@FreeBSD.org, mjg@FreeBSD.org Cc: freebsd-virtualization@freebsd.org Subject: patch to make vboxvfs work again Message-ID: <20200509203336.GN4213@funkthat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="j/HO4hzKTNbM1mOX" Content-Disposition: inline X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Sat, 09 May 2020 13:33:37 -0700 (PDT) X-Rspamd-Queue-Id: 49KJnK6rjlz4JL3 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 208.87.223.18) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [-0.47 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.84)[-0.837,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.38)[-0.376,0]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; DMARC_NA(0.00)[funkthat.com]; IP_SCORE(-0.46)[ip: (-1.19), ipnet: 208.87.216.0/21(-0.59), asn: 32354(-0.47), country: US(-0.05)]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Mailman-Approved-At: Sat, 09 May 2020 23:00:27 +0000 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.32 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 May 2020 20:33:43 -0000 --j/HO4hzKTNbM1mOX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello virtualbox maintainer(s), Attached is a patch to make VirtualBox vboxvfs work again. I've only tested under -current. mjg, what is the correct way to make this patch work on past versions of FreeBSD? would a simple #ifdef VFS_VOP_VECTOR_REGISTER wrapper around the call work? Thanks. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." --j/HO4hzKTNbM1mOX Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="virtualbox-ose.patch" Index: virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk =================================================================== --- virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk (revision 534710) +++ virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_Makefile.kmk (working copy) @@ -1,8 +1,10 @@ ---- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig 2017-04-28 16:59:22.000000000 +0200 -+++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk 2017-07-13 00:52:49.020669620 +0200 -@@ -33,32 +33,36 @@ +--- src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk.orig 2019-10-10 18:06:51.000000000 +0000 ++++ src/VBox/Additions/freebsd/vboxvfs/Makefile.kmk 2020-05-09 06:51:51.411749000 +0000 +@@ -32,33 +32,38 @@ + . \ $(vboxvfs_0_OUTDIR) vboxvfs_SOURCES = \ ++ bcmp.c \ vboxvfs_vfsops.c \ - vboxvfs_vnops.c + vboxvfs_vnops.c \ Index: virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c =================================================================== --- virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c (nonexistent) +++ virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c (working copy) @@ -0,0 +1,12 @@ +--- src/VBox/Additions/freebsd/vboxvfs/bcmp.c.orig 2020-05-09 06:57:06.229140000 +0000 ++++ src/VBox/Additions/freebsd/vboxvfs/bcmp.c 2020-05-09 06:54:55.886751000 +0000 +@@ -0,0 +1,9 @@ ++#include ++ ++int bcmp(const void *b1, const void *b2, size_t len); ++ ++int ++bcmp(const void *b1, const void *b2, size_t len) ++{ ++ return __builtin_memcmp((b1), (b2), (len)); ++} Property changes on: virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_bcmp.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c =================================================================== --- virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c (revision 534793) +++ virtualbox-ose/files/patch-src_VBox_Additions_freebsd_vboxvfs_vboxvfs__vnops.c (working copy) @@ -1,5 +1,5 @@ ---- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2019-10-10 18:06:51 UTC -+++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c +--- src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c.orig 2019-10-10 18:06:51.000000000 +0000 ++++ src/VBox/Additions/freebsd/vboxvfs/vboxvfs_vnops.c 2020-05-09 07:07:49.485808000 +0000 @@ -1,10 +1,6 @@ -/* $Id: vboxvfs_vnops.c $ */ -/** @file @@ -12,7 +12,7 @@ * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; -@@ -14,228 +10,1338 @@ +@@ -14,228 +10,1339 @@ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. */ @@ -172,6 +172,7 @@ + .vop_write = vboxfs_write, + .vop_bmap = VOP_EOPNOTSUPP }; ++VFS_VOP_VECTOR_REGISTER(vboxfs_vnodeops); -static int vboxvfs_access(struct vop_access_args *ap) +static uint64_t --j/HO4hzKTNbM1mOX--