1nbd_set_request_meta_context(3) LIBNBD nbd_set_request_meta_context(3)
2
3
4
6 nbd_set_request_meta_context - control whether connect automatically
7 requests meta contexts
8
10 #include <libnbd.h>
11
12 int nbd_set_request_meta_context (
13 struct nbd_handle *h, bool request
14 );
15
17 This function controls whether the act of connecting to an export (all
18 "nbd_connect_*" calls when nbd_set_opt_mode(3) is false, or
19 nbd_opt_go(3) and nbd_opt_info(3) when option mode is enabled) will
20 also try to issue NBD_OPT_SET_META_CONTEXT when the server supports
21 structured replies or extended headers and any contexts were registered
22 by nbd_add_meta_context(3). The default setting is true; however the
23 extra step of negotiating meta contexts is not always desirable:
24 performing both info and go on the same export works without needing to
25 re-negotiate contexts on the second call; integration testing of other
26 servers may benefit from manual invocation of
27 nbd_opt_set_meta_context(3) at other times in the negotiation sequence;
28 and even when using just nbd_opt_info(3), it can be faster to collect
29 the server's results by relying on the callback function passed to
30 nbd_opt_list_meta_context(3) than a series of post-process calls to
31 nbd_can_meta_context(3).
32
33 Note that this control has no effect if the server does not negotiate
34 structured replies or extended headers, or if the client did not
35 request any contexts via nbd_add_meta_context(3). Setting this control
36 to false may cause nbd_block_status(3) to fail.
37
39 If the call is successful the function returns 0.
40
42 On error -1 is returned.
43
44 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
45 of the error.
46
47 The following parameters must not be NULL: "h". For more information
48 see "Non-NULL parameters" in libnbd(3).
49
51 The handle must be newly created, or negotiating, otherwise this call
52 will return an error.
53
55 This function first appeared in libnbd 1.16.
56
57 If you need to test if this function is available at compile time check
58 if the following macro is defined:
59
60 #define LIBNBD_HAVE_NBD_SET_REQUEST_META_CONTEXT 1
61
63 nbd_add_meta_context(3), nbd_block_status(3), nbd_can_meta_context(3),
64 nbd_create(3), nbd_get_request_meta_context(3),
65 nbd_get_structured_replies_negotiated(3), nbd_opt_go(3),
66 nbd_opt_info(3), nbd_opt_list_meta_context(3),
67 nbd_opt_set_meta_context(3), nbd_set_opt_mode(3), libnbd(3).
68
70 Eric Blake
71
72 Richard W.M. Jones
73
75 Copyright Red Hat
76
78 This library is free software; you can redistribute it and/or modify it
79 under the terms of the GNU Lesser General Public License as published
80 by the Free Software Foundation; either version 2 of the License, or
81 (at your option) any later version.
82
83 This library is distributed in the hope that it will be useful, but
84 WITHOUT ANY WARRANTY; without even the implied warranty of
85 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
86 Lesser General Public License for more details.
87
88 You should have received a copy of the GNU Lesser General Public
89 License along with this library; if not, write to the Free Software
90 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
91 02110-1301 USA
92
93
94
95libnbd-1.18.1 2023-10-31 nbd_set_request_meta_context(3)