1nbd_can_meta_context(3)             LIBNBD             nbd_can_meta_context(3)
2
3
4

NAME

6       nbd_can_meta_context - does the server support a specific meta context?
7

SYNOPSIS

9        #include <libnbd.h>
10
11        int nbd_can_meta_context (
12              struct nbd_handle *h, const char *metacontext
13            );
14

DESCRIPTION

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       If the server supports block status filtering (see
23       nbd_can_block_status_payload(3), this function must return true for any
24       filter name passed to nbd_block_status_filter(3).
25
26       The single parameter is the name of the metadata context, for example
27       "LIBNBD_CONTEXT_BASE_ALLOCATION".  <libnbd.h> includes defined
28       constants for well-known namespace contexts beginning with
29       "LIBNBD_CONTEXT_", but you are free to pass in other contexts.
30
31       This call does not block, because it returns data that is saved in the
32       handle from the NBD protocol handshake.
33

RETURN VALUE

35       This call returns a boolean value.
36

ERRORS

38       On error -1 is returned.
39
40       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
41       of the error.
42
43       The following parameters must not be NULL: "h", "metacontext".  For
44       more information see "Non-NULL parameters" in libnbd(3).
45

HANDLE STATE

47       The handle must be negotiating, or connected with the server, or shut
48       down, otherwise this call will return an error.
49

VERSION

51       This function first appeared in libnbd 1.0.
52
53       If you need to test if this function is available at compile time check
54       if the following macro is defined:
55
56        #define LIBNBD_HAVE_NBD_CAN_META_CONTEXT 1
57

SEE ALSO

59       nbd_add_meta_context(3), nbd_aio_block_status_64(3),
60       nbd_block_status_64(3), nbd_block_status_filter(3),
61       nbd_can_block_status_payload(3), nbd_create(3), nbd_opt_info(3),
62       nbd_opt_set_meta_context(3), nbd_set_request_meta_context(3), "Flag
63       calls" in libnbd(3), libnbd(3).
64

AUTHORS

66       Eric Blake
67
68       Richard W.M. Jones
69
71       Copyright Red Hat
72

LICENSE

74       This library is free software; you can redistribute it and/or modify it
75       under the terms of the GNU Lesser General Public License as published
76       by the Free Software Foundation; either version 2 of the License, or
77       (at your option) any later version.
78
79       This library is distributed in the hope that it will be useful, but
80       WITHOUT ANY WARRANTY; without even the implied warranty of
81       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
82       Lesser General Public License for more details.
83
84       You should have received a copy of the GNU Lesser General Public
85       License along with this library; if not, write to the Free Software
86       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
87       02110-1301 USA
88
89
90
91libnbd-1.18.1                     2023-10-31           nbd_can_meta_context(3)
Impressum