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.133.124]) by passt.top (Postfix) with ESMTP id 74D755A004F for ; Thu, 20 Jun 2024 12:10:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718878207; 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=F2zOxGKjj4RMvgwzytjfEKQawBCuyQdHQdNrtGa9Bas=; b=Zcw4jsV0ivuxfQlftRAANX0ARN2JwYUHodxr81492lKSK6o1+jCIRqGbUKDjZFoUceGqD9 3paGYTztEgTHu1iV4FwLHBksBfqcrftqbitu5R2DdADmPVxV8qznPATC3/ma3iXPlcPlML PMAz8zmPh/ekZqn35rdidSS/Fmdk03U= Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-158-VYe4LbSyNgqpbkK01hJywg-1; Thu, 20 Jun 2024 06:10:05 -0400 X-MC-Unique: VYe4LbSyNgqpbkK01hJywg-1 Received: by mail-ot1-f71.google.com with SMTP id 46e09a7af769-6f9962c97d1so760502a34.3 for ; Thu, 20 Jun 2024 03:10:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718878205; x=1719483005; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=F2zOxGKjj4RMvgwzytjfEKQawBCuyQdHQdNrtGa9Bas=; b=WGO9Khjnr5yA4JfqSGWERpEE9vN+Tmlbv7+Fby2ddGfa4bHf0zuIFof3EXqsmn48nb aZ0ndEyNCp3cU3k7bqzu4s8vqw3lVVIXcLZQt3TiGiA/pqJy6/+IL0XcQq40Adirav3l Aa4PJgYwW/GH6krFdUL9VvHTHiFUpfA0qiyxaO9Hb+BSVVmzu0nWpc72H73haqT8/FZh z9qDq3yt/yhdXevrcsRosaXuJyV78d/HXY6G839CfSbWE1RL5l2IxGqWk/h6//ihueLt hZ47QqeD7fQJhidLz2UCoayExevqojX9wzHjEviAvm2Nv+5edsDp35NllpybqH4L9Sq6 BVXg== X-Gm-Message-State: AOJu0YwdauTwGj0m4xQzd0zBNJO52PV6fnH0BZvGEPtA/RvQpqvFXR2m pfH3UVoJz2Humx+jFu1O/cBTU0fUEvaA91IZp14VzJeNjfNHWiVCPsvbT6k9Inie67xezjASnB9 fbzg7mM5yJhzYpaCZhkXcBFyqqjPmLW0ilUWAiV3v4GBC+ERuOw== X-Received: by 2002:a9d:6b82:0:b0:6f9:8b51:c697 with SMTP id 46e09a7af769-70073f21082mr5244868a34.19.1718878204856; Thu, 20 Jun 2024 03:10:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHils5vMa2BfkRYs1f6F4qKXCsC9vIsT71jIad1sx4wAC1g5+081lNq3GUKSMYNnSSQV81PEQ== X-Received: by 2002:a9d:6b82:0:b0:6f9:8b51:c697 with SMTP id 46e09a7af769-70073f21082mr5244813a34.19.1718878203462; Thu, 20 Jun 2024 03:10:03 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b2a5c466bfsm85744196d6.68.2024.06.20.03.10.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Jun 2024 03:10:02 -0700 (PDT) Date: Thu, 20 Jun 2024 12:09:27 +0200 From: Stefano Brivio To: Paul Holzinger Subject: Re: [PATCH v2] conf: Accept duplicate and conflicting options, the last one wins Message-ID: <20240620120927.6f3b670d@elisabeth> In-Reply-To: <5ce4381a-4a8b-4ad4-b0e8-04ae85734d12@redhat.com> References: <20240619154019.2823043-1-sbrivio@redhat.com> <5ce4381a-4a8b-4ad4-b0e8-04ae85734d12@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: TNECLDSNHRAZIWNP3HEBZFX2H2TZMENS X-Message-ID-Hash: TNECLDSNHRAZIWNP3HEBZFX2H2TZMENS X-MailFrom: sbrivio@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: passt-dev@passt.top, 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 Thu, 20 Jun 2024 11:06:48 +0200 Paul Holzinger wrote: > On 19/06/2024 17:40, 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 > > --- > > 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 | 134 ++++++++++++++++---------------------------------------- > > passt.1 | 17 +++++++ > > 2 files changed, 55 insertions(+), 96 deletions(-) > > I have done some tests and while you changed --gateway to only take the > last one --address was not changed: > > ./pasta --config-net -a 10.0.0.1 -a 10.0.0.2 ip a > > Invalid address: 10.0.0.2 > > The error is clearly nonsensical as the address is valid. So either it > should match the gateway behavior or the error must clearly state that > multiple addresses are not accepted if this is what you want. Gosh, thanks, nice catch, v3 coming (in a while). -- Stefano