logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

nbdkit_export_name - get the NBD export name for nbdkit

Authors

       Richard W.M. Jones

Description

       Return the optional NBD export name if one was negotiated with the current client (this uses thread-local
       magic so no parameter is required).

       The export name is a free-form text string, it is not necessarily a path or filename and it does not need
       to begin with a '/' character.  The NBD protocol describes the empty string ("") as a representing a
       "default export" or to be used in cases where the export name does not make sense.

       Theexportnameisuntrustedclientdata,becautiouswhenparsingit.

History

       "nbdkit_export_name" was added in nbdkit 1.16.

Language Bindings

       In nbdkit-ocaml-plugin(3):

        NBDKit.export_name : unit -> string

       In nbdkit-python-plugin(3):

        import nbdkit
        name = nbdkit.export_name()

       In nbdkit-rust-plugin(3):

        use nbdkit::*;
        pub fn export_name() -> std::result::Result<String, Box<dyn error::Error>>

       In nbdkit-sh-plugin(3) the export name is available as parameter $3 of the "open" method.

License

       Redistribution and use in source and binary forms, with or without modification, are permitted provided
       that the following conditions are met:

       •   Redistributions  of  source  code must retain the above copyright notice, this list of conditions and
           the following disclaimer.

       •   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.

       •   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.

       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.

nbdkit-1.42.6                                      2025-08-01                              nbdkit_export_name(3)

Name

       nbdkit_export_name - get the NBD export name for nbdkit

Return Value

       The function returns a string.  The returned string is valid at least through the ".close" of the current
       connection, but if you need to store it in the plugin for use by more than one client you must copy it.

       If there is an error it calls nbdkit_error(3) and returns "NULL".

See Also

nbdkit(1), nbdkit_is_tls(3), nbdkit-plugin(3), nbdkit-filter(3).

Synopsis

        #include <nbdkit-plugin.h>

        const char *nbdkit_export_name (void);

See Also