1nbd_aio_opt_list(3)                 LIBNBD                 nbd_aio_opt_list(3)
2
3
4

NAME

6       nbd_aio_opt_list - request the server to list all exports during
7       negotiation
8

SYNOPSIS

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 (
26              struct nbd_handle *h,
27              nbd_list_callback list_callback,
28              nbd_completion_callback completion_callback
29            );
30

DESCRIPTION

32       Request that the server list all exports that it supports.  This can
33       only be used if nbd_set_opt_mode(3) enabled option mode.
34
35       To determine when the request completes, wait for
36       nbd_aio_is_connecting(3) to return false.  Or supply the optional
37       "completion_callback" which will be invoked as described in "Completion
38       callbacks" in libnbd(3), except that it is automatically retired
39       regardless of return value.  Note that detecting whether the server
40       returns an error (as is done by the return value of the synchronous
41       counterpart) is only possible with a completion callback.
42

RETURN VALUE

44       If the call is successful the function returns 0.
45

ERRORS

47       On error -1 is returned.
48
49       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
50       of the error.
51
52       The following parameters must not be NULL: "h".  For more information
53       see "Non-NULL parameters" in libnbd(3).
54

HANDLE STATE

56       The handle must be negotiating, otherwise this call will return an
57       error.
58

VERSION

60       This function first appeared in libnbd 1.4.
61
62       If you need to test if this function is available at compile time check
63       if the following macro is defined:
64
65        #define LIBNBD_HAVE_NBD_AIO_OPT_LIST 1
66

SEE ALSO

68       nbd_aio_is_connecting(3), nbd_create(3), nbd_opt_list(3),
69       nbd_set_opt_mode(3), libnbd(3).
70

AUTHORS

72       Eric Blake
73
74       Richard W.M. Jones
75
77       Copyright Red Hat
78

LICENSE

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