Add an implementation of the 9P filesystemThis is derived from swills@ fork of the Juniper virtfs with manychanges by me including bug fixes, style improvements, clearer layeringand more consiste
Add an implementation of the 9P filesystemThis is derived from swills@ fork of the Juniper virtfs with manychanges by me including bug fixes, style improvements, clearer layeringand more consistent logging. The filesystem is renamed to p9fs to betterreflect its function and to prevent possible future confusion withvirtio-fs.Several updates and fixes from Juniper have been integrated into thisversion by Val Packett and these contributions along with the originalJuniper authors are credited below.To use this with bhyve, add 'virtio_p9fs_load=YES' to loader.conf. Thebhyve virtio-9p device allows access from the guest to files on the hostby mapping a 'sharename' to a host path. It is possible to use p9fs as aroot filesystem by adding this to /boot/loader.conf: vfs.root.mountfrom="p9fs:sharename"for non-root filesystems add something like this to /etc/fstab: sharename /mnt p9fs rw 0 0In both examples, substitute the share name used on the bhyve commandline.The 9P filesystem protocol relies on stateful file opens which mapprotocol-level FIDs to host file descriptors. The FreeBSD vnodeinterface doesn't really support this and we use heuristics to guess theright FID to use for file operations. This can be confused by privilegelowering and does not guarantee that the FID created for a given fileopen is always used for file operations, even if the calling process isusing the file descriptor from the original open call. Improving thiswould involve changes to the vnode interface which is out-of-scope forthis import.Differential Revision: https://reviews.freebsd.org/D41844Reviewed by: kib, emaste, dchMFC after: 3 monthsCo-authored-by: Val Packett <val@packett.cool>Co-authored-by: Ka Ho Ng <kahon@juniper.net>Co-authored-by: joyu <joyul@juniper.net>Co-authored-by: Kumara Babu Narayanaswamy <bkumara@juniper.net>
show more ...