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 (struct nbd_handle *h,
12 const char *metacontext);
13
15 Returns true if the server supports the given meta context (see
16 nbd_add_meta_context(3)). Returns false if the server does not.
17
18 The single parameter is the name of the metadata context, for example
19 "LIBNBD_CONTEXT_BASE_ALLOCATION". <libnbd.h> includes defined
20 constants for well-known namespace contexts beginning with
21 "LIBNBD_CONTEXT_", but you are free to pass in other contexts.
22
23 This call does not block, because it returns data that is saved in the
24 handle from the NBD protocol handshake.
25
27 This call returns a boolean value.
28
30 On error "-1" is returned.
31
32 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
33 of the error.
34
36 The handle must be negotiating, or connected with the server, or shut
37 down, otherwise this call will return an error.
38
40 This function first appeared in libnbd 1.0.
41
42 If you need to test if this function is available at compile time check
43 if the following macro is defined:
44
45 #define LIBNBD_HAVE_NBD_CAN_META_CONTEXT 1
46
48 nbd_add_meta_context(3), nbd_aio_block_status(3), nbd_block_status(3),
49 nbd_create(3), nbd_opt_info(3), "Flag calls" in libnbd(3), libnbd(3).
50
52 Eric Blake
53
54 Richard W.M. Jones
55
57 Copyright (C) 2019-2020 Red Hat Inc.
58
60 This library is free software; you can redistribute it and/or modify it
61 under the terms of the GNU Lesser General Public License as published
62 by the Free Software Foundation; either version 2 of the License, or
63 (at your option) any later version.
64
65 This library is distributed in the hope that it will be useful, but
66 WITHOUT ANY WARRANTY; without even the implied warranty of
67 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
68 Lesser General Public License for more details.
69
70 You should have received a copy of the GNU Lesser General Public
71 License along with this library; if not, write to the Free Software
72 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
73 02110-1301 USA
74
75
76
77libnbd-1.6.2 2021-03-02 nbd_can_meta_context(3)