From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id D8EF15A026F for ; Fri, 3 Nov 2023 01:21:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1698970855; bh=5ev8pLyLiWwYLZGpBrc4VxAfDHsSXDoyMHc0vxlWRjM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DU/oKwQWCSs656cl5p4Ul7+691N5HtJV+2Q7FTKbtWJI4Mf6ppnqSgUNHHBgIonjQ Iex8nhsRtb6rouFItkEHH6XCf0MHA8ysWl37EkiecwHBOlcM5jkpENXZVW7RBRCKoy yCj2IiCN5TADGwGIz/PySDSZ3uvF+h30rsPdNzbo= Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4SM1cR3FVJz4xPL; Fri, 3 Nov 2023 11:20:55 +1100 (AEDT) Date: Fri, 3 Nov 2023 11:20:33 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 4/9] util: Add open_in_ns() helper Message-ID: References: <20231005034445.2015303-1-david@gibson.dropbear.id.au> <20231005034445.2015303-5-david@gibson.dropbear.id.au> <20231102190725.1c797252@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rrFIJqKPlN0ISF45" Content-Disposition: inline In-Reply-To: <20231102190725.1c797252@elisabeth> Message-ID-Hash: OJ27IOIWJWTK6SWBDJ6FECPUUKAVNELQ X-Message-ID-Hash: OJ27IOIWJWTK6SWBDJ6FECPUUKAVNELQ X-MailFrom: dgibson@gandalf.ozlabs.org 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: --rrFIJqKPlN0ISF45 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 02, 2023 at 07:07:25PM +0100, Stefano Brivio wrote: > On Thu, 5 Oct 2023 14:44:40 +1100 > David Gibson wrote: >=20 > > Most of our helpers which need to enter the pasta network namespace are > > quite specialised. Add one which is rather general - it just open()s a > > given file in the namespace context and returns the fd back to the main > > namespace. This will have some future uses. > >=20 > > Signed-off-by: David Gibson > > --- > > util.c | 39 +++++++++++++++++++++++++++++++++++++++ > > util.h | 1 + > > 2 files changed, 40 insertions(+) > >=20 > > diff --git a/util.c b/util.c > > index a8f3b35..92ad375 100644 > > --- a/util.c > > +++ b/util.c > > @@ -364,6 +364,45 @@ bool ns_is_init(void) > > return ret; > > } > > =20 > > +struct open_in_ns_args { >=20 > It would be nice to have the usual kerneldoc-style comment to this > (at a first reading: are "flags" the flags for open(2) or something > specialised for internal use?). >=20 > > + const struct ctx *c; > > + int fd; > > + int err; > > + const char *path; > > + int flags; > > +}; > > + > > +static int do_open_in_ns(void *arg) >=20 > Same for this one. Eh, ok. I left it out originally, because they both seemed like they were essentially internals of open_in_ns() itself, but I've added them now. >=20 > The rest of the series makes sense and looks good to me. >=20 --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --rrFIJqKPlN0ISF45 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmVEPMsACgkQzQJF27ox 2GcOnw/5ARDj5o7lCDyoS9NWi/trLLIRCPNRBW/cTx3Gkrikt87gIhdHm2TxCr8E UOKQ0Gcl5XDYzIwlmzfHJe6blvVAvj4DOwrcMata9KJNzsorPbsCwvRpFvIpOiWA VxIAUbDCtSZxkRpzV77lGCZj6/ex8pq02owQnijx4pOMEWhc+SXTnDLQASPmSDw5 7z5PmHjxcANpMfRYDoHsHE8FrZRGDPiNShQtgy6jxx0QGHY+4c/Lx6MSmalWaE1l Fmx/bNjMcW5bdGjF1h7ucaDl6j6WhU6+0zLviXc+M4Qr/wF36utk9m9HVx6y98AI C8KFrJhyLef/AFx+Lf9macC+Ay5dIf2xZj5TVk47+UyOn0tqO3Ddi11+e1woF5hC Ktc5ymi8utMZBbOlov3YUVNa2DwCCTmXYg7Ii83wvA0ZIjhNhF0n6AcN9o6h7nGl cl9uVZKRhrqA8PKZdl9iiyEuWVtAsSkzIhGRquwLBRYVfJC5KdLta/cMnIA2Wvtx hRz05c4iTVbDr70NKLXZwvwiiEKuua01G6zTEonPhSw90hvC6YeuihjEmrl3as54 QrRA7ofPHBcATEjNHOhTEeegByYpbVhs2ylII/whNioDrqWyXHJMAR+s/0nmcJhJ b/DGBYd/wvYDDGOX0tMWCQBkTQs119vOXIHjg1uI4wC/cje51ow= =YTyN -----END PGP SIGNATURE----- --rrFIJqKPlN0ISF45--