public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH v2 0/6] Fix bug 215 and some related issues with fd handling
@ 2026-07-17  5:46 David Gibson
  2026-07-17  5:46 ` [PATCH v2 1/6] passt: Always close pidfile_fd, not just when daemonizing David Gibson
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: David Gibson @ 2026-07-17  5:46 UTC (permalink / raw)
  To: passt-dev, Stefano Brivio; +Cc: David Gibson

Stefano, you called it correctly.  While working on bug 215, as usual,
I found a bunch of adjacent things to clean up.

I did start by attempting the appoach you suggested for bug 215 -
remembering which of the low fds were standard streams and avoiding
closing them in __daemon().  It is indeed shorter, but only by 1-2
lines.  Looking at possible interactions with other things, I became
more and more convinced that leaving anything other than the standard
streams in fds 0-2 was an accident waiting to happen.  Much of the
rest of the series is, for example, dealing with the possibility of
--fd [012].

v2:
 * No longer fold fd closing into isolate_initial()
 * Some minor polish
 * Various improved comments and commit messages

David Gibson (6):
  passt: Always close pidfile_fd, not just when daemonizing
  isolation: Move close_open_files() to isolate_fds()
  isolation, conf: Set c->fd_tap from early parse of --fd
  conf: Make conf_tap_fd() operate more like conf_mode()
  isolation: Move --fd descriptor to a number of our choosing
  main: Ensure fds 0-2 are populated

 conf.c      | 31 ++++++++++++++++++++-------
 conf.h      |  2 +-
 isolation.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++-------
 isolation.h |  3 ++-
 passt.c     | 28 +++++++++++++++++--------
 util.c      | 52 +---------------------------------------------
 util.h      |  1 -
 7 files changed, 98 insertions(+), 79 deletions(-)

-- 
2.55.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-17  5:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-17  5:46 [PATCH v2 0/6] Fix bug 215 and some related issues with fd handling David Gibson
2026-07-17  5:46 ` [PATCH v2 1/6] passt: Always close pidfile_fd, not just when daemonizing David Gibson
2026-07-17  5:46 ` [PATCH v2 2/6] isolation: Move close_open_files() to isolate_fds() David Gibson
2026-07-17  5:46 ` [PATCH v2 3/6] isolation, conf: Set c->fd_tap from early parse of --fd David Gibson
2026-07-17  5:46 ` [PATCH v2 4/6] conf: Make conf_tap_fd() operate more like conf_mode() David Gibson
2026-07-17  5:46 ` [PATCH v2 5/6] isolation: Move --fd descriptor to a number of our choosing David Gibson
2026-07-17  5:46 ` [PATCH v2 6/6] main: Ensure fds 0-2 are populated David Gibson

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).