1nbd_aio_opt_list(3) LIBNBD nbd_aio_opt_list(3)
2
3
4
6 nbd_aio_opt_list - request the server to list all exports during
7 negotiation
8
10 #include <libnbd.h>
11
12 typedef struct {
13 int (*callback) (void *user_data, const char *name,
14 const char *description);
15 void *user_data;
16 void (*free) (void *user_data);
17 } nbd_list_callback;
18
19 typedef struct {
20 int (*callback) (void *user_data, int *error);
21 void *user_data;
22 void (*free) (void *user_data);
23 } nbd_completion_callback;
24
25 int nbd_aio_opt_list (struct nbd_handle *h,
26 nbd_list_callback list_callback,
27 nbd_completion_callback completion_callback);
28
30 Request that the server list all exports that it supports. This can
31 only be used if nbd_set_opt_mode(3) enabled option mode.
32
33 To determine when the request completes, wait for
34 nbd_aio_is_connecting(3) to return false. Or supply the optional
35 "completion_callback" which will be invoked as described in "Completion
36 callbacks" in libnbd(3), except that it is automatically retired
37 regardless of return value. Note that detecting whether the server
38 returns an error (as is done by the return value of the synchronous
39 counterpart) is only possible with a completion callback.
40
42 If the call is successful the function returns 0.
43
45 On error "-1" is returned.
46
47 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
48 of the error.
49
51 The handle must be negotiating, otherwise this call will return an
52 error.
53
55 This function first appeared in libnbd 1.4.
56
57 If you need to test if this function is available at compile time check
58 if the following macro is defined:
59
60 #define LIBNBD_HAVE_NBD_AIO_OPT_LIST 1
61
63 nbd_aio_is_connecting(3), nbd_create(3), nbd_opt_list(3),
64 nbd_set_opt_mode(3), libnbd(3).
65
67 Eric Blake
68
69 Richard W.M. Jones
70
72 Copyright (C) 2019-2021 Red Hat Inc.
73
75 This library is free software; you can redistribute it and/or modify it
76 under the terms of the GNU Lesser General Public License as published
77 by the Free Software Foundation; either version 2 of the License, or
78 (at your option) any later version.
79
80 This library is distributed in the hope that it will be useful, but
81 WITHOUT ANY WARRANTY; without even the implied warranty of
82 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
83 Lesser General Public License for more details.
84
85 You should have received a copy of the GNU Lesser General Public
86 License along with this library; if not, write to the Free Software
87 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
88 02110-1301 USA
89
90
91
92libnbd-1.10.1 2021-10-25 nbd_aio_opt_list(3)