]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Revert "vircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs"
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 16 Sep 2024 08:29:40 +0000 (10:29 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 16 Sep 2024 10:05:19 +0000 (12:05 +0200)
commitebc4580a5f04d16fb0ca373e80669b1102f29add
treeb2c9c5d34227786ab42ef22fb076073cded07af6
parent308ec0fb2c77f4867179f00c628f05d1d784f370
Revert "vircommand: Parse /dev/fd on *BSD-like systems when looking for opened FDs"

Unfortunately, devfs on FreeBSD (accessible via /dev/fd) exposes
only those FDs which can be represented as a file. To cite
manpage [1]:

  The files /dev/fd/0 through /dev/fd/# refer to file descriptors
  which can be accessed through the file system.

This means FDs representing pipes and/or unnamed sockets are not
visible by default. To expose all FDs a slightly different
filesystem must be mounted [2]:

  mount -t fdescfs none /dev/fd

Apparently, on my test machine fdescfs is mounted by default and
thus I haven't seen any problem. Only after aforementioned patch
was merged our CI started reporting problems. While we could try
to figure out whether correct FS is mounted, it's a needless
micro optimization. Just revert the code to the state it was
before I touched it.

1: https://man.freebsd.org/cgi/man.cgi?query=fd&sektion=4&manpath=freebsd-release-ports
2: https://man.freebsd.org/cgi/man.cgi?query=fdescfs&sektion=5&n=1

This reverts commit 308ec0fb2c77f4867179f00c628f05d1d784f370.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/util/vircommand.c