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