File: TODO

package info (click to toggle)
libnbd 1.24.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,956 kB
  • sloc: ansic: 55,158; ml: 12,325; sh: 8,811; python: 4,757; makefile: 3,038; perl: 165; cpp: 24
file content (99 lines) | stat: -rw-r--r-- 3,797 bytes parent folder | download
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
Explore if nbd_aio_notify_error is needed for faster response if
server goes away.

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.
 - 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

New tools:

 - 'nbdcmp'.  This would compare either a file and an NBD endpoint, or
   two NBD endpoints, for equality.  It could be used, amongst other
   things, for verifying an nbdcopy.  (See also 'blksum(1)')
   This might be written as a Python script.

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.

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