From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Dr. David Alan Gilbert" <dave@treblig.org>,
"Stefan Weil" <sw@weilnetz.de>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH v3 10/11] net: Add passt network backend
Date: Mon, 7 Jul 2025 09:53:45 +0100 [thread overview]
Message-ID: <aGuLGfZMMcFz6Pfe@redhat.com> (raw)
In-Reply-To: <20250707081505.127519-11-lvivier@redhat.com>
On Mon, Jul 07, 2025 at 10:15:04AM +0200, Laurent Vivier wrote:
> This commit introduces support for passt as a new network backend.
> passt is an unprivileged, user-mode networking solution that provides
> connectivity for virtual machines by launching an external helper process.
>
> The implementation reuses the generic stream data handling logic. It
> launches the passt binary using GSubprocess, passing it a file
> descriptor from a socketpair() for communication. QEMU connects to
> the other end of the socket pair to establish the network data stream.
>
> The PID of the passt daemon is tracked via a temporary file to
> ensure it is terminated when QEMU exits.
>
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
> docs/system/devices/net.rst | 40 +++++-
> hmp-commands.hx | 3 +
> meson.build | 6 +
> meson_options.txt | 2 +
> net/clients.h | 4 +
> net/hub.c | 3 +
> net/meson.build | 3 +
> net/net.c | 4 +
> net/passt.c | 241 ++++++++++++++++++++++++++++++++++
> qapi/net.json | 25 ++++
> qemu-options.hx | 44 ++++++-
> scripts/meson-buildoptions.sh | 3 +
> 12 files changed, 374 insertions(+), 4 deletions(-)
> create mode 100644 net/passt.c
snip
> +There is no need to start the daemon as QEMU will do it for you.
> +
> +passt is started in the socket-based mode.
> +
> +.. parsed-literal::
> + |qemu_system| [...OPTIONS...] -nic passt
> +
> + (qemu) info network
> + e1000e.0: index=0,type=nic,model=e1000e,macaddr=52:54:00:12:34:56
> + \ #net071: index=0,type=passt,stream,connected to pid 24846
> +
> +.. parsed-literal::
> + |qemu_system| [...OPTIONS...] -net nic -net passt,param=--tcp-ports=10001,param=udp-ports=10001
Missing '--' before 'udp-ports=', but ...
> diff --git a/qapi/net.json b/qapi/net.json
> index 97ea1839813b..8a8528ba1f47 100644
> --- a/qapi/net.json
> +++ b/qapi/net.json
> @@ -112,6 +112,26 @@
> 'data': {
> 'str': 'str' } }
>
> +##
> +# @NetDevPasstOptions:
> +#
> +# Unprivileged user-mode network connectivity using passt
> +#
> +# @path: Filename of the passt program to run (by default 'passt', and use PATH)
> +#
> +# @quiet: don't print informational messages (default, passed as '--quiet')
> +#
> +# @param: parameter to pass to passt command
> +#
> +# Since: 10.1
> +##
> +{ 'struct': 'NetDevPasstOptions',
> + 'data': {
> + '*path': 'str',
> + '*quiet': 'bool',
> + '*param': ['String'] },
> + 'if': 'CONFIG_PASST' }
.... IMHO this is a really horrible way to wire this up into QEMU,
which largely defeats the benefit of having a passt network backend.
It throws away all type validation of passt parameters at the QEMU
level, which is one of the more compelling aspects of using QAPI/QMP,
especially on the JSON side. One the CLI side, the argv is really
horrible to read, even by QEMU's low-standards.
I'd much rather see v2 of this patchset. If users need to have
full control over every conceivable passt option at all times,
then the existing way passt is used with QEMU continues to exist
and isn't significantly more complicated than this v3 series.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2025-07-07 8:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-07 8:14 [PATCH v3 00/11] net: Add passt netdev backend Laurent Vivier
2025-07-07 8:14 ` [PATCH v3 01/11] net: Refactor stream logic for reuse in '-net passt' Laurent Vivier
2025-07-07 8:14 ` [PATCH v3 02/11] net: Define net_client_set_link() Laurent Vivier
2025-07-07 8:14 ` [PATCH v3 03/11] vhost_net: Rename vhost_set_vring_enable() for clarity Laurent Vivier
2025-07-07 8:14 ` [PATCH v3 04/11] net: Add get_vhost_net callback to NetClientInfo Laurent Vivier
2025-07-07 8:14 ` [PATCH v3 05/11] net: Consolidate vhost feature bits into vhost_net structure Laurent Vivier
2025-07-07 8:15 ` [PATCH v3 06/11] net: Add get_acked_features callback to VhostNetOptions Laurent Vivier
2025-07-07 8:15 ` [PATCH v3 07/11] net: Add save_acked_features callback to vhost_net Laurent Vivier
2025-07-07 8:15 ` [PATCH v3 08/11] net: Allow network backends to advertise max TX queue size Laurent Vivier
2025-07-07 8:15 ` [PATCH v3 09/11] net: Add is_vhost_user flag to vhost_net struct Laurent Vivier
2025-07-07 8:15 ` [PATCH v3 10/11] net: Add passt network backend Laurent Vivier
2025-07-07 8:53 ` Daniel P. Berrangé [this message]
2025-07-07 8:15 ` [PATCH v3 11/11] net/passt: Implement vhost-user backend support Laurent Vivier
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=aGuLGfZMMcFz6Pfe@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=eblake@redhat.com \
--cc=jasowang@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=sw@weilnetz.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.