1nbd_opt_info(3)                     LIBNBD                     nbd_opt_info(3)
2
3
4

NAME

6       nbd_opt_info - request the server for information about an export
7

SYNOPSIS

9        #include <libnbd.h>
10
11        int nbd_opt_info (
12              struct nbd_handle *h
13            );
14

DESCRIPTION

16       Request that the server supply information about the export name
17       previously specified by the most recent nbd_set_export_name(3) or
18       nbd_connect_uri(3).  This can only be used if nbd_set_opt_mode(3)
19       enabled option mode.
20
21       If successful, functions like nbd_is_read_only(3) and nbd_get_size(3)
22       will report details about that export.  If
23       nbd_set_request_meta_context(3) is set (the default) and structured
24       replies were negotiated, it is also valid to use
25       nbd_can_meta_context(3) after this call.  However, it may be more
26       efficient to clear that setting and manually utilize
27       nbd_opt_list_meta_context(3) with its callback approach, for learning
28       which contexts an export supports.  In general, if nbd_opt_go(3) is
29       called next, that call will likely succeed with the details remaining
30       the same, although this is not guaranteed by all servers.
31
32       Not all servers understand this request, and even when it is
33       understood, the server might fail the request even when a corresponding
34       nbd_opt_go(3) would succeed.
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
45       The following parameters must not be NULL: "h".  For more information
46       see "Non-NULL parameters" in libnbd(3).
47

HANDLE STATE

49       The handle must be negotiating, otherwise this call will return an
50       error.
51

VERSION

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

SEE ALSO

61       nbd_aio_opt_info(3), nbd_can_meta_context(3), nbd_connect_uri(3),
62       nbd_create(3), nbd_get_size(3), nbd_is_read_only(3), nbd_opt_go(3),
63       nbd_opt_list_meta_context(3), nbd_set_export_name(3),
64       nbd_set_opt_mode(3), nbd_set_request_meta_context(3), libnbd(3).
65

AUTHORS

67       Eric Blake
68
69       Richard W.M. Jones
70
72       Copyright Red Hat
73

LICENSE

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.16.5                     2023-09-26                   nbd_opt_info(3)
Impressum