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
50 The following parameters must not be NULL: "h". For more information
51 see "Non-NULL parameters" in libnbd(3).
52
54 The handle must be negotiating, otherwise this call will return an
55 error.
56
58 This function first appeared in libnbd 1.4.
59
60 If you need to test if this function is available at compile time check
61 if the following macro is defined:
62
63 #define LIBNBD_HAVE_NBD_AIO_OPT_LIST 1
64
66 nbd_aio_is_connecting(3), nbd_create(3), nbd_opt_list(3),
67 nbd_set_opt_mode(3), libnbd(3).
68
70 Eric Blake
71
72 Richard W.M. Jones
73
75 Copyright (C) 2019-2021 Red Hat Inc.
76
78 This library is free software; you can redistribute it and/or modify it
79 under the terms of the GNU Lesser General Public License as published
80 by the Free Software Foundation; either version 2 of the License, or
81 (at your option) any later version.
82
83 This library is distributed in the hope that it will be useful, but
84 WITHOUT ANY WARRANTY; without even the implied warranty of
85 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
86 Lesser General Public License for more details.
87
88 You should have received a copy of the GNU Lesser General Public
89 License along with this library; if not, write to the Free Software
90 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
91 02110-1301 USA
92
93
94
95libnbd-1.14.2 2023-01-03 nbd_aio_opt_list(3)