Richard W.M. Jones
2019-Aug-15  16:05 UTC
[Libguestfs] ANNOUNCE: libnbd 0.9.8 - prerelease of high performance NBD client library
I'm pleased to announce a new high performance Network Block Device
(NBD) client library called libnbd.  It's written in C and there are
also bindings available for Python, OCaml and (soon) Rust.
0.9.8 is the third pre-release before the stable 1.0 version where we
freeze the API, so feedback on API-related issues is very welcome now.
Download:       http://download.libguestfs.org/libnbd/
Documentation:  https://github.com/libguestfs/libnbd/blob/master/docs/libnbd.pod
Fedora package: https://koji.fedoraproject.org/koji/packageinfo?packageID=28807
Debian package: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=933223
Git repo:       https://github.com/libguestfs/libnbd
Mailing list:   libguestfs@redhat.com (no subscription required)
Here are some of the things you can do with this library ...
Connect to an NBD server and grab the first sector of the disk:
https://github.com/libguestfs/libnbd/blob/a5f8fd2f0f48e9cf2487e23750b55f67b166014f/examples/simple-fetch-first-sector.c#L14
High performance multi-threaded reads and writes, with multiple
connections and multiple commands in flight on each connection:
https://github.com/libguestfs/libnbd/blob/master/examples/threaded-reads-and-writes.c
Integrate with glib main loop:
https://github.com/libguestfs/libnbd/blob/master/examples/glib-main-loop.c
Connect to an NBD server from an interactive shell:
  $ nbdkit -f linuxdisk . &
  $ nbdsh --connect nbd://localhost
  Welcome to nbdsh, the shell for interacting with
  Network Block Device (NBD) servers.
  nbd> h.get_size()
  716266496
  nbd> buf = h.pread (512, 0)
  nbd> print ("%r" % buf)
  [prints the first sector]
Use ‘fio’ to benchmark an NBD server:
  $ nbdkit -U - memory size=256M \
        --run 'export unixsocket ; fio examples/nbd.fio '
Rich.
-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org
Apparently Analagous Threads
- ANNOUNCE: libnbd 1.4 - high performance NBD client library
- ANNOUNCE: libnbd 1.0 & nbdkit 1.14 - high performance NBD client and server
- ANNOUNCE: libnbd 1.2 & nbdkit 1.16 - high performance NBD client and server
- [libnbd PATCH v2] nbdsh: Catch nbd.Error from -c arguments
- [libnbd PATCH] nbdsh: Hide nbd.Error from abrt-python3-handler
