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 C8C4F5A004E for ; Wed, 19 Jun 2024 12:22:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718792564; 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=LEK18YDR9/qYDbAd1BuHUOU9tOjD1MxVoA5wlzsp4+U=; b=FVqQX01m4vbEnbfDqqXlYVNkj+p/74/htrJtYwA28pwFM8GNnRhdo7+zIltKg2e8wK3JbJ mF29t81manmioH9W3r9NHVPfuYkR/BqQd89n9D4Xs46m7oglnfyFQpo304IyMOW0SqaC8i pijMc+Z5bAzzizmdczkxa99HXOvfCuU= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-135-3DkZdBHIM7a4pGEA-orpzA-1; Wed, 19 Jun 2024 06:22:43 -0400 X-MC-Unique: 3DkZdBHIM7a4pGEA-orpzA-1 Received: by mail-ot1-f69.google.com with SMTP id 46e09a7af769-6fa0e724c95so6886776a34.2 for ; Wed, 19 Jun 2024 03:22:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718792562; x=1719397362; 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=LEK18YDR9/qYDbAd1BuHUOU9tOjD1MxVoA5wlzsp4+U=; b=g5uR3LZe3CKwp1l6Q/pOPIKBdSf4BzE5mgX+t622ew1Vqy4x3zRJRo58fCubk2PVVS f9WUfhF/mUGv9SJjf+MJB2u2OIF672HGKNgApASFagW760IupBFYIBeH7d2GChgHnrNR 5PZs/7+/bf4fmKjKJ3whQCMtw6ZsJ3/REIyJy4ugBqXUa4Qrrs/PULTNFiQ4lb12VQuZ JxN9xKKk79T2tuUCzvL4zO6wl2p2Y5W3tBX023AarE/g/jD7RYVZyiz21gK7rfwo13U2 eVQWxwM1sX5h5csbOr3DtP6UW9rZuCBSpnYmysXeCObbkQobyerzJqdGOm6egHztxKck 6NBg== X-Gm-Message-State: AOJu0YyrSRFoJOGabVlTWXaGPz/x0hTRYEm0LasNQSyWjINqMR9MhM68 4zrvyKWr2ZQ8WkiMM1l/P3aQNAAyaIacyybS6AcKrcW6fXDPNiIwkxdOaagusbhgchxCxrBFqMq DKY4DrlwnejhZpdxjaLRP9fKvbnGW40gHtcHrgxLSOoAXx20DqQ== X-Received: by 2002:a9d:560a:0:b0:6f9:b071:28e4 with SMTP id 46e09a7af769-70076730148mr2313031a34.34.1718792562229; Wed, 19 Jun 2024 03:22:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERu7CdW2ldSOwqS2RrUtwu5+0so3f2T32JTlCRYrVHT7/27J/Nfy1pgLjZ0O+f4iJ0YQnhRA== X-Received: by 2002:a9d:560a:0:b0:6f9:b071:28e4 with SMTP id 46e09a7af769-70076730148mr2313014a34.34.1718792561727; Wed, 19 Jun 2024 03:22:41 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b5081215c1sm3648766d6.138.2024.06.19.03.22.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jun 2024 03:22:41 -0700 (PDT) Date: Wed, 19 Jun 2024 12:22:05 +0200 From: Stefano Brivio To: Paul Holzinger Subject: Re: [PATCH] conf: Accept duplicate and conflicting options, the last one wins Message-ID: <20240619122205.523ea244@elisabeth> In-Reply-To: <75fa1c89-3580-4b3f-a7e5-34bb7e20d403@redhat.com> References: <20240618161723.1896519-1-sbrivio@redhat.com> <75fa1c89-3580-4b3f-a7e5-34bb7e20d403@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: LCDMNP2LLM7PUCOSJGAUAFYRVTMJYAHN X-Message-ID-Hash: LCDMNP2LLM7PUCOSJGAUAFYRVTMJYAHN 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 Wed, 19 Jun 2024 11:06:37 +0200 Paul Holzinger wrote: > On 18/06/2024 18:17, 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. > To give more context: Podman allows to specify pasta options in the > containers.conf file and on the cli. In podman we just append config > file + cli and pass all options to pasta. As such it would be very > difficult for users to overwrite a single option from the config file as > pasta errors without this patch. The alternative is for Podman to parse > the cli args and fix them before handing them to pasta but this is > clearly not maintainable on our end. Right, I forgot to explain, I'll add this in v2 (recycling from your paragraph). > > 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. > > > > Finally, somebody took care of this on Podman side at: > > https://github.com/containers/common/pull/2052 > > > > but still, we'll probably have similar cases, or older versions of > > Podman around, etc. > > > > 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. > > > > Suggested-by: Paul Holzinger > > Suggested-by: David Gibson > > Signed-off-by: Stefano Brivio > > PS: The patch doesn't apply to current HEAD on https://passt.top/passt/ > (should I use another tree?) and git doesn't offer any merge conflict > resolution for applying patches either??? So I cannot test this locally. My bad, I based this patch on other patches I had just posted, I'll rebase this on HEAD for v2. If you want to apply it anyway, git's three-way merge fixes this up, given that there are no actual conflicts: $ curl https://archives.passt.top/passt-dev/20240618161723.1896519-1-sbrivio@redhat.com/raw | git am -3 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 12963 0 12963 0 0 37441 0 --:--:-- --:--:-- --:--:-- 37465 Applying: conf: Accept duplicate and conflicting options, the last one wins Using index info to reconstruct a base tree... M conf.c M passt.1 Falling back to patching base and 3-way merge... Auto-merging passt.1 Auto-merging conf.c -- Stefano