To-do list for nbdkit
======================================================================

General ideas for improvements
------------------------------

* Listen on specific interfaces or protocols (eg. only IPv6).

* syslog? journal?

* Performance - measure and improve it.

* Bash tab completion.

* Exit on last connection (the default behaviour of qemu-nbd unless
  you use -t).

* Limit number of incoming connections (like qemu-nbd -e).

Suggestions for plugins
-----------------------

* XVA files
  https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg02971.html
  is a partial solution but it needs cleaning up.

* glance

* cinder

Note: qemu supports other formats such as libssh, libnfs, iscsi,
gluster and ceph/rbd, and while similar plugins could be written for
nbdkit there is no compelling reason unless the result is better than
qemu-nbd.  For the majority of users it would be better if they were
directed to qemu-nbd for these use cases.

Filters
-------

It should be possible to layer filters over plugins to do things like:

* adding artificial delays (see wdelay/rdelay options in the file
  plugin)

* injecting artificial errors for testing clients

* copy-on-write, a popular feature in other servers

* export a subset using offset/size

* export a single partition (like qemu-nbd -P)

A possible syntax would be:

  nbdkit --filter=delay [--filter=...] file file=foo wdelay=10

The filter(s) intercept all plugin calls and can either return, return
an error, or pass the call down to the next layer in the stack (and
eventually to the plugin).  By intercepting the .config call the
filter can process its own parameters from the command line (wdelay=10
in the example above), and by intercepting the .pread, .pwrite methods
the filter could inject the delaying behaviour.

Composing nbdkit
----------------

Filters allow certain types of composition, but others would not be
possible, for example RAIDing over multiple nbd sources.  Because the
plugin API limits us to loading a single plugin to the server, the
best way to do this (and the most robust) is to compose multiple
nbdkit processes.

The nbd plugin (plugins/nbd) already contains an NBD client, so we
could factor this client out and make it available to other plugins to
use.
