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

Re: Requirements for an NBD client library in userspace





On Tue, Apr 30, 2019, 15:46 Richard W.M. Jones <rjones@redhat.com> wrote:
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

oVirt imageio, replacing pure python client, used to implement nbd-http proxy
https://github.com/oVirt/ovirt-imageio/blob/master/common/ovirt_imageio_common/nbd.py


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

Should be O+, this gives huge performance improvment when reading mostly empty range, even without block status.

This is also not so hard to implement, maybe 3?


3 O+   NBD block status querying

Should be able to query qemu meta context


? ?    NBD resize extension

Nir

Reply to: