1nbd_aio_opt_go(3)                   LIBNBD                   nbd_aio_opt_go(3)
2
3
4

NAME

6       nbd_aio_opt_go - end negotiation and move on to using an export
7

SYNOPSIS

9        #include <libnbd.h>
10
11        typedef struct {
12          int (*callback) (void *user_data, int *error);
13          void *user_data;
14          void (*free) (void *user_data);
15        } nbd_completion_callback;
16
17        int nbd_aio_opt_go (
18              struct nbd_handle *h,
19              nbd_completion_callback completion_callback
20            );
21

DESCRIPTION

23       Request that the server finish negotiation and move on to serving the
24       export previously specified by the most recent nbd_set_export_name(3)
25       or nbd_connect_uri(3).  This can only be used if nbd_set_opt_mode(3)
26       enabled option mode.
27
28       To determine when the request completes, wait for
29       nbd_aio_is_connecting(3) to return false.  Or supply the optional
30       "completion_callback" which will be invoked as described in "Completion
31       callbacks" in libnbd(3), except that it is automatically retired
32       regardless of return value.  Note that directly detecting whether the
33       server returns an error (as is done by the return value of the
34       synchronous counterpart) is only possible with a completion callback;
35       however it is also possible to indirectly detect an error when
36       nbd_aio_is_negotiating(3) returns true.
37

RETURN VALUE

39       If the call is successful the function returns 0.
40

ERRORS

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

HANDLE STATE

51       The handle must be negotiating, otherwise this call will return an
52       error.
53

VERSION

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_GO 1
61

SEE ALSO

63       nbd_aio_is_connecting(3), nbd_aio_is_negotiating(3),
64       nbd_connect_uri(3), nbd_create(3), nbd_opt_go(3),
65       nbd_set_export_name(3), nbd_set_opt_mode(3), libnbd(3).
66

AUTHORS

68       Eric Blake
69
70       Richard W.M. Jones
71
73       Copyright Red Hat
74

LICENSE

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