-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathvddk-stubs.h
144 lines (139 loc) · 4.95 KB
/
vddk-stubs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* nbdkit
* Copyright Red Hat
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Red Hat nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* This header file lists the functions in VDDK that we will try to
* dlsym. It is included in several places in the main plugin, each
* time with STUB and OPTIONAL_STUB macros expanding to different
* things depending on the context.
*
* The three parameters of STUB and OPTIONAL_STUB macros are always:
* function name, return value, arguments.
*/
/* Required stubs, present in all versions of VDDK since 6.5 (Nov 2016). */
STUB (VixDiskLib_InitEx,
VixError,
(uint32_t major, uint32_t minor,
VixDiskLibGenericLogFunc *log_function,
VixDiskLibGenericLogFunc *warn_function,
VixDiskLibGenericLogFunc *panic_function,
const char *lib_dir,
const char *config_file));
STUB (VixDiskLib_Exit,
void,
(void));
STUB (VixDiskLib_GetErrorText,
char *,
(VixError err, const char *unused));
STUB (VixDiskLib_FreeErrorText,
void,
(char *text));
STUB (VixDiskLib_FreeConnectParams,
void,
(VixDiskLibConnectParams *params));
STUB (VixDiskLib_ConnectEx,
VixError,
(const VixDiskLibConnectParams *params,
char read_only,
const char *snapshot_ref,
const char *transport_modes,
VixDiskLibConnection *connection));
STUB (VixDiskLib_Open,
VixError,
(const VixDiskLibConnection connection,
const char *path,
uint32_t flags,
VixDiskLibHandle *handle));
STUB (VixDiskLib_GetTransportMode,
const char *,
(VixDiskLibHandle handle));
STUB (VixDiskLib_Close,
VixError,
(VixDiskLibHandle handle));
STUB (VixDiskLib_Disconnect,
VixError,
(VixDiskLibConnection connection));
STUB (VixDiskLib_GetInfo,
VixError,
(VixDiskLibHandle handle,
VixDiskLibInfo **info));
STUB (VixDiskLib_FreeInfo,
void,
(VixDiskLibInfo *info));
STUB (VixDiskLib_Read,
VixError,
(VixDiskLibHandle handle,
uint64_t start_sector, uint64_t nr_sectors,
unsigned char *buf));
STUB (VixDiskLib_Write,
VixError,
(VixDiskLibHandle handle,
uint64_t start_sector, uint64_t nr_sectors,
const unsigned char *buf));
STUB (VixDiskLib_Create,
VixError,
(const VixDiskLibConnection connection,
const char *path,
const VixDiskLibCreateParams *create_params,
void *progress_function_unused,
void *progress_data_unused));
/* Added in VDDK 6.0. */
STUB (VixDiskLib_Flush,
VixError,
(VixDiskLibHandle handle));
STUB (VixDiskLib_ReadAsync,
VixError,
(VixDiskLibHandle handle,
uint64_t start_sector, uint64_t nr_sectors,
unsigned char *buf,
VixDiskLibCompletionCB callback, void *data));
STUB (VixDiskLib_WriteAsync,
VixError,
(VixDiskLibHandle handle,
uint64_t start_sector, uint64_t nr_sectors,
const unsigned char *buf,
VixDiskLibCompletionCB callback, void *data));
/* Added in VDDK 6.5. */
STUB (VixDiskLib_Wait,
VixError,
(VixDiskLibHandle handle));
/* Added in VDDK 6.7, these will be NULL for earlier versions: */
OPTIONAL_STUB (VixDiskLib_QueryAllocatedBlocks,
VixError,
(VixDiskLibHandle diskHandle,
uint64_t start_sector, uint64_t nr_sectors,
uint64_t chunk_size,
VixDiskLibBlockList **block_list));
OPTIONAL_STUB (VixDiskLib_FreeBlockList,
VixError,
(VixDiskLibBlockList *block_list));
OPTIONAL_STUB (VixDiskLib_AllocateConnectParams,
VixDiskLibConnectParams *,
(void));