diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2024-06-18 18:04:49 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-06-21 15:31:46 +0200 |
commit | 65923ba79877c412870c37f6d55d6bb6d1d941e8 (patch) | |
tree | 34fd84e841430f825235631761944029e9f352f3 /passt.1 | |
parent | 62de6140d949795ff2595f0652b9c37929a3ce2f (diff) | |
download | passt-65923ba79877c412870c37f6d55d6bb6d1d941e8.tar passt-65923ba79877c412870c37f6d55d6bb6d1d941e8.tar.gz passt-65923ba79877c412870c37f6d55d6bb6d1d941e8.tar.bz2 passt-65923ba79877c412870c37f6d55d6bb6d1d941e8.tar.lz passt-65923ba79877c412870c37f6d55d6bb6d1d941e8.tar.xz passt-65923ba79877c412870c37f6d55d6bb6d1d941e8.tar.zst passt-65923ba79877c412870c37f6d55d6bb6d1d941e8.zip |
conf: Accept duplicate and conflicting options, the last one wins
In multiple occasions, especially when passt(1) and pasta(1) are used
in integrations such as the one with Podman, the ability to override
earlier options on the command line with later one would have been
convenient.
Recently, to debug a number of issues happening with Podman, I would
have liked to ask users to share a debug log by passing --debug as
additional option, but pasta refuses --quiet (always passed by Podman)
and --debug at the same time.
On top of this, Podman lets users specify other pasta options in its
containers.conf(5) file, as well as on the command line.
The options from the configuration files are appended together with
the ones from the command line, which makes it impossible for users to
override options from the configuration file, if duplicated options
are refused, unless Podman takes care of sorting them, which is
clearly not sustainable.
For --debug and --trace, somebody took care of this on Podman side at:
https://github.com/containers/common/pull/2052
but this doesn't fix the issue with other options, and we'll have
anyway older versions of Podman around, too.
I think there's some value in telling users about duplicated or
conflicting options, because that might reveal issues in integrations
or accidental misconfigurations, but by now I'm fairly convinced that
the downsides outweigh this.
Drop checks about duplicate options and mutually exclusive ones. In
some cases, we need to also undo a couple of initialisations caused
by earlier options, but this looks like a simplification, overall.
Notable exception: --stderr still conflicts with --log-file, because
users might have the expectation that they don't actually conflict.
But they do conflict in the existing implementation, so it's safer
to make sure that the users notice that.
Suggested-by: Paul Holzinger <pholzing@redhat.com>
Suggested-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Tested-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'passt.1')
-rw-r--r-- | passt.1 | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -73,6 +73,9 @@ for performance reasons. .SH OPTIONS +Unless otherwise noted below, \fBif conflicting or multiple options are given, +the last one takes effect.\fR + .TP .BR \-d ", " \-\-debug Be verbose, don't log to the system logger. @@ -97,10 +100,21 @@ Log to standard error too. Default is to log to the system logger only, if started from an interactive terminal, and to both system logger and standard error otherwise. +This option cannot be specified together with \fB--log-file\fR, because there +might be a reasonable expectation that messages are logged to standard error as +well as to a file, which is however not supported. + .TP .BR \-l ", " \-\-log-file " " \fIPATH\fR Log to file \fIPATH\fR, not to standard error, and not to the system logger. +This option cannot be specified together with \fB--stderr\fR, because there +might be a reasonable expectation that messages are logged to a file as well as +to standard error, which is however not supported. + +Specifying this option multiple times does \fInot\fR lead to multiple log files: +the last given option takes effect. + .TP .BR \-\-log-size " " \fISIZE\fR Limit log file size to \fISIZE\fR bytes. When the log file is full, make room @@ -128,6 +142,9 @@ Show version and exit. Capture tap-facing (that is, guest-side or namespace-side) network packets to \fIfile\fR in \fBpcap\fR format. +Specifying this option multiple times does \fInot\fR lead to multiple capture +files: the last given option takes effect. + .TP .BR \-P ", " \-\-pid " " \fIfile Write own PID to \fIfile\fR once initialisation is done, before forking to |