1nbd_clear_meta_contexts(3)          LIBNBD          nbd_clear_meta_contexts(3)
2
3
4

NAME

6       nbd_clear_meta_contexts - reset the list of requested meta contexts
7

SYNOPSIS

9        #include <libnbd.h>
10
11        int nbd_clear_meta_contexts (struct nbd_handle *h);
12

DESCRIPTION

14       During connection libnbd can negotiate zero or more metadata contexts
15       with the server.  Metadata contexts are features (such as
16       "base:allocation") which describe information returned by the
17       nbd_block_status(3) command (for "base:allocation" this is whether
18       blocks of data are allocated, zero or sparse).
19
20       This command resets the list of meta contexts to request back to an
21       empty list, for re-population by further use of
22       nbd_add_meta_context(3).  It is primarily useful when option
23       negotiation mode is selected (see nbd_set_opt_mode(3)), for altering
24       the list of attempted contexts between subsequent export queries.
25

RETURN VALUE

27       If the call is successful the function returns 0.
28

ERRORS

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

HANDLE STATE

36       The handle must be newly created, or negotiating, otherwise this call
37       will return an error.
38

VERSION

40       This function first appeared in libnbd 1.6.
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_CLEAR_META_CONTEXTS 1
46

SEE ALSO

48       nbd_add_meta_context(3), nbd_block_status(3), nbd_can_meta_context(3),
49       nbd_create(3), nbd_get_meta_context(3), nbd_get_nr_meta_contexts(3),
50       nbd_set_opt_mode(3), libnbd(3).
51

AUTHORS

53       Eric Blake
54
55       Richard W.M. Jones
56
58       Copyright (C) 2019-2021 Red Hat Inc.
59

LICENSE

61       This library is free software; you can redistribute it and/or modify it
62       under the terms of the GNU Lesser General Public License as published
63       by the Free Software Foundation; either version 2 of the License, or
64       (at your option) any later version.
65
66       This library is distributed in the hope that it will be useful, but
67       WITHOUT ANY WARRANTY; without even the implied warranty of
68       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
69       Lesser General Public License for more details.
70
71       You should have received a copy of the GNU Lesser General Public
72       License along with this library; if not, write to the Free Software
73       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
74       02110-1301 USA
75
76
77
78libnbd-1.12.5                     2022-07-10        nbd_clear_meta_contexts(3)
Impressum