1nbdkit-checkwrite-filter(1) NBDKIT nbdkit-checkwrite-filter(1)
2
3
4
6 nbdkit-checkwrite-filter - check writes match contents of plugin
7
9 nbdkit --filter=checkwrite PLUGIN
10
12 "nbdkit-checkwrite-filter" is an nbdkit filter that turns write
13 operations into checks that what is written matches the existing
14 content of the plugin. If the content matches then the write operation
15 succeeds (doing nothing). If not then the write operation fails
16 returning EIO Input/output error.
17
18 The purpose of this filter is to test copying tools as described below.
19
20 The underlying plugin is opened read-only and is never written to. All
21 write-like operations are covered by this filter, such as trimming and
22 zeroing. This filter tests the logical equivalence of the writes,
23 ignoring differences in sparseness.
24
25 Using this filter to test copying tools
26 You can check that a copying tool is copying data correctly by creating
27 an nbdkit instance containing some test data, overlaying this filter,
28 and copying from and to nbdkit at the same time:
29
30 nbdkit --filter=checkwrite data "@32768 1" \
31 --run 'nbdcopy "$uri" "$uri"'
32
33 nbdkit --filter=checkwrite file disk.img \
34 --run 'nbdcopy "$uri" "$uri"'
35
36 nbdkit --filter=checkwrite linuxdisk testdir/ \
37 --run 'qemu-img convert -n "$uri" "$uri"'
38
39 If the copying program is buggy then you will see EIO errors and (if
40 the copying program also handles errors correctly) it should exit with
41 an error.
42
43 Other plugins for testing NBD tools
44 If you are doing this kind of testing you will also want to look at
45 nbdkit-random-plugin(1) and nbdkit-sparse-random-plugin(1). These
46 plugins already have this behaviour built in to them (because it is
47 more efficient to build it into the plugin) — you do not need to use
48 this filter with those plugins. This filter is useful for testing with
49 arbitrary plugins.
50
52 There are no parameters specific to this filter. Parameters are passed
53 through to the underlying plugin.
54
56 $filterdir/nbdkit-checkwrite-filter.so
57 The filter.
58
59 Use "nbdkit --dump-config" to find the location of $filterdir.
60
62 "nbdkit-checkwrite-filter" first appeared in nbdkit 1.24.
63
65 nbdkit(1), nbdkit-random-plugin(1), nbdkit-sparse-random-plugin(1),
66 nbdkit-filter(3), nbdkit-plugin(3), nbdcopy(1), qemu-img(1).
67
69 Richard W.M. Jones
70
72 Copyright Red Hat
73
75 Redistribution and use in source and binary forms, with or without
76 modification, are permitted provided that the following conditions are
77 met:
78
79 • Redistributions of source code must retain the above copyright
80 notice, this list of conditions and the following disclaimer.
81
82 • Redistributions in binary form must reproduce the above copyright
83 notice, this list of conditions and the following disclaimer in the
84 documentation and/or other materials provided with the
85 distribution.
86
87 • Neither the name of Red Hat nor the names of its contributors may
88 be used to endorse or promote products derived from this software
89 without specific prior written permission.
90
91 THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
92 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
93 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
94 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
95 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
96 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
97 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
98 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
99 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
100 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
101 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
102
103
104
105nbdkit-1.36.2 2023-11-26 nbdkit-checkwrite-filter(1)