From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ALIQA3ci; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 7A7E15A0269 for ; Wed, 15 Jul 2026 09:12:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784099559; 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=wULMotEB/3zQV4yGSFuwxnr1Kfsyas/LHFHa7rwU/TM=; b=ALIQA3ciVi/eO9K/mVVtBDgL4ti75BQJUtF+Fl2/fX4YhujvxpHSiLWXeVaDL3iFwteqGA 9jGcF65W82HpHT1aFcneEeGrJ4/Dor4Gr8I3I7M9ir4U+B3+q/jMThn8on38cdDCuu3JMk hXsCsFBiuTSxHxytOCAAKEXS4+DBokM= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-498-iiMejq53MDGYiFUQO7QKRQ-1; Wed, 15 Jul 2026 03:12:37 -0400 X-MC-Unique: iiMejq53MDGYiFUQO7QKRQ-1 X-Mimecast-MFC-AGG-ID: iiMejq53MDGYiFUQO7QKRQ_1784099557 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4926fa2cb17so13067155e9.1 for ; Wed, 15 Jul 2026 00:12:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784099556; x=1784704356; h=date:content-transfer-encoding:content-type:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=wULMotEB/3zQV4yGSFuwxnr1Kfsyas/LHFHa7rwU/TM=; b=CBQ+Nn7VBePUX0V5utRihiPWPpZOgMSxwzHbzRDYJ/WuzvihW4tw6bq3H4dG2AhZOH 1swqHBx3wuS87BZft4z76yBWcc62YJZ9aaXb0pIv6Ac8I42FAEQTuKU6UOKvkH+9WY9G GEAWfvXYVmtpVhQeSDG7fI6F49fXW8EuDyr+qCMLIoSrx2qVt+L3JawE9dwhvT7Gbir7 hnY7oL+M18iDfs+w36TUQZrxlhi1RNxi1PrLo/lK68ModWpy2FczPda9k+TX+RuWp6Xp gjSRxdQpByk9kOwc4uuEBEjoMbf91OuhO7A36Fvuq98l7htDwAOSgxAx55G3vWHhDBh7 Qklw== X-Gm-Message-State: AOJu0YyiwDsjcHJd9tjjoZvKaLcgm+rwvoA/qrGmj5u3jjPNyrVmuv3R 5IUPUfnaw6Kl41SJjYEAHS2m8MwXV4ffRDuqGmbTcWQRs1qw0/ML2ztTFvI4p9MXCYfi9h3gGkr 9WQe4/INckhgjVi/Etae6Mij4P0tsJmsPQCBAHOUhm8YNARXwBYqGkojfPtKFCQ== X-Gm-Gg: AfdE7ckSElEp04Gk7l2AkXUJyPO0wrcg9WBAU/b8gjGvFSLdrtIxqLyYFJdd/qJjFzH ogabom+BBqkSr06X8xEkQ2jjqT9saK88D2v2dk/GwPtUlvjpcrf4f1mFjwFzM6o3N5hlNBDApbM PuHa6rHZqvBlG+dmR2bbkt2x8gKqxlCBrzLRSUWarPdYr9bzwtXwQJ5ViIPbgYo7Y6GhVACK+Nx 1vBN8BYHBEyCVlxp2tj8UwzZryn2Ju04Z6r9oN83juqzNYgrkpOnrGnzgyviNy2wIZ5wgbDq8kQ qlgUrvaA65uZqswK/ARUYoA84w3YSPNqrVBjxBZxAiic/Qctv87EvxkDr31YARecM5sGambKTKt QQsSD2mzgCZXHnNAi8i/yq7mpNHzjHE65GjI8P3s= X-Received: by 2002:a05:600c:998:b0:493:a63b:1f62 with SMTP id 5b1f17b1804b1-493f2ac8ca3mr129043835e9.16.1784099556621; Wed, 15 Jul 2026 00:12:36 -0700 (PDT) X-Received: by 2002:a05:600c:998:b0:493:a63b:1f62 with SMTP id 5b1f17b1804b1-493f2ac8ca3mr129043625e9.16.1784099556126; Wed, 15 Jul 2026 00:12:36 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f464b7e22sm13677995f8f.25.2026.07.15.00.12.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 00:12:35 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 2/6] isolation, conf: Set c->fd_tap from eary parse of --fd Message-ID: <20260715091234.603c7963@elisabeth> In-Reply-To: <20260714092926.2881848-3-david@gibson.dropbear.id.au> References: <20260714092926.2881848-1-david@gibson.dropbear.id.au> <20260714092926.2881848-3-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Wed, 15 Jul 2026 09:12:35 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: J0bbd95r9tbEXUU4uEXUR9cJLcIbElsAOHLynVggaVo_1784099557 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: GJOGP2SULRXFXP5A7SDXTVW75WFVIJIH X-Message-ID-Hash: GJOGP2SULRXFXP5A7SDXTVW75WFVIJIH 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 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 Tue, 14 Jul 2026 19:29:22 +1000 David Gibson wrote: > We parse --fd twice: once in isolate_initial() just to avoid clobbering > the passed in fd. Then we parse it "for real" in conf(), to set c->fd_tap > and other configuration variables. > > Change this, so that we return the value parsed early from > isolate_initial() and set c->fd_tap from that. This doesn't accomplish > much immediately, but will make some further cleanups possible. > > Signed-off-by: David Gibson > --- > conf.c | 2 +- > isolation.c | 6 +++++- > isolation.h | 2 +- > passt.c | 2 +- > 4 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/conf.c b/conf.c > index 6d83daef..41c9d557 100644 > --- a/conf.c > +++ b/conf.c > @@ -1593,7 +1593,7 @@ void conf(struct ctx *c, int argc, char **argv) > c->fd_control_listen = c->fd_control = -1; > break; > case 'F': > - c->fd_tap = conf_tap_fd(optarg); > + /* --fd was parsed early and c->fd_tap set in main() */ > c->one_off = true; > *c->sock_path = 0; > break; > diff --git a/isolation.c b/isolation.c > index 07b281bb..4bb79e34 100644 > --- a/isolation.c > +++ b/isolation.c > @@ -203,8 +203,10 @@ static int move_root(void) > * - close all open files except for standard streams and the one from --fd > * Mustn't: > * - remove filesystem access (we need to access files during setup) > + * > + * Return: fd number from --fd, or -1 if not specified I think this is a rather weird value to return for a function that's called isolate_initial(). Are patches 1/2 and 2/2 really needed for the rest of the series? I don't quite see the connection. I'm still reviewing the rest of the series. -- Stefano