Changes in libnbd.
[libguestfs-talks.git] / 2019-kvm-forum / papers / NBD-changes.tex
1 \documentclass[12pt,a4paper]{article}
2 \usepackage[utf8x]{inputenc}
3 \usepackage{parskip}
4 \usepackage{hyperref}
5 \usepackage{xcolor}
6 \hypersetup{
7     colorlinks,
8     linkcolor={red!50!black},
9     citecolor={blue!50!black},
10     urlcolor={blue!80!black}
11 }
12 %\usepackage{abstract}
13 %\usepackage{graphicx}
14 %\DeclareGraphicsExtensions{.pdf,.png,.jpg}
15 \usepackage{float}
16 \floatstyle{boxed}
17 \restylefloat{figure}
18 \usepackage{fancyhdr}
19   \pagestyle{fancy}
20   %\fancyhead{}
21   %\fancyfoot{}
22
23 \title{Summary of changes in NBD-related projects since mid 2016}
24
25 \begin{document}
26 \maketitle
27
28 \section{NBD protocol}
29 \url{https://github.com/NetworkBlockDevice/nbd/blob/master/doc/proto.md}
30
31 \begin{description}
32 \item[2016]
33
34 \verb|WRITE_ZEROES|
35
36 \verb|NBD_OPT_INFO| and \verb|NBD_OPT_GO| (finalized)
37
38 TLS support (finalized)
39
40 \verb|NBD_OPT_BLOCK_SIZE|
41
42 \verb|NBD_FLAG_CAN_MULTI_CONN|
43
44 \item[2017]
45
46 \verb|STRUCTURED_REPLY| merged
47
48 \item[2018]
49
50 \verb|NBD_CMD_BLOCK_STATUS|, metadata contexts, \verb|base:|
51 namespace, etc. merged
52
53 Preferred block size specified as 512 bytes.  Document maximum
54 request size limits.
55
56 \verb|NBD_CMD_CACHE|
57
58 \item[2019]
59
60 \verb|NBD_CMD_FLAG_FAST_ZERO|
61
62 Recommend use of \verb|TCP_NODELAY|
63
64 \end{description}
65
66 \subsection{URIs}
67
68 \begin{description}
69 \item[2019]
70 NBD URI specification was introduced.
71 \url{https://github.com/NetworkBlockDevice/nbd/blob/master/doc/uri.md}
72 \end{description}
73
74
75 \f
76 \section{qemu-nbd}
77
78
79
80 \f
81 \section{nbdkit}
82
83
84 \f
85 \section{libnbd}
86
87 Project started last day of April 2019.
88
89 \begin{description}
90
91 \item[May 2019]
92
93 Most \verb|NBD_CMD_| implemented, and working connection to nbdkit,
94 within first 10 days.  Interoperating with qemu-nbd within 2 weeks.
95 TLS implemented and interoperating with qemu-nbd within 16 days.
96
97 Generated C API, Python 3 bindings and \verb|nbdsh|, OCaml bindings,
98 hierarchical state machine.
99
100 Export names
101
102 Subprocess server (\verb|nbd_connect_command|)
103
104 Structured replies
105
106 \verb|NBD_CMD_BLOCK_STATUS| and \verb|base:allocation|
107
108 Multiple commands ready to issue and in flight
109
110 Callbacks
111
112 ``Internal'' multi-conn support added then removed
113
114 Valgrinding
115
116 Some API calls can be handled without taking the lock
117
118 libnbd $0.1.2$ was released on May $30^{th}$ 2019.
119
120 \item[June 2019]
121
122 NBD URIs supported
123
124 \verb|nbdsh -c| parameter
125
126 \verb|MSG_MORE| optimization
127
128 Better handling of multiple in-flight commands, a lot of
129 optimization, and finessing of the API.
130
131 Python bindings custom exception \verb|nbd.Error|
132
133 \item[July 2019]
134
135 Port to FreeBSD
136
137 Further work on callbacks
138
139 Optimize command queue to be $O(1)$ instead of $O(n)$
140
141 Symbol versions
142
143 libnbd $0.9.6$ was released on Jul $30^{th}$ 2019.
144
145 \item[August 2019]
146
147 More tests
148
149 Debug output includes function names, parameters, return values
150
151 Optional function parameters
152
153 Man pages for every API
154
155 Port to RHEL 7
156
157 First stable version $1.0$ was released on August $27^{th}$ 2019.
158
159 \item[September 2019]
160
161 Support for \verb|FAST_ZERO|
162
163 New APIs for testing servers without Structured Replies and explicitly
164 setting handshake flags.  New APIs for finding out if TLS was
165 negotiated, and what NBD protocol is being used.
166
167 Reproducible build
168
169 Two CVEs found
170
171 Share \verb|nbd-protocol.h| file with nbdkit
172
173 \item[October 2019]
174
175 Systemd socket activation
176
177 Fuzz testing (discovers one serious CVE)
178
179 New API to connect directly to socket
180
181 New \verb|nbdfuse| tool
182
183 \end{description}
184
185 \end{document}