From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 9A88A5A0050 for ; Fri, 21 Jun 2024 03:17:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1718932665; bh=42t39ZQr41EOn0n32jRLsM7ffGv430YjDYx2mcxxztg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Atis54b4DRd7ca3J6REu4vWGKKIoFPjnODClBCB+JcvGQvoY6ckz9ZlfnLjuVXA0a WN1P9t+zMKyyjZarGpcQKF6TYUCsIkrw/Rdnb+wHWPh9f5KK48BP2DQFzdlWdZ99oV 6q1230zIGCTKcR2X7Ewx1cuViUTcN1RXcaxGIBh63KZUBrbQXjNy+LjfzywqS6QFQY g5dXfYV/HsyoZTm1BVW6bt7GfAq+Le9pep/hVG4mbZAT1zFG4HLWiWPDT82QZ47P5r o9TrvHbk1iro6zGdeD5W88JILlodEfybLk/WddRHwZ8rprKuq4kZjgxvH140ppzSL0 40jG1PgcxNn7Q== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4W4zxP0Zvkz4w2P; Fri, 21 Jun 2024 11:17:45 +1000 (AEST) Date: Fri, 21 Jun 2024 11:17:34 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH v5 0/9] Fixes for early logging/prints and related cleanups Message-ID: References: <20240620161518.142285-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0DCrujHCWoF7UgRV" Content-Disposition: inline In-Reply-To: <20240620161518.142285-1-sbrivio@redhat.com> Message-ID-Hash: ZCBPMZHJHKYIX3E2VVKBB6PRWDOA3GWV X-Message-ID-Hash: ZCBPMZHJHKYIX3E2VVKBB6PRWDOA3GWV 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, Yalan Zhang 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: --0DCrujHCWoF7UgRV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 20, 2024 at 06:15:09PM +0200, Stefano Brivio wrote: > The most apparent issue fixed by this series is the one from 4/6: with > a log file configured, we wouldn't print to standard error anymore, > during initialisation, which means that users such as libvirt lost > the ability to report meaningful error messages that occurred during > initialisation, in that case. >=20 > v5: > - in 4/8, rename the new flag once more to 'log_runtime': we don't > want to log to standard error if we're running in foreground, a > log file is given, and initialisation is done, otherwise debugging > pasta when it spawns its own shell becomes rather impractical Ah.. right. See, I still think the semantics of always printing to stderr when foreground make more sense, but I guess I do see the point that having pasta messages appear in your pasta-spawned shell is ugly. My preferred approach for that would to keep the basic semantics that we always log to stderr when foreground, but when we're spawning a pasta shell we default to 'quiet' log level. That way if you really do want messages to stderr along with your shell/command (which I sometimes do), you can get that by using --debug or whatever. Regardless of that quibble, though, the semantics are substantially saner with this series than without so I'm happy to go ahead with it. > - add 9/8, taking care of a direct stderr print left-over >=20 > v4: > - in 4/8, name the new flag 'log_daemonised' instead of > 'log_daemon_ready' >=20 > v3: > - add 2/8: we don't really need --stderr anymore > - in 5/8, save errno at the beginning of the _perror() helper > - in 7/8, avoid assigning errno to whatever return code we have just > for the sake of using the new helpers: strerror() is actually less > convoluted than that > - add 8/8: there's no need to call __openlog() with a log file >=20 > v2: > - turn flag bitmap into simple, separate boolean flags > - move errno description after message in _perror() functions > - make some of the old perror() messages more descriptive > *** BLURB HERE *** >=20 > Stefano Brivio (9): > conf, passt: Don't try to log to stderr after we close it > conf, passt: Make --stderr do nothing, and deprecate it > conf, log: Instead of abusing log levels, add log_conf_parsed flag > log, passt: Always print to stderr before initialisation is complete > log: Add _perror() logging function variants > treewide: Replace perror() calls with calls to logging functions > treewide: Replace strerror() calls > conf, passt: Don't call __openlog() if a log file is used > log: Don't report syslog failures to stderr after initialisation >=20 > arch.c | 10 ++++----- > conf.c | 41 ++++++++++++--------------------- > fwd.c | 2 +- > isolation.c | 46 ++++++++++++++++--------------------- > log.c | 65 ++++++++++++++++++++++++++++++++--------------------- > log.h | 25 +++++++++++++++++---- > netlink.c | 4 ++-- > passt.1 | 9 ++++---- > passt.c | 64 +++++++++++++++++++--------------------------------- > passt.h | 2 -- > pasta.c | 27 +++++++++------------- > pcap.c | 8 +++---- > tap.c | 14 ++++++------ > tcp.c | 24 +++++++------------- > util.c | 12 +++++----- > 15 files changed, 164 insertions(+), 189 deletions(-) >=20 --=20 David Gibson (he or they) | 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 --0DCrujHCWoF7UgRV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZ01K0ACgkQzQJF27ox 2GcECg//bwKB6E1NIB9U15ieortnziKh3/2JksNhLARoqcvtycN6RrQLMJFD/u7H NA9ylVaD7BLSDsyLWI5maKMgvETnlaPzSOnS7UsJE+fgD9EW/yLmro3rKNVFBkha nJnru6vmhENI919YdjeN1hYXuemxLqK8yU4lri6lKGNfsm+zyvi4PImyuu6bISui DPvQifQNnLez6jK4NPIr3pbTwX0OEsDU9iaF/LlBqhh3r3MG5CoVyocKhZENujtj 9LqcM9WMtiMcQUzc5qDdQL97kMENrV1wt1lq8dujuEzJRYz1QrPMmq2envuiSsN+ wdWeff0gYL8L7oWVjsU6r/h+S+xl5N8Ky86c0z7Qr3zXopTpLM8kTtfP/1EbvOjc AaoUc6pwrgRL3c/0jPn7h84b8Js8d/kWZN2D+OaZrlMtLwGj1ZNQhlcTfddpPljn X3UY4TalBoBzUoo7Wz8GGk2KJ7eszONsCS0+5+5XDBPKeBsn0s8/CHVSLn10PiMu 1JVZKqueMZyXZkmG0n1/cVh96F44T6IQfQMNfPIrFkIzNP6nduyeUYfTrDLtoSa9 fZ9/WCCU648ptekmCn2u9f+3JTnKJ/ZqAa9PtQQV/aEbbVJ4bOhtV9Pv9h6og1FZ gwG+xw+2SR/Hha8Hj39/TCk/reItH4b3ciYLsfy/EhYOmeRWce0= =C66a -----END PGP SIGNATURE----- --0DCrujHCWoF7UgRV--