Add more introduction section slides.
[libguestfs-talks.git] / 2019-tech-introductions / 4300-libnbd-example.html
1 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
2 <link rel="stylesheet" href="style.css" type="text/css"/>
3 <script src="code.js" type="text/javascript"></script>
4
5 <h1>libnbd is easy to use</h1>
6
7 <pre>
8 struct nbd_handle *nbd;
9
10 nbd = <b>nbd_create</b> ();
11
12 <b>nbd_connect_unix</b> (nbd, "/tmp/socket");
13
14 <b>nbd_pread</b> (nbd, buf, sizeof buf, 0, 0);
15
16 <b>nbd_close</b> (nbd);
17 </pre>
18
19 <p>
20 ... also a low level,
21 high performance,
22 asynchronous (AIO) API
23 </p>