1nbdkit-blocksize-filter(1)          NBDKIT          nbdkit-blocksize-filter(1)
2
3
4

NAME

6       nbdkit-blocksize-filter - nbdkit blocksize filter
7

SYNOPSIS

9        nbdkit --filter=blocksize plugin [minblock=SIZE] [maxdata=SIZE] \
10            [maxlen=SIZE] [plugin-args...]
11

DESCRIPTION

13       "nbdkit-blocksize-filter" is a filter that ensures various block size
14       limits are met on transactions presented to the plugin.  The NBD
15       protocol permits clients to send requests with a granularity as small
16       as 1 byte or as large as nearly 4 gigabytes, although it suggests that
17       portable clients should align requests to 512 bytes and not exceed 32
18       megabytes without prior coordination with the server.
19
20       Meanwhile, some plugins require requests to be aligned to 512-byte
21       multiples, or may enforce a maximum transaction size to bound the time
22       or memory resources spent by any one command (note that nbdkit itself
23       refuses a read or write larger than 64 megabytes, while many other NBD
24       servers limit things to 32 megabytes).  The blocksize filter can be
25       used to modify the client requests to meet the plugin restrictions.
26

PARAMETERS

28       The nbdkit-blocksize-filter accepts the following parameters.
29
30       minblock=SIZE
31           The minimum block size and alignment to pass to the plugin.  This
32           must be a power of two, and no larger than 64k.  If omitted, this
33           defaults to 1 (that is, no minimum size restrictions).  The filter
34           rounds up read requests to alignment boundaries, performs read-
35           modify-write cycles for any unaligned head or tail of a write or
36           zero request, and silently ignores any unaligned head or tail of a
37           trim request.  The filter also truncates the plugin size down to an
38           aligned value (as it cannot safely operate on the unaligned tail);
39           it is an error if this would result in a size of 0.
40
41           This parameter understands the suffix 'k' for 1024.
42
43       maxdata=SIZE
44           The maximum block size for any single transaction with data (read
45           and write).  If omitted, this defaults to 64 megabytes (that is,
46           the nbdkit maximum).  This need not be a power of two, but must be
47           an integer multiple of "minblock".  The filter fragments any larger
48           client request into multiple plugin requests.
49
50           This parameter understands the suffixes 'k', 'M', and 'G' for
51           powers of 1024.
52
53       maxlen=SIZE
54           The maximum length for any single transaction without data (trim,
55           zero or extents).  If omitted, this defaults to 0xffffffff rounded
56           down to "minsize" alignment (that is, the inherent 32-bit limit of
57           the NBD protocol).  This need not be a power of two, but must be an
58           integer multiple of "minblock", and should be at least as large as
59           "maxdata".  The filter fragments any larger client request into
60           multiple plugin requests.
61
62           This parameter understands the suffixes 'k', 'M', and 'G' for
63           powers of 1024.
64

EXAMPLES

66       Allow an arbitrary client to use the VDDK plugin (which is limited to
67       512-byte blocks), without having to fix the client to avoid sending
68       unaligned requests:
69
70        nbdkit --filter=blocksize vddk minblock=512 file=/absolute/path/to/file.vmdk
71
72       Allow an arbitrary client tuned to nbdkit's 64 megabyte sizing to
73       connect to a remote server that insists on 32 megabyte sizing, via the
74       nbd plugin:
75
76        nbdkit --filter=blocksize nbd maxdata=32M socket=/path/to/socket
77

SEE ALSO

79       nbdkit(1), nbdkit-nbd-plugin(1), nbdkit-vddk-plugin(1),
80       nbdkit-filter(3).
81

AUTHORS

83       Eric Blake
84
86       Copyright (C) 2018 Red Hat Inc.
87

LICENSE

89       Redistribution and use in source and binary forms, with or without
90       modification, are permitted provided that the following conditions are
91       met:
92
93       ·   Redistributions of source code must retain the above copyright
94           notice, this list of conditions and the following disclaimer.
95
96       ·   Redistributions in binary form must reproduce the above copyright
97           notice, this list of conditions and the following disclaimer in the
98           documentation and/or other materials provided with the
99           distribution.
100
101       ·   Neither the name of Red Hat nor the names of its contributors may
102           be used to endorse or promote products derived from this software
103           without specific prior written permission.
104
105       THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY
106       EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
107       IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
108       PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE
109       LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
110       CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
111       SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
112       BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
113       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
114       OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
115       ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
116
117
118
119nbdkit-1.12.3                     2019-05-21        nbdkit-blocksize-filter(1)
Impressum