9pfs: Add FreeBSD support
This is largely derived from existing Darwin support. FreeBSD apparently has better support for *at() system calls so doesn't require workarounds for a missing mknodat(). The implementation has a couple of warts however: - The extattr(2) system calls don't support anything akin to XATTR_CREATE or XATTR_REPLACE, so a racy workaround is implemented. - Attribute names cannot begin with "user." or "system." on ZFS. However FreeBSD's extattr(2) system calls support two dedicated namespaces for these two. So "user." or "system." prefixes are trimmed off from attribute names and instead EXTATTR_NAMESPACE_USER or EXTATTR_NAMESPACE_SYSTEM are picked and passed to extattr system calls accordingly. The 9pfs tests were verified to pass on the UFS, ZFS and tmpfs filesystems. Signed-off-by: Mark Johnston <markj@FreeBSD.org> Link: https://lore.kernel.org/qemu-devel/aJOWhHB2p-fbueAm@nuc Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
This commit is contained in:
parent
e7c1e8043a
commit
6657f3bb55
9 changed files with 179 additions and 15 deletions
|
|
@ -21,9 +21,11 @@
|
|||
|
||||
#ifdef CONFIG_LINUX
|
||||
# include <sys/vfs.h>
|
||||
#endif
|
||||
#ifdef CONFIG_DARWIN
|
||||
#elif defined(CONFIG_DARWIN) || defined(CONFIG_FREEBSD)
|
||||
# include <sys/param.h>
|
||||
# ifdef CONFIG_FREEBSD
|
||||
# undef MACHINE /* work around some unfortunate namespace pollution */
|
||||
# endif
|
||||
# include <sys/mount.h>
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,6 @@ fsdev_ss.add(when: ['CONFIG_FSDEV_9P'], if_true: files(
|
|||
'9p-marshal.c',
|
||||
'qemu-fsdev.c',
|
||||
), if_false: files('qemu-fsdev-dummy.c'))
|
||||
if host_os in ['linux', 'darwin']
|
||||
if host_os in ['linux', 'darwin', 'freebsd']
|
||||
system_ss.add_all(fsdev_ss)
|
||||
endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue