1nbd_set_export_name(3) LIBNBD nbd_set_export_name(3)
2
3
4
6 nbd_set_export_name - set the export name
7
9 #include <libnbd.h>
10
11 int nbd_set_export_name (
12 struct nbd_handle *h, const char *export_name
13 );
14
16 For servers which require an export name or can serve different content
17 on different exports, set the "export_name" to connect to. The default
18 is the empty string "".
19
20 This is only relevant when connecting to servers using the newstyle
21 protocol as the oldstyle protocol did not support export names. The
22 NBD protocol limits export names to 4096 bytes, but servers may not
23 support the full length. The encoding of export names is always UTF-8.
24
25 When option mode is not in use, the export name must be set before
26 beginning a connection. However, when nbd_set_opt_mode(3) has enabled
27 option mode, it is possible to change the export name prior to
28 nbd_opt_go(3). In particular, the use of nbd_opt_list(3) during
29 negotiation can be used to determine a name the server is likely to
30 accept, and nbd_opt_info(3) can be used to learn details about an
31 export before connecting.
32
33 This call may be skipped if using nbd_connect_uri(3) to connect to a
34 URI that includes an export name.
35
37 If the call is successful the function returns 0.
38
40 On error -1 is returned.
41
42 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
43 of the error.
44
45 The following parameters must not be NULL: "h", "export_name". For
46 more information see "Non-NULL parameters" in libnbd(3).
47
49 The handle must be newly created, or negotiating, otherwise this call
50 will return an error.
51
53 This function first appeared in libnbd 1.0.
54
55 If you need to test if this function is available at compile time check
56 if the following macro is defined:
57
58 #define LIBNBD_HAVE_NBD_SET_EXPORT_NAME 1
59
61 nbd_connect_uri(3), nbd_create(3), nbd_get_export_name(3),
62 nbd_opt_go(3), nbd_opt_info(3), nbd_opt_list(3), nbd_set_opt_mode(3),
63 libnbd(3).
64
66 Eric Blake
67
68 Richard W.M. Jones
69
71 Copyright Red Hat
72
74 This library is free software; you can redistribute it and/or modify it
75 under the terms of the GNU Lesser General Public License as published
76 by the Free Software Foundation; either version 2 of the License, or
77 (at your option) any later version.
78
79 This library is distributed in the hope that it will be useful, but
80 WITHOUT ANY WARRANTY; without even the implied warranty of
81 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
82 Lesser General Public License for more details.
83
84 You should have received a copy of the GNU Lesser General Public
85 License along with this library; if not, write to the Free Software
86 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
87 02110-1301 USA
88
89
90
91libnbd-1.16.5 2023-09-26 nbd_set_export_name(3)