1nbd_aio_block_status(3) LIBNBD nbd_aio_block_status(3)
2
3
4
6 nbd_aio_block_status - send block status command to the NBD server
7
9 #include <libnbd.h>
10
11 typedef struct {
12 int (*callback) (void *user_data,
13 const char *metacontext,
14 uint64_t offset, uint32_t *entries,
15 size_t nr_entries, int *error);
16 void *user_data;
17 void (*free) (void *user_data);
18 } nbd_extent_callback;
19
20 typedef struct {
21 int (*callback) (void *user_data, int *error);
22 void *user_data;
23 void (*free) (void *user_data);
24 } nbd_completion_callback;
25
26 int64_t nbd_aio_block_status (struct nbd_handle *h,
27 uint64_t count,
28 uint64_t offset,
29 nbd_extent_callback extent_callback,
30 nbd_completion_callback completion_callback,
31 uint32_t flags);
32
34 Send the block status command to the NBD server.
35
36 To check if the command completed, call nbd_aio_command_completed(3).
37 Or supply the optional "completion_callback" which will be invoked as
38 described in "Completion callbacks" in libnbd(3).
39
40 Other parameters behave as documented in nbd_block_status(3).
41
42 By default, libnbd will reject attempts to use this function with
43 parameters that are likely to result in server failure, such as
44 requesting an unknown command flag. The nbd_set_strict_mode(3)
45 function can be used to alter which scenarios should await a server
46 reply rather than failing fast.
47
49 This call returns the 64 bit cookie of the command. The cookie is ≥ 1.
50 Cookies are unique (per libnbd handle, not globally).
51
53 On error "-1" is returned.
54
55 Refer to "ERROR HANDLING" in libnbd(3) for how to get further details
56 of the error.
57
59 The handle must be connected with the server, otherwise this call will
60 return an error.
61
63 This function first appeared in libnbd 1.0.
64
65 If you need to test if this function is available at compile time check
66 if the following macro is defined:
67
68 #define LIBNBD_HAVE_NBD_AIO_BLOCK_STATUS 1
69
71 nbd_aio_command_completed(3), nbd_block_status(3),
72 nbd_can_meta_context(3), nbd_create(3), nbd_set_strict_mode(3),
73 "Issuing asynchronous commands" in libnbd(3), libnbd(3).
74
76 Eric Blake
77
78 Richard W.M. Jones
79
81 Copyright (C) 2019-2021 Red Hat Inc.
82
84 This library is free software; you can redistribute it and/or modify it
85 under the terms of the GNU Lesser General Public License as published
86 by the Free Software Foundation; either version 2 of the License, or
87 (at your option) any later version.
88
89 This library is distributed in the hope that it will be useful, but
90 WITHOUT ANY WARRANTY; without even the implied warranty of
91 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
92 Lesser General Public License for more details.
93
94 You should have received a copy of the GNU Lesser General Public
95 License along with this library; if not, write to the Free Software
96 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
97 02110-1301 USA
98
99
100
101libnbd-1.7.12 2021-05-29 nbd_aio_block_status(3)