NBD is a protocol for accessing Block Devices (hard disks and
disk-like things) over a Network.

'nbdkit' is a toolkit for creating NBD servers.

The key features are:

 * Multithreaded NBD server written in C with good performance.

 * Minimal dependencies for the basic server.

 * Liberal license (BSD) allows nbdkit to be linked to proprietary
   libraries or included in proprietary code.

 * Well-documented, simple plugin API with a stable ABI guarantee.
   Lets you export "unconventional" block devices easily.

 * You can write plugins in C, Perl, Python, OCaml or Ruby.

For documentation, see the docs/ directory.

For plugins and examples, see the plugins/ directory.

License
-------

This software is copyright (C) Red Hat Inc. and licensed under a BSD
license.  See LICENSE for details.

Building from source
--------------------

By default nbdkit needs nothing except Linux and reasonably recent gcc.

To build the man pages, you will need to install:

 - pod2man (included with perl)

There are some *optional* libraries you may want to install for
plugins or extra features.

For TLS support:

 - gnutls >= 3.3.0

For the gzip plugin:

 - zlib

For the xz plugin:

 - liblzma

For the curl (HTTP/FTP) plugin:

 - libcurl

For the libvirt plugin:

 - libvirt

For the libguestfs plugin, and to run the test suite:

 - libguestfs

 - guestfish (from libguestfs)

For the VDDK plugin:

 - VDDK (see plugins/vddk/README.VDDK)

For the Perl, example4 and tar plugins:

 - perl development libraries

 - perl module ExtUtils::Embed

For the Python plugin:

 - python development libraries
   (either version 2 or 3 may be used)

For the OCaml plugin:

 - OCaml >= 4.02.2 which has support for shared libraries, see:
   http://caml.inria.fr/mantis/view.php?id=6693

To run the test suite:

 - bash

To test for memory leaks ('make check-valgrind'):

 - valgrind

For non-essential enhancements to the test suite:

 - socat

 - ss (from iproute package)

After installing any dependencies:

  To build from tarball:         To build from git:
  ----------------------         ------------------
                                 autoreconf -i
  ./configure                    ./configure
  make                           make
  make check                     make check
  make check-valgrind            make check-valgrind

To run nbdkit from the source directory, use the top level ./nbdkit
script.  It will run nbdkit and plugins from the locally compiled
directory:

  $ ./nbdkit example1 -f -v
  ./src/nbdkit ./plugins/example1/.libs/nbdkit-example1-plugin.so -f -v
  [etc]

Optionally run this command as root to install everything:

  make install

Python
------

By default nbdkit uses the Python version of the Python interpreter
called "python" on the current $PATH.  To use another version of
Python you may need to set the PYTHON variable when configuring.  For
example:

  ./configure PYTHON=/usr/bin/python3

Tests
-----

You will need to install libguestfs to run most of the test suite:

  make check

The test suite is fairly comprehensive.  It runs the newly built
nbdkit + plugins as a captive process, and tests them using
libguestfs.  If there is a failure, look at the corresponding
tests/*.log file for debug information.

You can run the tests under valgrind, if it is available, using:

  make check-valgrind

Packager information
--------------------

Tarballs are available from:
http://libguestfs.org/download/nbdkit

Developer information
---------------------

For development ideas, see the TODO file.

The upstream git repository is:
https://github.com/libguestfs/nbdkit

Please send patches to the libguestfs mailing list:
https://www.redhat.com/mailman/listinfo/libguestfs

For further information, see:
http://libguestfs.org/
https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md
