1nbd_set_export_name(3)              LIBNBD              nbd_set_export_name(3)
2
3
4

NAME

6       nbd_set_export_name - set the export name
7

SYNOPSIS

9        #include <libnbd.h>
10
11        int nbd_set_export_name (struct nbd_handle *h,
12                                 const char *export_name);
13

DESCRIPTION

15       For servers which require an export name or can serve different content
16       on different exports, set the "export_name" to connect to.  The default
17       is the empty string "".
18
19       This is only relevant when connecting to servers using the newstyle
20       protocol as the oldstyle protocol did not support export names.  The
21       NBD protocol limits export names to 4096 bytes, but servers may not
22       support the full length.  The encoding of export names is always UTF-8.
23
24       When option mode is not in use, the export name must be set before
25       beginning a connection.  However, when nbd_set_opt_mode(3) has enabled
26       option mode, it is possible to change the export name prior to
27       nbd_opt_go(3).  In particular, the use of nbd_opt_list(3) during
28       negotiation can be used to determine a name the server is likely to
29       accept, and nbd_opt_info(3) can be used to learn details about an
30       export before connecting.
31
32       This call may be skipped if using nbd_connect_uri(3) to connect to a
33       URI that includes an export name.
34

RETURN VALUE

36       If the call is successful the function returns 0.
37

ERRORS

39       On error "-1" is returned.
40
41       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
42       of the error.
43

HANDLE STATE

45       The handle must be newly created, or negotiating, otherwise this call
46       will return an error.
47

VERSION

49       This function first appeared in libnbd 1.0.
50
51       If you need to test if this function is available at compile time check
52       if the following macro is defined:
53
54        #define LIBNBD_HAVE_NBD_SET_EXPORT_NAME 1
55

SEE ALSO

57       nbd_connect_uri(3), nbd_create(3), nbd_get_export_name(3),
58       nbd_opt_go(3), nbd_opt_info(3), nbd_opt_list(3), nbd_set_opt_mode(3),
59       libnbd(3).
60

AUTHORS

62       Eric Blake
63
64       Richard W.M. Jones
65
67       Copyright (C) 2019-2021 Red Hat Inc.
68

LICENSE

70       This library is free software; you can redistribute it and/or modify it
71       under the terms of the GNU Lesser General Public License as published
72       by the Free Software Foundation; either version 2 of the License, or
73       (at your option) any later version.
74
75       This library is distributed in the hope that it will be useful, but
76       WITHOUT ANY WARRANTY; without even the implied warranty of
77       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
78       Lesser General Public License for more details.
79
80       You should have received a copy of the GNU Lesser General Public
81       License along with this library; if not, write to the Free Software
82       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
83       02110-1301 USA
84
85
86
87libnbd-1.7.12                     2021-05-29            nbd_set_export_name(3)
Impressum