[Libguestfs] [RFC nbdkit PATCH 0/2] Add 'nbdkit nbd shared=1' mode

Eric Blake
Sat, 25 May 2019 22:32:22 -0000

I got annoyed by qemu-nbd's default of only allowing a single
connection; combine that with nbdkit's nbd plugin, and even 'qemu-nbd
--list' of nbdkit counts as the single connection and immediately
hangs up. If we introduce a shared mode, then 'qemu-nbd --list' can
connect as many times as it wants without killing the original
qemu-nbd wrapped by nbdkit.  But this in turn required a way to wait
for the socket to appear (as nbdkit --exit-with-parent has to be
invoked before exec qemu-nbd, but the socket isn't created until the
latter case).

RFC in part because I wonder if nbdkit should offer a shared mode to
ALL plugins, rather than just the nbd plugin providing its own.

Eric Blake (2):
  nbd: Add retry=N parameter
  nbd: Add shared=true parameter

 plugins/nbd/nbdkit-nbd-plugin.pod |  22 ++++-
 plugins/nbd/nbd.c                 | 134 +++++++++++++++++++++---------
 2 files changed, 115 insertions(+), 41 deletions(-)

--
2.20.1