.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Podwrapper::Man 1.38.1 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "nbdkit-nozero-filter 1" .TH nbdkit-nozero-filter 1 2024-04-21 nbdkit-1.38.1 NBDKIT .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME nbdkit\-nozero\-filter \- nbdkit nozero filter .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& nbdkit \-\-filter=nozero plugin [plugin\-args...] \e \& [zeromode=MODE] [fastzeromode=MODE] .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CW\*(C`nbdkit\-nozero\-filter\*(C'\fR is a filter that intentionally disables efficient handling of sparse file holes (ranges of all-zero bytes) across the NBD protocol. It is mainly useful for evaluating timing differences between naive vs. sparse-aware connections, and for testing client or server fallbacks. .SH PARAMETERS .IX Header "PARAMETERS" The parameters \f(CW\*(C`zeromode\*(C'\fR and \f(CW\*(C`fastzeromode\*(C'\fR are optional and control which mode the filter will use. .IP \fBzeromode=none\fR 4 .IX Item "zeromode=none" Zero support is not advertised to the client; clients must explicitly write any regions of zero like any other normal write. .Sp This is the default if the \f(CW\*(C`zeromode\*(C'\fR parameter is not specified. .IP \fBzeromode=emulate\fR 4 .IX Item "zeromode=emulate" Zero support is advertised, but emulated by the filter by using the plugin's \f(CW\*(C`pwrite\*(C'\fR callback, regardless of whether the plugin itself has a more efficient \f(CW\*(C`zero\*(C'\fR callback. .IP \fBzeromode=notrim\fR 4 .IX Item "zeromode=notrim" (nbdkit ≥ 1.14) .Sp Zero requests are forwarded on to the plugin, except that the plugin will never see the \f(CW\*(C`NBDKIT_MAY_TRIM\*(C'\fR flag. This can help determine if the client permitting trimming during zero operations makes a difference. It is an error to request this mode if the plugin lacks the \f(CW\*(C`zero\*(C'\fR callback. .IP \fBzeromode=plugin\fR 4 .IX Item "zeromode=plugin" (nbdkit ≥ 1.16) .Sp Zero requests are forwarded on to the plugin, unchanged by the filter; this mode is helpful when experimenting with the \f(CW\*(C`fastzeromode\*(C'\fR parameter. It is an error to request this mode if the plugin lacks the \f(CW\*(C`zero\*(C'\fR callback. .IP \fBfastzeromode=none\fR 4 .IX Item "fastzeromode=none" (nbdkit ≥ 1.16) .Sp Support for fast zeroing is not advertised to the client. .IP \fBfastzeromode=slow\fR 4 .IX Item "fastzeromode=slow" (nbdkit ≥ 1.16) .Sp Fast zero support is advertised to the client, but all fast zero requests result in an immediate \f(CW\*(C`ENOTSUP\*(C'\fR failure rather than performing any fallback attempts. .IP \fBfastzeromode=ignore\fR 4 .IX Item "fastzeromode=ignore" (nbdkit ≥ 1.16) .Sp \&\fBThis mode is unsafe\fR: Fast zero support is advertised to the client, but all fast zero requests behave as if the fast zero flag had not been included. This behavior is typically contrary to the NBD specification, but can be useful for comparison against the actual fast zero implementation to see if fast zeroes make a difference. .IP \fBfastzeromode=default\fR 4 .IX Item "fastzeromode=default" (nbdkit ≥ 1.16) .Sp This mode is the default. When paired with \f(CW\*(C`zeromode=emulate\*(C'\fR, fast zeroes are advertised but fast zero requests always fail (similar to \&\f(CW\*(C`slow\*(C'\fR); when paired with \f(CW\*(C`zeromode=notrim\*(C'\fR or \f(CW\*(C`zeromode=plugin\*(C'\fR, fast zero support is left to the plugin (although in the latter case, the nozero filter could be omitted for the same behavior). .SH EXAMPLES .IX Header "EXAMPLES" Serve the file \fIdisk.img\fR, but force the client to write zeroes explicitly rather than with \f(CW\*(C`NBD_CMD_WRITE_ZEROES\*(C'\fR: .PP .Vb 1 \& nbdkit \-\-filter=nozero file disk.img .Ve .PP Serve the file \fIdisk.img\fR, allowing the client to take advantage of less network traffic via \f(CW\*(C`NBD_CMD_WRITE_ZEROES\*(C'\fR, but fail any fast zero requests up front and force all other zero requests to write data explicitly rather than punching any holes: .PP .Vb 1 \& nbdkit \-\-filter=nozero file zeromode=emulate disk.img .Ve .PP Serve the file \fIdisk.img\fR, but do not advertise fast zero support to the client even if the plugin supports it: .PP .Vb 1 \& nbdkit \-\-filter=nozero file zeromode=plugin fastzeromode=none disk.img .Ve .SH FILES .IX Header "FILES" .ie n .IP \fR\fI$filterdir\fR\fI/nbdkit\-nozero\-filter.so\fR 4 .el .IP \fR\f(CI$filterdir\fR\fI/nbdkit\-nozero\-filter.so\fR 4 .IX Item "$filterdir/nbdkit-nozero-filter.so" The filter. .Sp Use \f(CW\*(C`nbdkit \-\-dump\-config\*(C'\fR to find the location of \f(CW$filterdir\fR. .SH VERSION .IX Header "VERSION" \&\f(CW\*(C`nbdkit\-nozero\-filter\*(C'\fR first appeared in nbdkit 1.4. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBnbdkit\fR\|(1), \&\fBnbdkit\-file\-plugin\fR\|(1), \&\fBnbdkit\-filter\fR\|(3), \&\fBnbdkit\-fua\-filter\fR\|(1), \&\fBnbdkit\-multi\-conn\-filter\fR\|(1), \&\fBnbdkit\-nocache\-filter\fR\|(1), \&\fBnbdkit\-noparallel\-filter\fR\|(1), \&\fBnbdkit\-noextents\-filter\fR\|(1). .SH AUTHORS .IX Header "AUTHORS" Eric Blake .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright Red Hat .SH LICENSE .IX Header "LICENSE" Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: .IP \(bu 4 Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. .IP \(bu 4 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. .IP \(bu 4 Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. .PP THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.