Use "Javascript include" for plugins.
[libguestfs-talks.git] / 2019-fosdem / 7200-error-filter.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>Useful nbdkit filters: the error filter</h1>
6
7 <style>
8 b {
9     border: 1px solid rgb(204,0,0);
10     background: #eef;
11     padding: 5px;
12     border-radius: 15px;
13 }
14 </style>
15
16 <pre>
17 nbdkit --filter=error <i>[...]</i> error=EIO error-rate=10%
18
19 nbdkit --filter=error <i>[...]</i> error-rate=100% error-file=/tmp/inject
20 </pre>
21
22 <ul>
23 <li> Errors can be injected randomly with a uniform distribution.
24 <li> More usefully you can trigger errors from the presence of
25 an error file.
26 <li> NBD protocol only supports: <code>EPERM</code>, <code>EIO</code>,
27 <code>ENOMEM</code>, <code>EINVAL</code>, <code>ENOSPC</code> or
28 <code>ESHUTDOWN</code>.
29 </ul>
30
31 <!-- note: div must have position: relative so child elements position
32      is correct -->
33 <div style="background: #cfc; border: 1px solid rgb(204,0,0);
34             position:relative;
35             width: 800px; height: 220px;">
36   <code style="position: absolute; top: 1px; left: 50px;">blocksize</code>
37   <code style="position: absolute; top: 50px; left: 100px;">cache</code>
38   <code style="position: absolute; top: 80px; left: 115px;">cow</code>
39   <code style="position: absolute; top: 140px; left: 10px;">delay</code>
40   <code style="position: absolute; top: 180px; left: 100px;"><b>error</b></code>
41
42   <code style="position: absolute; top: 10px; left: 400px;">fua</code>
43   <code style="position: absolute; top: 60px; left: 600px;">log</code>
44   <code style="position: absolute; top: 90px; left: 250px;">nozero</code>
45   <code style="position: absolute; top: 130px; left: 530px;">offset</code>
46   <code style="position: absolute; top: 150px; left: 280px;">partition</code>
47   <code style="position: absolute; top: 180px; left: 480px;">truncate</code>
48 </div>