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 (struct nbd_handle *h,
18                            nbd_completion_callback completion_callback);
19

DESCRIPTION

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

RETURN VALUE

37       If the call is successful the function returns 0.
38

ERRORS

40       On error "-1" is returned.
41
42       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
43       of the error.
44

HANDLE STATE

46       The handle must be negotiating, otherwise this call will return an
47       error.
48

VERSION

50       This function first appeared in libnbd 1.4.
51
52       If you need to test if this function is available at compile time check
53       if the following macro is defined:
54
55        #define LIBNBD_HAVE_NBD_AIO_OPT_GO 1
56

SEE ALSO

58       nbd_aio_is_connecting(3), nbd_aio_is_negotiating(3),
59       nbd_connect_uri(3), nbd_create(3), nbd_opt_go(3),
60       nbd_set_export_name(3), nbd_set_opt_mode(3), libnbd(3).
61

AUTHORS

63       Eric Blake
64
65       Richard W.M. Jones
66
68       Copyright (C) 2019-2021 Red Hat Inc.
69

LICENSE

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