3 nbdkit-nozero-filter - nbdkit nozero filter
7 nbdkit --filter=nozero plugin [plugin-args...] \
8 [zeromode=MODE] [fastzeromode=MODE]
12 C<nbdkit-nozero-filter> is a filter that intentionally disables
13 efficient handling of sparse file holes (ranges of all-zero bytes)
14 across the NBD protocol. It is mainly useful for evaluating timing
15 differences between naive vs. sparse-aware connections, and for
16 testing client or server fallbacks.
20 The parameters C<zeromode> and C<fastzeromode> are optional and
21 control which mode the filter will use.
25 =item B<zeromode=none>
27 Zero support is not advertised to the client; clients must explicitly
28 write any regions of zero like any other normal write.
30 This is the default if the C<zeromode> parameter is not specified.
32 =item B<zeromode=emulate>
34 Zero support is advertised, but emulated by the filter by using the
35 plugin's C<pwrite> callback, regardless of whether the plugin itself
36 has a more efficient C<zero> callback.
38 =item B<zeromode=notrim>
42 Zero requests are forwarded on to the plugin, except that the plugin
43 will never see the C<NBDKIT_MAY_TRIM> flag. This can help determine
44 if the client permitting trimming during zero operations makes a
45 difference. It is an error to request this mode if the plugin lacks
48 =item B<zeromode=plugin>
52 Zero requests are forwarded on to the plugin, unchanged by the filter;
53 this mode is helpful when experimenting with the C<fastzeromode>
54 parameter. It is an error to request this mode if the plugin lacks
57 =item B<fastzeromode=none>
61 Support for fast zeroing is not advertised to the client.
63 =item B<fastzeromode=slow>
67 Fast zero support is advertised to the client, but all fast zero
68 requests result in an immediate C<ENOTSUP> failure rather than
69 performing any fallback attempts.
71 =item B<fastzeromode=ignore>
75 B<This mode is unsafe>: Fast zero support is advertised to the client,
76 but all fast zero requests behave as if the fast zero flag had not
77 been included. This behavior is typically contrary to the NBD
78 specification, but can be useful for comparison against the actual
79 fast zero implementation to see if fast zeroes make a difference.
81 =item B<fastzeromode=default>
85 This mode is the default. When paired with C<zeromode=emulate>, fast
86 zeroes are advertised but fast zero requests always fail (similar to
87 C<slow>); when paired with C<zeromode=notrim> or C<zeromode=plugin>,
88 fast zero support is left to the plugin (although in the latter case,
89 the nozero filter could be omitted for the same behavior).
95 Serve the file F<disk.img>, but force the client to write zeroes
96 explicitly rather than with C<NBD_CMD_WRITE_ZEROES>:
98 nbdkit --filter=nozero file disk.img
100 Serve the file F<disk.img>, allowing the client to take advantage of
101 less network traffic via C<NBD_CMD_WRITE_ZEROES>, but fail any fast
102 zero requests up front and force all other zero requests to write data
103 explicitly rather than punching any holes:
105 nbdkit --filter=nozero file zeromode=emulate disk.img
107 Serve the file F<disk.img>, but do not advertise fast zero support to
108 the client even if the plugin supports it:
110 nbdkit --filter=nozero file zeromode=plugin fastzeromode=none disk.img
116 =item F<$filterdir/nbdkit-nozero-filter.so>
120 Use C<nbdkit --dump-config> to find the location of C<$filterdir>.
126 C<nbdkit-nozero-filter> first appeared in nbdkit 1.4.
131 L<nbdkit-file-plugin(1)>,
133 L<nbdkit-fua-filter(1)>,
134 L<nbdkit-multi-conn-filter(1)>,
135 L<nbdkit-nocache-filter(1)>,
136 L<nbdkit-noparallel-filter(1)>,
137 L<nbdkit-noextents-filter(1)>.