From: Stefano Brivio <sbrivio@redhat.com>
To: Markus Armbruster via Devel <devel@lists.libvirt.org>
Cc: "Markus Armbruster" <armbru@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
qemu-devel@nongnu.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Stefan Weil" <sw@weilnetz.de>,
"Stefano Garzarella" <sgarzare@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Michael S. Tsirkin " <mst@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Dr. David Alan Gilbert " <dave@treblig.org>,
"Eric Blake" <eblake@redhat.com>
Subject: Re: [PATCH v2 09/10] net: Add passt network backend
Date: Mon, 30 Jun 2025 16:22:25 +0200 [thread overview]
Message-ID: <20250630162225.451a7df9@elisabeth> (raw)
In-Reply-To: <877c10cnqg.fsf@pond.sub.org>
On Wed, 25 Jun 2025 08:57:27 +0200
Markus Armbruster via Devel <devel@lists.libvirt.org> wrote:
> [...]
>
> Back to the design question how to pass configuration via qemu-system to
> the passt program with this new backend.
>
> Your patch replicates passt command line options as optional members of
> QAPI type NetDevPasstOptions. Any passt options not covered are
> inaccessible.
>
> Or rather inaccessible via QMP / HMP / CLI. You can still access them
> by pointing @passt to a wrapper script.
>
> This leads us to a possible alternative: make such a wrapper script the
> *only* way to configure passt. This is like NetdevTapOptions @script
> and @downscript. Mind, I'm not telling you it's a good idea, I'm merely
> trying to map the solution space!
I'd prefer this idea to having explicit QEMU support (code) for each
passt option, mostly because a. it's a lot of code and b. passt doesn't
completely guarantee backwards compatibility, only to a reasonable
extent (the general idea is to deprecate options first, then to make
them disappear in a couple of years).
Still, I see three main issues with it:
1. you would still need to distribute an example of a wrapper script,
and that will eventually get outdated as well
2. it's complicated and somewhat surprising. You would probably need to
configure different wrapper scripts (or functions in scripts?)
depending on what guest you're running
3. that would be the usual fun with LSMs. What SELinux label would the
script have? Should we define a separate AppArmor policy for it? Or
make it a subprofile...?
> Instead of trying to make NetDevPasstOptions complete (so you need to
> fall back to a wrapper script only when using a version of passt with
> different options), we can limit it to a curated set of options. We'd
> need to decide which ones :)
>
> You pointed out yet another alternative: pass through the passt command
> line directly. Two obvious ways: a single shell command string to be
> passed to system(3), or an array of strings to be passed to execv(3).
...so I'd much prefer this approach (it's actually an alternative I was
suggesting to Laurent in some offline chats earlier). We did the same
in Podman for pasta(1) (same binary as passt(1), different command, for
containers):
https://github.com/containers/common/blob/2d2b7a488601a3557301420fce6acb58d0898b95/libnetwork/pasta/pasta_linux.go#L172
where you would do, say:
podman --net=pasta:--pcap,/tmp/pasta.pcap,--no-dhcpv6,...
This one looks simple, the documentation of options is always updated
and maintained as part of passt's documentation, and there's no need to
change anything in QEMU if we introduce new options or deprecate some.
I would use an array of strings (same as it's done for Podman) rather
than a flat argument for system(3), because:
> system(3) is a terrible idea with untrusted input, but this is trusted
> input.
...even if it's trusted input, a single, long argument with quotes is
more error-prone than separate arguments, I think.
> Any other interface ideas?
>
> Since the backend is for human user convenience: which of these ways
> would be convenient for human users?
As I'm familiar with passt(1) options, passing options through is the
most convenient for me, personally.
I often use passt without libvirt exactly because it's awkward to pass,
say, debugging options (I have to use some horrible /usr/local/bin/passt
wrapper script with a switch case inferring the name of the guest from
the socket path given as argument, and sometimes it's unpractical):
https://issues.redhat.com/browse/RHEL-52281
and it's especially awkward to help users debugging things this way, so
it would be nice if QEMU could make it convenient, instead.
--
Stefano
next prev parent reply other threads:[~2025-06-30 14:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-18 15:57 [PATCH v2 00/10] net: Add passt netdev backend Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 01/10] net: Refactor stream logic for reuse in '-net passt' Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 02/10] net: Define net_client_set_link() Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 03/10] net: Introduce helper to identify vhost-user clients Laurent Vivier
2025-07-01 1:36 ` Jason Wang
2025-06-18 15:57 ` [PATCH v2 04/10] net: Add get_vhost_net callback to NetClientInfo Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 05/10] net: Consolidate vhost feature bits into NetClientInfo Laurent Vivier
2025-07-01 1:39 ` Jason Wang
2025-06-18 15:57 ` [PATCH v2 06/10] net: Add get_acked_features callback to NetClientInfo Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 07/10] net: Add save_acked_features " Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 08/10] net: Allow network backends to advertise max TX queue size Laurent Vivier
2025-06-18 15:57 ` [PATCH v2 09/10] net: Add passt network backend Laurent Vivier
2025-06-24 8:16 ` Markus Armbruster
2025-06-24 8:37 ` Laurent Vivier
2025-06-24 11:55 ` Markus Armbruster
2025-06-24 12:03 ` Daniel P. Berrangé
2025-06-24 12:47 ` Laurent Vivier
2025-06-25 6:57 ` Markus Armbruster
2025-06-30 14:22 ` Stefano Brivio [this message]
2025-07-01 1:46 ` Jason Wang
2025-07-01 13:00 ` Laurent Vivier
2025-07-03 10:27 ` Stefano Brivio
2025-06-18 15:57 ` [PATCH v2 10/10] 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=20250630162225.451a7df9@elisabeth \
--to=sbrivio@redhat.com \
--cc=armbru@redhat.com \
--cc=dave@treblig.org \
--cc=devel@lists.libvirt.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).