Re: [PATCH v3] net/9p: add vsock transport
From: Dominique Martinet
Date: Sun Sep 13 2026 - 10:10:27 EST
skvarlamatus@xxxxxxxxx wrote on Thu, Jul 09, 2026 at 06:17:41PM +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.
>
> The privport mount option is not currently implemented for vsock and
> returns -EOPNOTSUPP if specified.
>
> 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>
> Reviewed-by: Stefan Hajnoczi <stefanha@xxxxxxxxxx>
> Acked-by: Stefano Garzarella <sgarzare@xxxxxxxxxx>
Thanks for the v3
I'm mostly happy with the code, but I have a few high level questions
before sending this to Linus (I'll probably take the patch for -next
next week anyway):
- I've looked at v1/v2 threads and I don't actually see any rationale
explained: what's the benefit of this over e.g. virito or xen
transports?
Do you have/use an hypervisor that cannot do virito 9p (or virtfs) but
has vsock or something like that?
- On a similar topic, do you have an actual server that works with
vsock?
I've seen I can test with diod+socat[1], but I expect to see a real user
ready if this is merged, not just "this can work"
[1] https://github.com/chaos/diod/issues/148
Thanks,
--
Dominique Martinet | Asmadeus