nbdkit-exportname-filter(1) | NBDKIT | nbdkit-exportname-filter(1) |
nbdkit-exportname-filter - adjust export names between client and plugin
nbdkit --filter=exportname plugin [default-export=NAME] [exportname-list=MODE] [exportname-strict=true] [exportname=NAME]... [exportdesc=DESC]
Some plugins (such as "nbdkit-file-plugin(1)" and filters (such as "nbdkit-ext2-filter(1)" are able to serve different content based on the export name requested by the client. The NBD protocol allows a server to advertise the set of export names it is serving. However, the list advertised (or absent) from the plugin may not always match what you want an actual client to see. This filter can be used to alter the advertised list, as well as configuring which export should be treated as the default when the client requests the empty string ("") as an export name.
Suppose that the directory /path/to/dir contains permanent files named file1, file2, and file3. The following commands show various ways to alter the use of export names while serving that directory:
Allow a client requesting "" to get the contents of file2, rather than an error:
nbdkit --filter=exportname file dir=/path/to/dir default-export=file2
Do not advertise any exports; a client must know in advance what export names to try:
nbdkit --filter=exportname file dir=/path/to/dir exportname-list=empty
Allow clients to connect to file1 and file3, but not file2:
nbdkit --filter=exportname file dir=/path/to/dir \ exportname-list=explicit exportname-strict=true \ exportname=file1 exportname=file3
Offer ls(3) long descriptions alongside each export name:
nbdkit --filter=exportname file dir=/path/to/dir \ exportdesc=script:'ls -l /path/to/dir/"$name"'
Use "nbdkit --dump-config" to find the location of $filterdir.
"nbdkit-exportname-filter" first appeared in nbdkit 1.24.
nbdkit(1), nbdkit-filter(3), nbdkit-ext2-filter(1), nbdkit-extentlist-filter(1), nbdkit-fua-filter(1), nbdkit-nocache-filter(1), nbdkit-noparallel-filter(1), nbdkit-nozero-filter(1), nbdkit-file-plugin(1), nbdkit-info-plugin(1).
Eric Blake
Copyright (C) 2020 Red Hat Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
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.
2021-01-20 | nbdkit-1.24.1 |