[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Requirements for an NBD client library in userspace



I believe there is no simple NBD client library.  Am I wrong about
this?  Let's assume I'm not for the sake of the rest of this email ...

We do however have at least 4 places this could be consumed if it existed:

 - fio's proposed NBD engine
   https://www.spinics.net/lists/fio/msg07831.html

 - nbdkit-nbd-plugin
   https://github.com/libguestfs/nbdkit/tree/master/plugins/nbd

 - Martin K's forthcoming VMware liberation tool

 - qemu, maybe?
   https://github.com/qemu/qemu/blob/master/block/nbd-client.c

In this email I'm trying to assemble some requirements for such a
library, and I've also attempted to categorize them according to how
difficult they might be to implement.  I guess everyone will have
their own opinions on which features are most "required" and which are
optional, but I've added mine below too.

Did I miss out anything?

1 = easy to implement  ...  5 = hard to implement
|
| R* = required, library could not be used without it
| R  = required
| O+ = optional, but very useful for many users
| O  = optional
| O- = optional, not likely to be useful for many users
| |
v v

1 R*   Library which runs in userspace, callable from C programs

3 O+   Callable from other programming languages, eg Python etc.

1 R*   Connect to Unix domain socket

1 R*   Connect to TCP port

1 R    Connect to TCP port over IPv6

1 O-   Connect to arbitrary file descriptor [eg. for nbdkit -s]

2 R    Synchronous support for easy initial use

5 O+   Non-blocking/asynch support, use with select/poll

4 O+   Integrates with external main loops, glib2, APR pollset, etc.

4 O    TLS support using X.509 certs

4 O    TLS-PSK support

5 O    NBD MULTI_CONN

5 O    NBD out of order requests on single socket

2 O-   Old-style protocol

3 R    NBD_OPT_INFO mode [required for qemu]

5 O    NBD structured replies

3 O+   NBD block status querying

? ?    NBD resize extension


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


Reply to: