From: Stefano Garzarella <sgarzare@redhat.com>
To: skvarlamatus@gmail.com
Cc: ericvh@kernel.org, lucho@ionkov.net, asmadeus@codewreck.org,
linux_oss@crudebyte.com, v9fs@lists.linux.dev,
linux-kernel@vger.kernel.org, stefanha@redhat.com
Subject: Re: [PATCH v2] net/9p: add vsock transport
Date: Fri, 3 Jul 2026 11:12:39 +0200 [thread overview]
Message-ID: <akd7QliTAWpkmE0Q@sgarzare-redhat> (raw)
In-Reply-To: <20260701155922.95502-1-skvarlamatus@gmail.com>
On Wed, Jul 01, 2026 at 05:59:22PM +0200, skvarlamatus@gmail.com wrote:
>From: Matus Skvarla <skvarlamatus@gmail.com>
>
>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 supported for vsock and
>returns -EOPNOTSUPP if specified.
Why not?
I'm no expert on 9p; it's just out of curiosity.
>
>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@gmail.com>
>---
>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_fd_create_tcp())
> - Add vsock to Documentation/filesystems/9p.rst
>Link to v1: https://lore.kernel.org/v9fs/20260527073447.86538-1-skvarlamatus@gmail.com/
>---
> 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(-)
>
>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.
>
>+For server accessible over vsock (VM sockets)::
>+
>+ mount -t 9p -o trans=vsock <CID> /mnt/9
>+
>+where CID is the vsock Context ID of the remote endpoint (2 for host from
>+a guest VM, 3+ for guest VMs from the host). The port to connect to can be
>+specified with the port option (default: 564).
>+
> USBG Usage
> ==========
>
>@@ -115,8 +123,10 @@ Options
> ======== ============================================
> unix specifying a named pipe mount point
> tcp specifying a normal TCP/IP connection
>- fd used passed file descriptors for connection
>+ fd uses passed file descriptors for connection
nit: unrelated change?
The rest LGTM, so for vsock point of view:
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
next prev parent reply other threads:[~2026-07-03 9:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 15:59 [PATCH v2] net/9p: add vsock transport skvarlamatus
2026-07-03 5:41 ` Stefan Hajnoczi
[not found] ` <CANG_AsJtiN+31UCEZDSRX5ckq10vW-Qw7gjcBcB+feDZA7rgww@mail.gmail.com>
2026-07-03 14:16 ` Dominique Martinet
2026-07-03 14:58 ` skvarlamatus
2026-07-03 14:16 ` Matus Skvarla
2026-07-03 14:39 ` Matus Skvarla
2026-07-03 9:12 ` Stefano Garzarella [this message]
2026-07-03 14:31 ` skvarlamatus
2026-07-03 14:39 ` Stefano Garzarella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=akd7QliTAWpkmE0Q@sgarzare-redhat \
--to=sgarzare@redhat.com \
--cc=asmadeus@codewreck.org \
--cc=ericvh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux_oss@crudebyte.com \
--cc=lucho@ionkov.net \
--cc=skvarlamatus@gmail.com \
--cc=stefanha@redhat.com \
--cc=v9fs@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox