Re: [PATCH v2] net/9p: add vsock transport
Stefan Hajnoczi <[email protected]> Fri, 3 Jul 2026 07:41:33 +0200
| Newsgroups | dev.linux.lists.v9fs,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <20260703054133.GB448934@fedora> |
--7+83Ftc4nKYQpn3M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 01, 2026 at 05:59:22PM +0200, [email protected] wrote: > From: Matus Skvarla <[email protected]> >=20 > Add vsock as a transport option for 9P client connections. This > allows mounting 9P filesystems over VM sockets without requiring TCP/IP > networking or additional userspace tools. >=20 > The implementation extends trans_fd.c with vsock support, reusing the > existing socket infrastructure. A new p9_fd_create_vsock() function > handles vsock connection setup by parsing the CID from the mount source, > creating an AF_VSOCK socket, and connecting to the specified endpoint. > All other transport operations (close, request, cancel) use the shared > fd transport implementation. >=20 > The privport mount option is not currently supported for vsock and > returns -EOPNOTSUPP if specified. >=20 > Add CONFIG_NET_9P_VSOCK option that conditionally compiles vsock support > into 9pnet_fd.ko. This follows the pattern where socket-based transports > (TCP, Unix, vsock) share trans_fd.c, while specialized hardware transports > (virtio, xen, rdma) have dedicated files. >=20 > Usage: > mount -t 9p -o trans=3Dvsock[,port=3D<port>] <CID> /mnt/point >=20 > Signed-off-by: Matus Skvarla <[email protected]> > --- > Changes in v2: > - Add depends on NET_9P_FD to Kconfig > - Use #include <uapi/linux/vm_sockets.h> > - Reject privport option with -EOPNOTSUPP > - Use fc->net_ns instead of current->nsproxy->net_ns > - Widen vsock port to u32 to match sockaddr_vm.svm_port > - Widen p9_fd_opts.port to u32 and port_str buffer accordingly (in p9_f= d_create_tcp()) > - Add vsock to Documentation/filesystems/9p.rst > Link to v1: https://lore.kernel.org/v9fs/20260527073447.86538-1-skvarlama= [email protected]/ > --- > Documentation/filesystems/9p.rst | 12 +++- > include/net/9p/client.h | 10 +++- > net/9p/Kconfig | 10 ++++ > net/9p/trans_fd.c | 97 +++++++++++++++++++++++++++++++- > 4 files changed, 124 insertions(+), 5 deletions(-) >=20 > diff --git a/Documentation/filesystems/9p.rst b/Documentation/filesystems= /9p.rst > index 3f65db648db0..d1bac30b3c9d 100644 > --- a/Documentation/filesystems/9p.rst > +++ b/Documentation/filesystems/9p.rst > @@ -50,6 +50,14 @@ mount points. Each 9P export is seen by the client as = a virtio device with an > associated "mount_tag" property. Available mount tags can be > seen by reading /sys/bus/virtio/drivers/9pnet_virtio/virtio<n>/mount_tag= files. > =20 > +For server accessible over vsock (VM sockets):: > + > + mount -t 9p -o trans=3Dvsock <CID> /mnt/9 If you respin this patch, please add the port=3D option because it is absent from this example and it could be missed if one doesn't read the paragraph below carefully: mount -t 9p -o trans=3Dvsock[,port=3D<port>] <CID> /mnt/9 Other than that: Reviewed-by: Stefan Hajnoczi <[email protected]> --7+83Ftc4nKYQpn3M Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmpHS40ACgkQnKSrs4Gr c8jW4wf/RNJsWNQHO3OkT+F6Ic6uLAOH3Kh05rIv0UnodXFsTyK1MfqOiYOedI01 I2tAhOU3DB3sW13b78tlOB22FCc2sN5l9UMQB58UkdrKJIPX5JaTdzwosuMASIRo t0k7ctM2TETGhIqn0FwxsFs5dUXmdQJDkRjXqfbL/udVhr+OiBn6faT7bxwO/PLH fjtEVDT8No++IF1Fyw+cXXjHCD/az/jshxdyOs8Lih8W835vNO8SFLVlXgEZRQ1Z qJwjjNLxrOAOfCdbpMUu5VkyNBPnTGh8qVxBVdvJrV6HM/RbL/5aDc0GkO8Rz18C xknZPlvBRQSHcKaLyg6PP8TVbJVS/A== =R738 -----END PGP SIGNATURE----- --7+83Ftc4nKYQpn3M--