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 (struct nbd_handle *h);
12

DESCRIPTION

14       Request that the server supply information about the export name
15       previously specified by the most recent nbd_set_export_name(3) or
16       nbd_connect_uri(3).  This can only be used if nbd_set_opt_mode(3)
17       enabled option mode.
18
19       If successful, functions like nbd_is_read_only(3) and nbd_get_size(3)
20       will report details about that export.  In general, if nbd_opt_go(3) is
21       called next, that call will likely succeed with the details remaining
22       the same, although this is not guaranteed by all servers.
23
24       Not all servers understand this request, and even when it is
25       understood, the server might fail the request even when a corresponding
26       nbd_opt_go(3) would succeed.
27

RETURN VALUE

29       If the call is successful the function returns 0.
30

ERRORS

32       On error "-1" is returned.
33
34       Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
35       of the error.
36
37       The following parameters must not be NULL: "h".  For more information
38       see "Non-NULL parameters" in libnbd(3).
39

HANDLE STATE

41       The handle must be negotiating, otherwise this call will return an
42       error.
43

VERSION

45       This function first appeared in libnbd 1.4.
46
47       If you need to test if this function is available at compile time check
48       if the following macro is defined:
49
50        #define LIBNBD_HAVE_NBD_OPT_INFO 1
51

SEE ALSO

53       nbd_aio_opt_info(3), nbd_connect_uri(3), nbd_create(3),
54       nbd_get_size(3), nbd_is_read_only(3), nbd_opt_go(3),
55       nbd_set_export_name(3), nbd_set_opt_mode(3), libnbd(3).
56

AUTHORS

58       Eric Blake
59
60       Richard W.M. Jones
61
63       Copyright (C) 2019-2021 Red Hat Inc.
64

LICENSE

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