1nbd_aio_opt_set_meta_context_queries(L3I)BNnBbDd_aio_opt_set_meta_context_queries(3)
2
3
4

NAME

6       nbd_aio_opt_set_meta_context_queries - select specific meta contexts,
7       with explicit query list
8

SYNOPSIS

10        #include <libnbd.h>
11
12        typedef struct {
13          int (*callback) (void *user_data, const char *name);
14          void *user_data;
15          void (*free) (void *user_data);
16        } nbd_context_callback;
17
18        typedef struct {
19          int (*callback) (void *user_data, int *error);
20          void *user_data;
21          void (*free) (void *user_data);
22        } nbd_completion_callback;
23
24        int nbd_aio_opt_set_meta_context_queries (
25              struct nbd_handle *h, char **queries,
26              nbd_context_callback context_callback,
27              nbd_completion_callback completion_callback
28            );
29

DESCRIPTION

31       Request that the server supply all recognized meta contexts passed in
32       through "queries", in conjunction with the export previously specified
33       by the most recent nbd_set_export_name(3) or nbd_connect_uri(3).  This
34       can only be used if nbd_set_opt_mode(3) enabled option mode.  Normally,
35       this function is redundant, as nbd_opt_go(3) automatically does the
36       same task if structured replies have already been negotiated.  But
37       manual control over meta context requests can be useful for fine-
38       grained testing of how a server handles unusual negotiation sequences.
39       Often, use of this function is coupled with
40       nbd_set_request_meta_context(3) to bypass the automatic context request
41       normally performed by nbd_opt_go(3).
42
43       To determine when the request completes, wait for
44       nbd_aio_is_connecting(3) to return false.  Or supply the optional
45       "completion_callback" which will be invoked as described in "Completion
46       callbacks" in libnbd(3), except that it is automatically retired
47       regardless of return value.  Note that detecting whether the server
48       returns an error (as is done by the return value of the synchronous
49       counterpart) is only possible with a completion callback.
50

RETURN VALUE

52       This call returns an integer ≥ 0.
53

ERRORS

55       On error -1 is returned.
56
57       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
58       of the error.
59
60       The following parameters must not be NULL: "h", "queries".  For more
61       information see "Non-NULL parameters" in libnbd(3).
62

HANDLE STATE

64       The handle must be negotiating, otherwise this call will return an
65       error.
66

VERSION

68       This function first appeared in libnbd 1.16.
69
70       If you need to test if this function is available at compile time check
71       if the following macro is defined:
72
73        #define LIBNBD_HAVE_NBD_AIO_OPT_SET_META_CONTEXT_QUERIES 1
74

SEE ALSO

76       nbd_aio_is_connecting(3), nbd_aio_opt_set_meta_context(3),
77       nbd_connect_uri(3), nbd_create(3), nbd_opt_go(3),
78       nbd_opt_set_meta_context_queries(3), nbd_set_export_name(3),
79       nbd_set_opt_mode(3), nbd_set_request_meta_context(3), libnbd(3).
80

AUTHORS

82       Eric Blake
83
84       Richard W.M. Jones
85
87       Copyright Red Hat
88

LICENSE

90       This library is free software; you can redistribute it and/or modify it
91       under the terms of the GNU Lesser General Public License as published
92       by the Free Software Foundation; either version 2 of the License, or
93       (at your option) any later version.
94
95       This library is distributed in the hope that it will be useful, but
96       WITHOUT ANY WARRANTY; without even the implied warranty of
97       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
98       Lesser General Public License for more details.
99
100       You should have received a copy of the GNU Lesser General Public
101       License along with this library; if not, write to the Free Software
102       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
103       02110-1301 USA
104
105
106
107libnbd-1.16.5                     2023-0n9b-d2_6aio_opt_set_meta_context_queries(3)
Impressum