Re: [PATCH] net/9p: add vsock transport

From: Dominique Martinet

Date: Thu May 28 2026 - 23:02:14 EST


skvarlamatus@xxxxxxxxx wrote on Wed, May 27, 2026 at 09:34:47AM +0200:
> From: Matus Skvarla <skvarlamatus@xxxxxxxxx>
>
> 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.
>
> 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.
>
> 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.
>
> Usage:
> mount -t 9p -o trans=vsock[,port=<port>] <CID> /mnt/point
>
> Signed-off-by: Matus Skvarla <skvarlamatus@xxxxxxxxx>

In addition to Stefan's comments there are a few valid remarks from
sashiko.dev (e.g. port number being truncated); please have a look

https://sashiko.dev/#/patchset/20260527073447.86538-1-skvarlamatus%40gmail.com

--
Dominique