1nbd_set_request_meta_context(3)     LIBNBD     nbd_set_request_meta_context(3)
2
3
4

NAME

6       nbd_set_request_meta_context - control whether connect automatically
7       requests meta contexts
8

SYNOPSIS

10        #include <libnbd.h>
11
12        int nbd_set_request_meta_context (
13              struct nbd_handle *h, bool request
14            );
15

DESCRIPTION

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 and any contexts were registered by
22       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 if the client did not request any contexts via
35       nbd_add_meta_context(3).  Setting this control to false may cause
36       nbd_block_status(3) to fail.
37

RETURN VALUE

39       If the call is successful the function returns 0.
40

ERRORS

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

HANDLE STATE

51       The handle must be newly created, or negotiating, otherwise this call
52       will return an error.
53

VERSION

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

SEE ALSO

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

AUTHORS

70       Eric Blake
71
72       Richard W.M. Jones
73
75       Copyright Red Hat
76

LICENSE

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.16.5                     2023-09-26   nbd_set_request_meta_context(3)
Impressum