1nbd_get_nr_meta_contexts(3) LIBNBD nbd_get_nr_meta_contexts(3)
2
3
4
6 nbd_get_nr_meta_contexts - return the current number of requested meta
7 contexts
8
10 #include <libnbd.h>
11
12 ssize_t nbd_get_nr_meta_contexts (struct nbd_handle *h);
13
15 During connection libnbd can negotiate zero or more metadata contexts
16 with the server. Metadata contexts are features (such as
17 "base:allocation") which describe information returned by the
18 nbd_block_status(3) command (for "base:allocation" this is whether
19 blocks of data are allocated, zero or sparse).
20
21 This command returns how many meta contexts have been added to the list
22 to request from the server via nbd_add_meta_context(3). The server is
23 not obligated to honor all of the requests; to see what it actually
24 supports, see nbd_can_meta_context(3).
25
27 This call returns an integer size ≥ 0.
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
35 The following parameters must not be NULL: "h". For more information
36 see "Non-NULL parameters" in libnbd(3).
37
39 This function first appeared in libnbd 1.6.
40
41 If you need to test if this function is available at compile time check
42 if the following macro is defined:
43
44 #define LIBNBD_HAVE_NBD_GET_NR_META_CONTEXTS 1
45
47 nbd_add_meta_context(3), nbd_block_status(3), nbd_can_meta_context(3),
48 nbd_clear_meta_contexts(3), nbd_create(3), nbd_get_meta_context(3),
49 libnbd(3).
50
52 Eric Blake
53
54 Richard W.M. Jones
55
57 Copyright (C) 2019-2021 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.14.2 2023-01-03 nbd_get_nr_meta_contexts(3)