From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 3DC0A5A004E for ; Fri, 21 Jun 2024 11:52:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718963565; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BBkLr9XiEBHvDx0w1b/tCWDKidWuUckDTV0Ynv5nipI=; b=Bajmh23Ji5YG7ZrayjJ11Ko7mhLIS37VjV26lGAuzVBsIRA5+1BZZXTwHO02YV9iCaCLsj KOO6/5fa8jTHl80CT2TI3bsx0KrYaBDaOEtB3ZUCwrRHQ1vEttjoipnM9MByCoPQitXOq5 PQ2jqJzlDTQqNtSgeoo9QF3rw5FZbgs= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-447-qq_OVJ4YOhu8wLwGtsRIPQ-1; Fri, 21 Jun 2024 05:52:43 -0400 X-MC-Unique: qq_OVJ4YOhu8wLwGtsRIPQ-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a6ec06ed579so96589466b.2 for ; Fri, 21 Jun 2024 02:52:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718963562; x=1719568362; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=BBkLr9XiEBHvDx0w1b/tCWDKidWuUckDTV0Ynv5nipI=; b=n0YAdqWGrQrU3iqJTAEi/W2vVsEd7P6f5JFrcLXbTVGRImFO1TvZU0YFjSqsQ3fbWy fpIzlMKwqU53s7XVls9/9ZrN/e9cAkJ68BjkPjCq2rzyJBNYb97AKBpPg+X5iYDW+9jc duCGn9DG+b2CNmU/+6MpID0Z55vZN0yxNfAi6pCFC5/ZTpO8ry46M2tHZSXKIi7aVEWs IovYxPBtM3FQSEvoGE8iQZpSvbmFJpfbTK3NhrqYf3zo283+rnhVBJEf95H3qPCgU3Z1 hUW5yTbnMrgBsQaY2XeMPt3J9aCVQ7q8i6ybgn7UI9ytS14dUYgchxKuCxy66z/IDCuR 7o8w== X-Forwarded-Encrypted: i=1; AJvYcCWTrj4G5STBDvPDJjySrH1bHjE0554azHDP8WJd17XgozU8M68r+JdLTJMaQaGVNRrXr4UnqUJTB5uW8V4xYW+j0G8j X-Gm-Message-State: AOJu0YzMi8d80NUbv73/OLQYdGiVdhqGc7AdEYIxVsfStrYc8pLVkfUm 7J7LmAwDy2qPxIgbSLktRnlh3bsseBtklg3Lmby0TAkB4+KpTIIkQNRb1zOOLN+sumhi1VdOMgG DPawzJMhp2EiJQY1RHks7PUOrkT1H9/KrWuTCxHXY+BjSQb7DCg== X-Received: by 2002:a17:906:329b:b0:a6e:2a27:5669 with SMTP id a640c23a62f3a-a6fab62bc77mr512489566b.23.1718963562628; Fri, 21 Jun 2024 02:52:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJpUlcjeBnkuGtIEgREZQVVA8j3sJhQ8m687slQszZlVZj10/6ZPRVgH4VZX39tcOANRkA6A== X-Received: by 2002:a17:906:329b:b0:a6e:2a27:5669 with SMTP id a640c23a62f3a-a6fab62bc77mr512488166b.23.1718963562153; Fri, 21 Jun 2024 02:52:42 -0700 (PDT) Received: from [192.168.188.25] ([80.243.52.133]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fcf428c5csm66235666b.19.2024.06.21.02.52.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Jun 2024 02:52:41 -0700 (PDT) Message-ID: <7fb9bd35-9249-4a32-b3d2-bba5f3da475d@redhat.com> Date: Fri, 21 Jun 2024 11:52:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] conf: Accept duplicate and conflicting options, the last one wins To: Stefano Brivio , passt-dev@passt.top References: <20240620171921.179930-1-sbrivio@redhat.com> From: Paul Holzinger In-Reply-To: <20240620171921.179930-1-sbrivio@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: OLUBQR27EMYDXHPNXYLUJU4566QBTK6Z X-Message-ID-Hash: OLUBQR27EMYDXHPNXYLUJU4566QBTK6Z X-MailFrom: pholzing@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 20/06/2024 19:19, Stefano Brivio wrote: > 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 > Suggested-by: David Gibson > Signed-off-by: Stefano Brivio Tested-by: Paul Holzinger > --- > v3: > - override --gateway and --dns-forward with the last given option > for a given address family, too assuming you mean --address here as --gateway already worked > > v2: > - report --log-file and --stderr as conflicting, but accept > multiple options if they don't conflict > - for --log-file and --pcap, make it clear in the man page that > the general principle still applies: only the last one (of each) > takes effect > - add some more context about Podman and how the list of pasta > options is built there, in the commit message > > conf.c | 146 ++++++++++++++++---------------------------------------- > passt.1 | 17 +++++++ > 2 files changed, 59 insertions(+), 104 deletions(-) > -- Paul Holzinger