1nbd_can_meta_context(3) LIBNBD nbd_can_meta_context(3)
2
3
4
6 nbd_can_meta_context - does the server support a specific meta context?
7
9 #include <libnbd.h>
10
11 int nbd_can_meta_context (
12 struct nbd_handle *h, const char *metacontext
13 );
14
16 Returns true if the server supports the given meta context (see
17 nbd_add_meta_context(3)). Returns false if the server does not. It is
18 possible for this command to fail if meta contexts were requested but
19 there is a missing or failed attempt at NBD_OPT_SET_META_CONTEXT during
20 option negotiation.
21
22 The single parameter is the name of the metadata context, for example
23 "LIBNBD_CONTEXT_BASE_ALLOCATION". <libnbd.h> includes defined
24 constants for well-known namespace contexts beginning with
25 "LIBNBD_CONTEXT_", but you are free to pass in other contexts.
26
27 This call does not block, because it returns data that is saved in the
28 handle from the NBD protocol handshake.
29
31 This call returns a boolean value.
32
34 On error -1 is returned.
35
36 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
37 of the error.
38
39 The following parameters must not be NULL: "h", "metacontext". For
40 more information see "Non-NULL parameters" in libnbd(3).
41
43 The handle must be negotiating, or connected with the server, or shut
44 down, otherwise this call will return an error.
45
47 This function first appeared in libnbd 1.0.
48
49 If you need to test if this function is available at compile time check
50 if the following macro is defined:
51
52 #define LIBNBD_HAVE_NBD_CAN_META_CONTEXT 1
53
55 nbd_add_meta_context(3), nbd_aio_block_status(3), nbd_block_status(3),
56 nbd_create(3), nbd_opt_info(3), nbd_opt_set_meta_context(3),
57 nbd_set_request_meta_context(3), "Flag calls" in libnbd(3), libnbd(3).
58
60 Eric Blake
61
62 Richard W.M. Jones
63
65 Copyright Red Hat
66
68 This library is free software; you can redistribute it and/or modify it
69 under the terms of the GNU Lesser General Public License as published
70 by the Free Software Foundation; either version 2 of the License, or
71 (at your option) any later version.
72
73 This library is distributed in the hope that it will be useful, but
74 WITHOUT ANY WARRANTY; without even the implied warranty of
75 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
76 Lesser General Public License for more details.
77
78 You should have received a copy of the GNU Lesser General Public
79 License along with this library; if not, write to the Free Software
80 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
81 02110-1301 USA
82
83
84
85libnbd-1.16.5 2023-09-26 nbd_can_meta_context(3)