1nbd_set_request_extended_headers(3) LIBNBD nbd_set_request_extended_headers(3)
2
3
4
6 nbd_set_request_extended_headers - control use of extended headers
7
9 #include <libnbd.h>
10
11 int nbd_set_request_extended_headers (
12 struct nbd_handle *h, bool request
13 );
14
16 By default, libnbd tries to negotiate extended headers with the server,
17 as this protocol extension permits the use of 64-bit zero, trim, and
18 block status actions. However, for integration testing, it can be
19 useful to clear this flag rather than find a way to alter the server to
20 fail the negotiation request.
21
22 For backwards compatibility, the setting of this knob is ignored if
23 nbd_set_request_structured_replies(3) is also set to false, since the
24 use of extended headers implies structured replies.
25
27 If the call is successful the function returns 0.
28
30 On error -1 is returned.
31
32 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
33 of the error.
34
35 The following parameters must not be NULL: "h". For more information
36 see "Non-NULL parameters" in libnbd(3).
37
39 The handle must be newly created, otherwise this call will return an
40 error.
41
43 This function first appeared in libnbd 1.18.
44
45 If you need to test if this function is available at compile time check
46 if the following macro is defined:
47
48 #define LIBNBD_HAVE_NBD_SET_REQUEST_EXTENDED_HEADERS 1
49
51 nbd_block_status_64(3), nbd_cache(3), nbd_create(3),
52 nbd_get_extended_headers_negotiated(3),
53 nbd_get_request_extended_headers(3), nbd_opt_extended_headers(3),
54 nbd_set_handshake_flags(3), nbd_set_request_structured_replies(3),
55 nbd_set_strict_mode(3), nbd_trim(3), nbd_zero(3), libnbd(3).
56
58 Eric Blake
59
60 Richard W.M. Jones
61
63 Copyright Red Hat
64
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.18.1 2023-10-31nbd_set_request_extended_headers(3)