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 910345A004F for ; Thu, 20 Jun 2024 11:06:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718874418; 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=giME+95X/GLWD6rB4Q0ACDwLB7Tx2193OS3SewftIkg=; b=XsmB9YE4n5FjL4BoOBCviXks/aw+c9Q5q+FXiw2RtiLbGYKSCe5YSJUEmOWNJgcah+AZjd nRIKE8AXnhhbxLVuAx6q/M0iKhYwr7WrC4sxVary5817Xt3Om/SmzMk3g2yy4jMjGfKvjK nRf+z+Jvp8OpLI11ZMIyU9Put0XgzCc= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-605-LZKGJINhN_6Y6bVX9Q-4gQ-1; Thu, 20 Jun 2024 05:06:56 -0400 X-MC-Unique: LZKGJINhN_6Y6bVX9Q-4gQ-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a6efaeaf34cso24862766b.3 for ; Thu, 20 Jun 2024 02:06:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718874415; x=1719479215; 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=giME+95X/GLWD6rB4Q0ACDwLB7Tx2193OS3SewftIkg=; b=xNJ4M17J6y8WfXebUAM6KICGP/Y9w3199wXvKJF72rPvoc+m2EuOSqpwksoYXG7wtF UKfBd488CH44+5cgwCF3EX+g6YaoaC3L8Iv0/T94O9jHSatiCywchAocFZjDuJY0U7i5 pvzYxQEOw6dXCEPiWLC+z5/2Gj7zIJcsmITjuxZw9GYDQ52PKPihvbcRlGpQzqC5gy/W 4Aizw+zDidv/G0DgLrT83v3sC423vqYG9TedFu0iOHiOxeCbAicBHdU03Mhazri2Wk/y Lo1MvDArdTDsmE7Y4w5c1YZbDvRAnZALJDBUk4DK0rdt38nIvIngbvZg4aQWwVNHcyVc 1buQ== X-Forwarded-Encrypted: i=1; AJvYcCVtzE/kupdCXbFXjgjVAaRskecJD+OTMt/tC8R1aYXPFkc+VP/FYSiwH5xTG+qZRfxoEA4Vm3QDS1vHivmSz5cxYDsa X-Gm-Message-State: AOJu0YzHkPknK+ltBPFRl6kZCK2d6rJ1o8R9ZJ78ZUDz4CncVLDk2skm 8HNN/bKcj4EFtTw5dKVinjU14CbynecyuAxQsmLE7osTkdZYUv29juCbXBuG84hCFZ0GeGpVCGh 0WnvMjQTJExVTKPB6/mGq2Rj/P6EYltF0AvsyHQcpwSPqREDACw== X-Received: by 2002:a17:907:a602:b0:a6f:5efb:5c8 with SMTP id a640c23a62f3a-a6fab6088e7mr341159766b.9.1718874414975; Thu, 20 Jun 2024 02:06:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfe85U/X9anTygFfwsKwtWewTBl51Zu6wElBu1NXc1aeDawOWf7BZuSVzp76jdKH9NsZ9UvQ== X-Received: by 2002:a17:907:a602:b0:a6f:5efb:5c8 with SMTP id a640c23a62f3a-a6fab6088e7mr341142366b.9.1718874410265; Thu, 20 Jun 2024 02:06:50 -0700 (PDT) Received: from [192.168.188.25] ([80.243.52.134]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56db6813sm743252466b.79.2024.06.20.02.06.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jun 2024 02:06:49 -0700 (PDT) Message-ID: <5ce4381a-4a8b-4ad4-b0e8-04ae85734d12@redhat.com> Date: Thu, 20 Jun 2024 11:06:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] conf: Accept duplicate and conflicting options, the last one wins To: Stefano Brivio , passt-dev@passt.top References: <20240619154019.2823043-1-sbrivio@redhat.com> From: Paul Holzinger In-Reply-To: <20240619154019.2823043-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: WLE6APOONORMJTZKDXT2CXIK7HNUEKBT X-Message-ID-Hash: WLE6APOONORMJTZKDXT2CXIK7HNUEKBT 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 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. -- Paul Holzinger