Re: [PATCH trivial 1/2] close_all_open_fd(): move to oslib-posix.c

2024-01-26 Thread Michael Tokarev
26.01.2024 14:01, Daniel P. Berrangé: [] We should try to use O_CLOEXEC everywhere, but at the same time QEMU links to a large number of libraries, and we can't assume that they've reliably used O_CLOEXEC. Non-QEMU owned code that is mapped in process likely dwarfs QEMU owned code by a factor of

Re: [PATCH trivial 1/2] close_all_open_fd(): move to oslib-posix.c

2024-01-26 Thread Daniel P . Berrangé
On Fri, Jan 26, 2024 at 01:45:39PM +0300, Michael Tokarev wrote: > 26.01.2024 12:06, Daniel P. Berrangé wrote: > > On Fri, Jan 26, 2024 at 08:44:13AM +0100, Laurent Vivier wrote: > > > Le 25/01/2024 à 23:29, Michael Tokarev a écrit : > > > > > I think the way using sysconf(_SC_OPEN_MAX) is more p

Re: [PATCH trivial 1/2] close_all_open_fd(): move to oslib-posix.c

2024-01-26 Thread Michael Tokarev
26.01.2024 12:06, Daniel P. Berrangé wrote: On Fri, Jan 26, 2024 at 08:44:13AM +0100, Laurent Vivier wrote: Le 25/01/2024 à 23:29, Michael Tokarev a écrit : I think the way using sysconf(_SC_OPEN_MAX) is more portable, simpler and cleaner than the one using /proc/self/fd. A fallback that u

Re: [PATCH trivial 1/2] close_all_open_fd(): move to oslib-posix.c

2024-01-26 Thread Daniel P . Berrangé
On Fri, Jan 26, 2024 at 08:44:13AM +0100, Laurent Vivier wrote: > Le 25/01/2024 à 23:29, Michael Tokarev a écrit : > > Initially in async-teardown.c, but the same construct is used > > elsewhere too. > > > > Signed-off-by: Michael Tokarev > > --- > > include/sysemu/os-posix.h | 1 + > > syste

Re: [PATCH trivial 1/2] close_all_open_fd(): move to oslib-posix.c

2024-01-25 Thread Laurent Vivier
Le 25/01/2024 à 23:29, Michael Tokarev a écrit : Initially in async-teardown.c, but the same construct is used elsewhere too. Signed-off-by: Michael Tokarev --- include/sysemu/os-posix.h | 1 + system/async-teardown.c | 37 + util/oslib-posix.c

[PATCH trivial 1/2] close_all_open_fd(): move to oslib-posix.c

2024-01-25 Thread Michael Tokarev
Initially in async-teardown.c, but the same construct is used elsewhere too. Signed-off-by: Michael Tokarev --- include/sysemu/os-posix.h | 1 + system/async-teardown.c | 37 + util/oslib-posix.c| 36 3 files cha