Revert "ci: skip "lib/test-fork-safe-execvpe.sh" on Alpine Linux"
[libnbd.git] / TODO
blob74830bd3ce6f7dc27585ea5c5243e396d91a8fe7
1 Explore if nbd_aio_notify_error is needed for faster response if
2 server goes away.
4 Bindings in other languages.
5  - Latest attempt at adding Rust:
6    https://www.redhat.com/archives/libguestfs/2019-August/msg00416.html
8 Example code integrating with ppoll, pollfd, APR pollset (and others?).
10 NBD resize extension.
12 TLS should properly shut down the session (calling gnutls_bye).
14 Potential deadlock with nbd_add_meta_context: if a client sends enough
15 requests to the server that it blocks while writing, but the server
16 replies to requests as they come in rather than waiting for the end of
17 the client request, then the server can likewise block in writing
18 replies that libnbd is not yet reading.  Not an issue for existing
19 servers that don't have enough contexts to reply with enough data to
20 fill buffers, but could be an issue with qemu-nbd if it is taught to
21 exports many dirty bitmaps simultaneously.  Revamping the
22 states-newstyle-meta-context.c state machine to let libnbd handle
23 NBD_REP_META_CONTEXT while still writing queries could be hairy.
25 Performance: Chart it over various buffer sizes and threads, as that
26   should make it easier to identify systematic issues.
28 Examine other fuzzers: https://gitlab.com/akihe/radamsa
30 nbdcopy:
31  - Enforce maximum block size.
32  - Synchronous loop should be adjusted to take into account
33    the NBD preferred block size, as was done for multi-thread loop.
34  - Benchmark.
35  - Better page cache usage, see nbdkit-file-plugin options
36    fadvise=sequential cache=none.
37  - Consider io_uring if there are performance bottlenecks.
38  - Configurable retries in response to read or write failures.
40 nbdfuse:
41  - If you write beyond the end of the virtual file, it returns EIO.
42  - Implement block_status.
44 nbdinfo:
45  - 'nbdinfo --map' needs --offset and --length parameters for mapping
46    just a subset of the image
47  - 'nbdinfo --map=context1 --map=context2' visiting two contexts in
48    lock-step would be nice
49  - 'nbdinfo --map' should consider probing all available contexts
50    rather than just base:allocation
52 Suggested API improvements:
53   general:
54   - synchronous APIs that have a timeout or can be cancelled
56   connecting:
57   - nbd_connect_tcp: allow control over whether IPv4 or IPv6 is desired
58   - nbd_connect_uri: allow control over which features are enabled
59   - nbd_connect_command: allow passing char **env
60   - connection completed callback
62   TLS:
63   - should be individual APIs for setting each TLS file
64     (set_tls_certificates can continue to exist)
65   - TLS should have a way to pass in PIN or password to
66     support encrypted keys
67   - allow use of TLS memory APIs (gnutls_datum_t + gnutls_*_mem)
68   - support PKCS11 URIs (RFC 7512)
70   Easier server implementation testing:
71   - a way to force NBD_OPT_EXPORT_NAME over NBD_OPT_GO
72   - a way to send options before NBD_OPT_STARTTLS
73   - a way to send unknown NBD_OPT or NBD_CMD
75   subprocess
76   - it should be possible to use nbd_close and never block, so
77     maybe nbd_shutdown should wait for the subprocess or there
78     should be another API to do this
79   - capture error message when nbd_connect_command fails
81   sockets
82   - allow user to pass in their own socket functions, this would allow
83     io_uring to be used
85 OCaml:
86  - Translate *error between OCaml Unix.error and C errno automatically
87    using the functions in <caml/unixsupport.h>.  This requires a
88    change to the generator CBMutable (Int _) -> CBMutable (Errno _)
89    which is quite a large change.
91 testsuite:
92  - connect-uri* tests compiled with $(RANDOMx) in the Makefile have a
93    hard-coded port number at compile time; with bad luck, it can
94    result in a binary that always fails for trying to use a contended
95    port. Rewriting these tests to use pick-a-port.c for a dynamic
96    choice would be safer.
98 Coding style:
99  - consider replacing "#if defined (macro)" with "#if defined macro", or
100    even just "#ifdef macro"; for shorter lines
101  - investigate automatic code formatting tools (such a tool could be run
102    in "check mode" in CI)
104 Code sharing with nbdkit (header files, etc):
105  - investigate a git submodule