1nbd_aio_opt_list_meta_context(3) LIBNBD nbd_aio_opt_list_meta_context(3)
2
3
4
6 nbd_aio_opt_list_meta_context - request the server to list available
7 meta contexts
8
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_list_meta_context (struct nbd_handle *h,
25 nbd_context_callback context_callback,
26 nbd_completion_callback completion_callback);
27
29 Request that the server list available meta contexts associated with
30 the export previously specified by the most recent
31 nbd_set_export_name(3) or nbd_connect_uri(3). This can only be used if
32 nbd_set_opt_mode(3) enabled option mode.
33
34 To determine when the request completes, wait for
35 nbd_aio_is_connecting(3) to return false. Or supply the optional
36 "completion_callback" which will be invoked as described in "Completion
37 callbacks" in libnbd(3), except that it is automatically retired
38 regardless of return value. Note that detecting whether the server
39 returns an error (as is done by the return value of the synchronous
40 counterpart) is only possible with a completion callback.
41
43 This call returns an integer ≥ 0.
44
46 On error "-1" is returned.
47
48 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
49 of the error.
50
52 The handle must be negotiating, otherwise this call will return an
53 error.
54
56 This function first appeared in libnbd 1.6.
57
58 If you need to test if this function is available at compile time check
59 if the following macro is defined:
60
61 #define LIBNBD_HAVE_NBD_AIO_OPT_LIST_META_CONTEXT 1
62
64 nbd_aio_is_connecting(3), nbd_connect_uri(3), nbd_create(3),
65 nbd_opt_list_meta_context(3), nbd_set_export_name(3),
66 nbd_set_opt_mode(3), libnbd(3).
67
69 Eric Blake
70
71 Richard W.M. Jones
72
74 Copyright (C) 2019-2020 Red Hat Inc.
75
77 This library is free software; you can redistribute it and/or modify it
78 under the terms of the GNU Lesser General Public License as published
79 by the Free Software Foundation; either version 2 of the License, or
80 (at your option) any later version.
81
82 This library is distributed in the hope that it will be useful, but
83 WITHOUT ANY WARRANTY; without even the implied warranty of
84 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
85 Lesser General Public License for more details.
86
87 You should have received a copy of the GNU Lesser General Public
88 License along with this library; if not, write to the Free Software
89 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
90 02110-1301 USA
91
92
93
94libnbd-1.6.2 2021-03-02 nbd_aio_opt_list_meta_context(3)