[Libguestfs] [nbdkit PATCH v2 00/17] fd leak safety

Eric Blake eblake at redhat.com
Fri Aug 2 19:26:01 UTC 2019


This is a major rewrite compared to my v1 series, where I've tried
a lot harder to ensure that we still accommodate building on Haiku
(although I have not actually yet fired up a Haiku VM to try it
for myself).  I also managed to make the sh plugin fully parallel,
on capable platforms.

See also my question on patch 10 on whether I've picked the best
naming convention.

Eric Blake (17):
  maint: Rename server/utils.c to server/public.c
  plugins: Expose more thread_model details in --dump-plugin
  server: Add utility functions for setting CLOEXEC and NONBLOCK
  Revert "RHEL 5: Define O_CLOEXEC and SOCK_CLOEXEC."
  build: Audit existing use of SOCK_CLOEXEC
  cow, cache: Better mkostemp fallback
  build: Audit for use of pipe2
  rate: Atomically set CLOEXEC on fds
  server: Use atomic CLOEXEC for nbdkit_read_password
  plugins: Add .fork_safe field
  server: Atomically set CLOEXEC on accept fds
  filters: Set CLOEXEC on files opened during .config
  python: Use CLOEXEC on script
  sh: Use pipe2 with CLOEXEC when possible
  sh: Enable parallel thread model, when possible
  sh: Test for fd leaks
  temp debug

 docs/nbdkit-plugin.pod                 |  32 ++++--
 plugins/sh/nbdkit-sh-plugin.pod        |  10 +-
 configure.ac                           |   2 +
 common/utils/utils.h                   |   2 +
 include/nbdkit-plugin.h                |   1 +
 server/internal.h                      |  14 +--
 common/utils/utils.c                   |  64 ++++++++++++
 filters/cache/blk.c                    |  12 ++-
 filters/cow/blk.c                      |  12 ++-
 filters/log/log.c                      |  22 ++++-
 filters/rate/rate.c                    |  20 +++-
 filters/stats/stats.c                  |  21 +++-
 filters/xz/xzfile.c                    |   4 -
 plugins/curl/curl.c                    |   1 +
 plugins/data/data.c                    |   1 +
 plugins/example2/example2.c            |   5 +-
 plugins/example3/example3.c            |   1 +
 plugins/ext2/ext2.c                    |   1 +
 plugins/file/file.c                    |   5 +-
 plugins/floppy/floppy.c                |   1 +
 plugins/full/full.c                    |   1 +
 plugins/guestfs/guestfs-plugin.c       |   1 +
 plugins/gzip/gzip.c                    |   1 +
 plugins/iso/iso.c                      |   1 +
 plugins/libvirt/libvirt-plugin.c       |   1 +
 plugins/linuxdisk/linuxdisk.c          |   1 +
 plugins/memory/memory.c                |   1 +
 plugins/nbd/nbd-standalone.c           |   1 +
 plugins/nbd/nbd.c                      |  32 ++++++
 plugins/null/null.c                    |   1 +
 plugins/partitioning/partitioning.c    |   1 +
 plugins/pattern/pattern.c              |   1 +
 plugins/python/python.c                |  18 +++-
 plugins/random/random.c                |   1 +
 plugins/sh/call.c                      |  34 ++++++-
 plugins/sh/sh.c                        |   9 +-
 plugins/split/split.c                  |   5 +-
 plugins/ssh/ssh.c                      |   1 +
 plugins/streaming/streaming.c          |   5 +-
 plugins/zero/zero.c                    |   1 +
 server/locks.c                         |   4 +-
 server/plugins.c                       |  63 ++++++++----
 server/{utils.c => public.c}           |  19 +++-
 server/quit.c                          |  18 ++++
 server/sockets.c                       |  40 +++++++-
 server/{test-utils.c => test-public.c} |   0
 tests/test-layers.c                    |   4 +-
 tests/test-socket-activation.c         |  12 +--
 tests/test-streaming.c                 |   5 +-
 tests/web-server.c                     |   7 +-
 .gitignore                             |   2 +-
 server/Makefile.am                     |  18 ++--
 tests/Makefile.am                      |   2 +
 tests/test-dump-plugin.sh              |  32 +++++-
 tests/test-parallel-file.sh            |   3 +
 tests/test-parallel-nbd.sh             |   5 +-
 tests/test-parallel-sh.sh              | 131 +++++++++++++++++++++++++
 57 files changed, 605 insertions(+), 108 deletions(-)
 rename server/{utils.c => public.c} (94%)
 rename server/{test-utils.c => test-public.c} (100%)
 create mode 100755 tests/test-parallel-sh.sh

-- 
2.20.1




More information about the Libguestfs mailing list