Line data Source code
1 190 : GQuark bd_lvm_error_quark (void) {
2 190 : return g_quark_from_static_string ("g-bd-lvm-error-quark");
3 : }
4 :
5 : /**
6 : * BDLVMPVdata:
7 : * @pv_name: name of the PV
8 : * @pv_uuid: UUID of the PV
9 : * @pv_free: size of the free space in the PV
10 : * @pv_size: size of the PV
11 : * @pe_start: start of the physical extents area (i.e. offset of the first PE)
12 : * @vg_name: name of the VG the PV belongs to
13 : * @vg_uuid: UUID of the VG the PV belongs to
14 : * @vg_size: size of the VG the PV belongs to
15 : * @vg_free: size of the free space in the PV's VG
16 : * @vg_extent_size: extent size used by the PV's VG
17 : * @vg_extent_count: number of extents in the PV's VG
18 : * @vg_free_count: number of free extents in the PV's VG
19 : * @vg_pv_count: number of PVs that belong to this PV's VG
20 : * @pv_tags: (array zero-terminated=1): list of LVM tags for this PV
21 : * @missing: whether this PV is missing from the system or not
22 : */
23 : /**
24 : * bd_lvm_pvdata_copy: (skip)
25 : * @data: (nullable): %BDLVMPVdata to copy
26 : *
27 : * Creates a new copy of @data.
28 : */
29 0 : BDLVMPVdata* bd_lvm_pvdata_copy (BDLVMPVdata *data) {
30 0 : if (data == NULL)
31 0 : return NULL;
32 :
33 0 : BDLVMPVdata *new_data = g_new0 (BDLVMPVdata, 1);
34 :
35 0 : new_data->pv_name = g_strdup (data->pv_name);
36 0 : new_data->pv_uuid = g_strdup (data->pv_uuid);
37 0 : new_data->pv_free = data->pv_free;
38 0 : new_data->pv_size = data->pv_size;
39 0 : new_data->pe_start = data->pe_start;
40 0 : new_data->vg_name = g_strdup (data->vg_name);
41 0 : new_data->vg_uuid = g_strdup (data->vg_uuid);
42 0 : new_data->vg_size = data->vg_size;
43 0 : new_data->vg_free = data->vg_free;
44 0 : new_data->vg_extent_size = data->vg_extent_size;
45 0 : new_data->vg_extent_count = data->vg_extent_count;
46 0 : new_data->vg_free_count = data->vg_free_count;
47 0 : new_data->vg_pv_count = data->vg_pv_count;
48 0 : new_data->pv_tags = g_strdupv (data->pv_tags);
49 0 : new_data->missing = data->missing;
50 :
51 0 : return new_data;
52 : }
53 :
54 : /**
55 : * bd_lvm_pvdata_free: (skip)
56 : * @data: (nullable): %BDLVMPVdata to free
57 : *
58 : * Frees @data.
59 : */
60 27 : void bd_lvm_pvdata_free (BDLVMPVdata *data) {
61 27 : if (data == NULL)
62 0 : return;
63 :
64 27 : g_free (data->pv_name);
65 27 : g_free (data->pv_uuid);
66 27 : g_free (data->vg_name);
67 27 : g_free (data->vg_uuid);
68 27 : g_strfreev (data->pv_tags);
69 27 : g_free (data);
70 : }
71 :
72 36 : GType bd_lvm_pvdata_get_type () {
73 : static GType type = 0;
74 :
75 36 : if (G_UNLIKELY(type == 0)) {
76 1 : type = g_boxed_type_register_static("BDLVMPVdata",
77 : (GBoxedCopyFunc) bd_lvm_pvdata_copy,
78 : (GBoxedFreeFunc) bd_lvm_pvdata_free);
79 : }
80 :
81 36 : return type;
82 : }
83 :
84 : /**
85 : * BDLVMVGdata:
86 : * @name: name of the VG
87 : * @uuid: UUID of the VG
88 : * @size: size of the VG
89 : * @free: size of the free space in the VG
90 : * @extent_size: extent size used by the VG
91 : * @extent_count: number of extents in the VG
92 : * @free_count: number of free extents in the VG
93 : * @pv_count: number of PVs that belong to the VG
94 : * @exported: whether the VG is exported or not
95 : * @vg_tags: (array zero-terminated=1): list of LVM tags for this VG
96 : */
97 : /**
98 : * bd_lvm_vgdata_copy: (skip)
99 : * @data: (nullable): %BDLVMVGdata to copy
100 : *
101 : * Creates a new copy of @data.
102 : */
103 0 : BDLVMVGdata* bd_lvm_vgdata_copy (BDLVMVGdata *data) {
104 0 : if (data == NULL)
105 0 : return NULL;
106 :
107 0 : BDLVMVGdata *new_data = g_new0 (BDLVMVGdata, 1);
108 :
109 0 : new_data->name = g_strdup (data->name);
110 0 : new_data->uuid = g_strdup (data->uuid);
111 0 : new_data->size = data->size;
112 0 : new_data->free = data->free;
113 0 : new_data->extent_size = data->extent_size;
114 0 : new_data->extent_count = data->extent_count;
115 0 : new_data->free_count = data->free_count;
116 0 : new_data->pv_count = data->pv_count;
117 0 : new_data->exported = data->exported;
118 0 : new_data->vg_tags = g_strdupv (data->vg_tags);
119 :
120 0 : return new_data;
121 : }
122 :
123 : /**
124 : * bd_lvm_vgdata_free: (skip)
125 : * @data: (nullable): %BDLVMVGdata to free
126 : *
127 : * Frees @data.
128 : */
129 14 : void bd_lvm_vgdata_free (BDLVMVGdata *data) {
130 14 : if (data == NULL)
131 0 : return;
132 :
133 14 : g_free (data->name);
134 14 : g_free (data->uuid);
135 14 : g_strfreev (data->vg_tags);
136 14 : g_free (data);
137 : }
138 :
139 32 : GType bd_lvm_vgdata_get_type () {
140 : static GType type = 0;
141 :
142 32 : if (G_UNLIKELY(type == 0)) {
143 1 : type = g_boxed_type_register_static("BDLVMVGdata",
144 : (GBoxedCopyFunc) bd_lvm_vgdata_copy,
145 : (GBoxedFreeFunc) bd_lvm_vgdata_free);
146 : }
147 :
148 32 : return type;
149 : }
150 :
151 : /**
152 : * BDLVMSEGdata:
153 : * @size_pe: Size of this segment in extents
154 : * @pv_start_pe: Where it starts in the physical volume in extents
155 : * @pvdev: Device name of the physical volume or NULL
156 : */
157 : /**
158 : * bd_lvm_segdata_copy: (skip)
159 : * @data: (nullable): %BDLVMSEGdata to copy
160 : *
161 : * Creates a new copy of @data.
162 : */
163 48 : BDLVMSEGdata* bd_lvm_segdata_copy (BDLVMSEGdata *data) {
164 48 : if (data == NULL)
165 0 : return NULL;
166 :
167 48 : BDLVMSEGdata *new_data = g_new0 (BDLVMSEGdata, 1);
168 :
169 48 : new_data->size_pe = data->size_pe;
170 48 : new_data->pv_start_pe = data->pv_start_pe;
171 48 : new_data->pvdev = g_strdup (data->pvdev);
172 48 : return new_data;
173 : }
174 :
175 : /**
176 : * bd_lvm_segdata_free: (skip)
177 : * @data: (nullable): %BDLVMSEGdata to free
178 : *
179 : * Frees @data.
180 : */
181 66 : void bd_lvm_segdata_free (BDLVMSEGdata *data) {
182 66 : if (data == NULL)
183 0 : return;
184 :
185 66 : g_free (data->pvdev);
186 66 : g_free (data);
187 : }
188 :
189 72 : GType bd_lvm_segdata_get_type () {
190 : static GType type = 0;
191 :
192 72 : if (G_UNLIKELY(type == 0)) {
193 1 : type = g_boxed_type_register_static("BDLVMSEGdata",
194 : (GBoxedCopyFunc) bd_lvm_segdata_copy,
195 : (GBoxedFreeFunc) bd_lvm_segdata_free) ;
196 : }
197 :
198 72 : return type;
199 : }
200 :
201 : /**
202 : * BDLVMLVdata:
203 : * @lv_name: name of the LV
204 : * @vg_name: name of the VG the LV belongs to
205 : * @uuid: UUID of the LV
206 : * @size: size of the LV
207 : * @attr: attributes of the LV
208 : * @segtype: segment type of the LV
209 : * @origin: origin of the LV (for snapshots, etc.)
210 : * @pool_lv: pool LV of the LV (for thin and cached LVs)
211 : * @data_lv: data LV of the LV (for thin and cache pools)
212 : * @metadata_lv: metadata LV of the LV (for thin and cache pools)
213 : * @roles: comma separated list of this LV's roles
214 : * @move_pv: source physical volume of a temporary logical volume created with the pvmove command
215 : * @data_percent: available data space in a thin pool
216 : * @metadata_percent: available metadata space in a thin pool
217 : * @copy_percent: synchronization percentage of a mirrored logical volume
218 : * @lv_tags: (array zero-terminated=1): list of LVM tags for this LV
219 : * @data_lvs: (nullable) (array zero-terminated=1): list of data sub-LVs this LV (for raids, etc).
220 : * @metadata_lvs: (nullable) (array zero-terminated=1): list of metadata sub-LVS for this LV (for raids, etc).
221 : * @segs: (nullable) (array zero-terminated=1): The segments of this LV.
222 : *
223 : * The @segs, @data_lvs, and @metadata_lvs fields are only filled by a
224 : * call to bd_lvm_lvinfo_tree or bd_lvm_lvs_tree. They are all NULL
225 : * normally. If they are filled, they follow these rules:
226 : *
227 : * A LV is either stored directly on physical volumes, or is made up
228 : * of sub-LVs. If it is stored on PVs, the @segs list is non-empty
229 : * and the @data_lvs and @metadata_lvs fields are both NULL. If it is
230 : * made up of sub-LVs, then @segs is NULL, @data_lvs is non-empty and
231 : * @metadata_lvs might or might not be empty but is non-NULL. The
232 : * sub-LVs contained in @data_lv and @metadata_lv are always included
233 : * in @data_lvs and @metadata_lvs, respectively.
234 : *
235 : * For a partial LV, the @segs list might not be complete; i.e., the
236 : * sum of the sizes of the listed segments might not be equal to the
237 : * size reported for the LV itself.
238 : *
239 : * Also, the order of entries in @segs must be assumed to be random;
240 : * it does not correspond to the order of segments in the logical
241 : * volume itself.
242 : */
243 : /**
244 : * bd_lvm_lvdata_copy: (skip)
245 : * @data: (nullable): %BDLVMLVdata to copy
246 : *
247 : * Creates a new copy of @data.
248 : */
249 0 : BDLVMLVdata* bd_lvm_lvdata_copy (BDLVMLVdata *data) {
250 0 : if (data == NULL)
251 0 : return NULL;
252 :
253 0 : BDLVMLVdata *new_data = g_new0 (BDLVMLVdata, 1);
254 :
255 0 : new_data->lv_name = g_strdup (data->lv_name);
256 0 : new_data->vg_name = g_strdup (data->vg_name);
257 0 : new_data->uuid = g_strdup (data->uuid);
258 0 : new_data->size = data->size;
259 0 : new_data->attr = g_strdup (data->attr);
260 0 : new_data->segtype = g_strdup (data->segtype);
261 0 : new_data->origin = g_strdup (data->origin);
262 0 : new_data->pool_lv = g_strdup (data->pool_lv);
263 0 : new_data->data_lv = g_strdup (data->data_lv);
264 0 : new_data->metadata_lv = g_strdup (data->metadata_lv);
265 0 : new_data->roles = g_strdup (data->roles);
266 0 : new_data->move_pv = g_strdup (data->move_pv);
267 0 : new_data->data_percent = data->data_percent;
268 0 : new_data->metadata_percent = data->metadata_percent;
269 0 : new_data->copy_percent = data->copy_percent;
270 0 : new_data->lv_tags = g_strdupv (data->lv_tags);
271 0 : new_data->data_lvs = g_strdupv (data->data_lvs);
272 0 : new_data->metadata_lvs = g_strdupv (data->metadata_lvs);
273 0 : new_data->segs = copy_segs (data->segs);
274 0 : return new_data;
275 : }
276 :
277 : /**
278 : * bd_lvm_lvdata_free: (skip)
279 : * @data: (nullable): %BDLVMLVdata to free
280 : *
281 : * Frees @data.
282 : */
283 149 : void bd_lvm_lvdata_free (BDLVMLVdata *data) {
284 149 : if (data == NULL)
285 0 : return;
286 :
287 149 : g_free (data->lv_name);
288 149 : g_free (data->vg_name);
289 149 : g_free (data->uuid);
290 149 : g_free (data->attr);
291 149 : g_free (data->segtype);
292 149 : g_free (data->origin);
293 149 : g_free (data->pool_lv);
294 149 : g_free (data->data_lv);
295 149 : g_free (data->metadata_lv);
296 149 : g_free (data->roles);
297 149 : g_free (data->move_pv);
298 149 : g_strfreev (data->lv_tags);
299 149 : g_strfreev (data->data_lvs);
300 149 : g_strfreev (data->metadata_lvs);
301 149 : free_segs (data->segs);
302 149 : g_free (data);
303 : }
304 :
305 298 : GType bd_lvm_lvdata_get_type () {
306 : static GType type = 0;
307 :
308 298 : if (G_UNLIKELY(type == 0)) {
309 1 : type = g_boxed_type_register_static("BDLVMLVdata",
310 : (GBoxedCopyFunc) bd_lvm_lvdata_copy,
311 : (GBoxedFreeFunc) bd_lvm_lvdata_free);
312 : }
313 :
314 298 : return type;
315 : }
316 :
317 : /**
318 : * BDLVMVDOPooldata:
319 : * @operating_mode: operating mode of the VDO pool (e.g. %BD_LVM_VDO_MODE_NORMAL)
320 : * @compression_state: state of the compression
321 : * @index_state: state of the VDO index
322 : * @write_policy: write policy of the VDO LV
323 : * @used_size: currently used space
324 : * @saving_percent: percentage of physical blocks saved
325 : * @index_memory_size: index memory size of the VDO volume
326 : * @deduplication: whether deduplication is enabled
327 : * @compression: whether compression is enabled
328 : */
329 : /**
330 : * bd_lvm_vdopooldata_copy: (skip)
331 : * @data: (nullable): %BDLVMVDOPooldata to copy
332 : *
333 : * Creates a new copy of @data.
334 : */
335 0 : BDLVMVDOPooldata* bd_lvm_vdopooldata_copy (BDLVMVDOPooldata *data) {
336 0 : if (data == NULL)
337 0 : return NULL;
338 :
339 0 : BDLVMVDOPooldata *new_data = g_new0 (BDLVMVDOPooldata, 1);
340 :
341 0 : new_data->operating_mode = data->operating_mode;
342 0 : new_data->compression_state = data->compression_state;
343 0 : new_data->index_state = data->index_state;
344 0 : new_data->write_policy = data->write_policy;
345 0 : new_data->used_size = data->used_size;
346 0 : new_data->saving_percent = data->saving_percent;
347 0 : new_data->index_memory_size = data->index_memory_size;
348 0 : new_data->deduplication = data->deduplication;
349 0 : new_data->compression = data->compression;
350 0 : return new_data;
351 : }
352 :
353 : /**
354 : * bd_lvm_vdopooldata_free: (skip)
355 : * @data: (nullable): %BDLVMVDOPooldata to free
356 : *
357 : * Frees @data.
358 : */
359 19 : void bd_lvm_vdopooldata_free (BDLVMVDOPooldata *data) {
360 19 : if (data == NULL)
361 0 : return;
362 :
363 19 : g_free (data);
364 : }
365 :
366 50 : GType bd_lvm_vdopooldata_get_type () {
367 : static GType type = 0;
368 :
369 50 : if (G_UNLIKELY(type == 0)) {
370 1 : type = g_boxed_type_register_static("BDLVMVDOPooldata",
371 : (GBoxedCopyFunc) bd_lvm_vdopooldata_copy,
372 : (GBoxedFreeFunc) bd_lvm_vdopooldata_free);
373 : }
374 :
375 50 : return type;
376 : }
377 :
378 : /**
379 : * BDLVMVDOStats:
380 : * @block_size: The block size of a VDO volume, in bytes.
381 : * @logical_block_size: The logical block size, in bytes.
382 : * @physical_blocks: The total number of physical blocks allocated for a VDO volume.
383 : * @data_blocks_used: The number of physical blocks currently in use by a VDO volume
384 : * to store data.
385 : * @overhead_blocks_used: The number of physical blocks currently in use by a VDO volume
386 : * to store VDO metadata.
387 : * @logical_blocks_used: The number of logical blocks currently mapped.
388 : * @used_percent: The percentage of physical blocks used on a VDO volume
389 : * (= used blocks / allocated blocks * 100).
390 : * @saving_percent: The percentage of physical blocks saved on a VDO volume
391 : * (= [logical blocks used - physical blocks used] / logical blocks used).
392 : * @write_amplification_ratio: The average number of block writes to the underlying storage
393 : * per block written to the VDO device.
394 : */
395 : /**
396 : * bd_lvm_vdo_stats_copy: (skip)
397 : * @stats: (nullable): %BDLVMVDOStats to copy
398 : *
399 : * Creates a new copy of @stats.
400 : */
401 0 : BDLVMVDOStats* bd_lvm_vdo_stats_copy (BDLVMVDOStats *stats) {
402 0 : if (stats == NULL)
403 0 : return NULL;
404 :
405 0 : BDLVMVDOStats *new_stats = g_new0 (BDLVMVDOStats, 1);
406 :
407 0 : new_stats->block_size = stats->block_size;
408 0 : new_stats->logical_block_size = stats->logical_block_size;
409 0 : new_stats->physical_blocks = stats->physical_blocks;
410 0 : new_stats->data_blocks_used = stats->data_blocks_used;
411 0 : new_stats->overhead_blocks_used = stats->overhead_blocks_used;
412 0 : new_stats->logical_blocks_used = stats->logical_blocks_used;
413 0 : new_stats->used_percent = stats->used_percent;
414 0 : new_stats->saving_percent = stats->saving_percent;
415 0 : new_stats->write_amplification_ratio = stats->write_amplification_ratio;
416 0 : return new_stats;
417 : }
418 :
419 : /**
420 : * bd_lvm_vdo_stats_free: (skip)
421 : * @stats: (nullable): %BDLVMVDOStats to free
422 : *
423 : * Frees @stats.
424 : */
425 2 : void bd_lvm_vdo_stats_free (BDLVMVDOStats *stats) {
426 2 : if (stats == NULL)
427 0 : return;
428 :
429 2 : g_free (stats);
430 : }
431 :
432 21 : GType bd_lvm_vdo_stats_get_type () {
433 : static GType type = 0;
434 :
435 21 : if (G_UNLIKELY(type == 0)) {
436 1 : type = g_boxed_type_register_static("BDLVMVDOStats",
437 : (GBoxedCopyFunc) bd_lvm_vdo_stats_copy,
438 : (GBoxedFreeFunc) bd_lvm_vdo_stats_free);
439 : }
440 :
441 21 : return type;
442 : }
443 :
444 : /**
445 : * BDLVMCacheStats:
446 : * @block_size: block size used by the cache
447 : * @cache_size: size of the cache
448 : * @cache_used: size of the used space in the cache
449 : * @md_block_size: block size used for cache metadata
450 : * @md_size: size of the metadata space of the cache
451 : * @md_used: size of the used metadata space in the cache
452 : * @read_hits: number of read hits
453 : * @read_misses: number of read misses
454 : * @write_hits: number of write hits
455 : * @write_misses: number of write misses
456 : * @mode: mode the cache is operating in
457 : */
458 : /**
459 : * bd_lvm_cache_stats_copy: (skip)
460 : * @data: (nullable): %BDLVMCacheStats to copy
461 : *
462 : * Creates a new copy of @data.
463 : */
464 0 : BDLVMCacheStats* bd_lvm_cache_stats_copy (BDLVMCacheStats *data) {
465 0 : if (data == NULL)
466 0 : return NULL;
467 :
468 0 : BDLVMCacheStats *new = g_new0 (BDLVMCacheStats, 1);
469 :
470 0 : new->block_size = data->block_size;
471 0 : new->cache_size = data->cache_size;
472 0 : new->cache_used = data->cache_used;
473 0 : new->md_block_size = data->md_block_size;
474 0 : new->md_size = data->md_size;
475 0 : new->md_used = data->md_used;
476 0 : new->read_hits = data->read_hits;
477 0 : new->read_misses = data->read_misses;
478 0 : new->write_hits = data->write_hits;
479 0 : new->write_misses = data->write_misses;
480 0 : new->mode = data->mode;
481 :
482 0 : return new;
483 : }
484 :
485 : /**
486 : * bd_lvm_cache_stats_free: (skip)
487 : * @data: (nullable): %BDLVMCacheStats to free
488 : *
489 : * Frees @data.
490 : */
491 6 : void bd_lvm_cache_stats_free (BDLVMLVdata *data) {
492 6 : g_free (data);
493 6 : }
494 :
495 21 : GType bd_lvm_cache_stats_get_type () {
496 : static GType type = 0;
497 :
498 21 : if (G_UNLIKELY(type == 0)) {
499 1 : type = g_boxed_type_register_static("BDLVMCacheStats",
500 : (GBoxedCopyFunc) bd_lvm_cache_stats_copy,
501 : (GBoxedFreeFunc) bd_lvm_cache_stats_free);
502 : }
503 :
504 21 : return type;
505 : }
506 :
507 0 : static gboolean bd_lvm_is_tech_avail_stub (BDLVMTech tech G_GNUC_UNUSED, guint64 mode G_GNUC_UNUSED, GError **error) {
508 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_is_tech_avail' called, but not implemented!");
509 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
510 : "The function 'bd_lvm_is_tech_avail' called, but not implemented!");
511 0 : return FALSE;
512 : }
513 :
514 : static gboolean (*_bd_lvm_is_tech_avail) (BDLVMTech tech, guint64 mode, GError **error) = bd_lvm_is_tech_avail_stub;
515 :
516 : /**
517 : * bd_lvm_is_tech_avail:
518 : * @tech: the queried tech
519 : * @mode: a bit mask of queried modes of operation (#BDLVMTechMode) for @tech
520 : * @error: (out) (optional): place to store error (details about why the @tech-@mode combination is not available)
521 : *
522 : * Returns: whether the @tech-@mode combination is available -- supported by the
523 : * plugin implementation and having all the runtime dependencies available
524 : */
525 314 : gboolean bd_lvm_is_tech_avail (BDLVMTech tech, guint64 mode, GError **error) {
526 314 : return _bd_lvm_is_tech_avail (tech, mode, error);
527 : }
528 :
529 :
530 0 : static gboolean bd_lvm_is_supported_pe_size_stub (guint64 size G_GNUC_UNUSED, GError **error) {
531 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_is_supported_pe_size' called, but not implemented!");
532 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
533 : "The function 'bd_lvm_is_supported_pe_size' called, but not implemented!");
534 0 : return FALSE;
535 : }
536 :
537 : static gboolean (*_bd_lvm_is_supported_pe_size) (guint64 size, GError **error) = bd_lvm_is_supported_pe_size_stub;
538 :
539 : /**
540 : * bd_lvm_is_supported_pe_size:
541 : * @size: size (in bytes) to test
542 : * @error: (out) (optional): place to store error (if any)
543 : *
544 : * Returns: whether the given size is supported physical extent size or not
545 : *
546 : * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored)
547 : */
548 71 : gboolean bd_lvm_is_supported_pe_size (guint64 size, GError **error) {
549 71 : return _bd_lvm_is_supported_pe_size (size, error);
550 : }
551 :
552 :
553 0 : static guint64 * bd_lvm_get_supported_pe_sizes_stub (GError **error) {
554 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_supported_pe_sizes' called, but not implemented!");
555 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
556 : "The function 'bd_lvm_get_supported_pe_sizes' called, but not implemented!");
557 0 : return 0;
558 : }
559 :
560 : static guint64 * (*_bd_lvm_get_supported_pe_sizes) (GError **error) = bd_lvm_get_supported_pe_sizes_stub;
561 :
562 : /**
563 : * bd_lvm_get_supported_pe_sizes:
564 : * @error: (out) (optional): place to store error (if any)
565 : *
566 : * Returns: (transfer full) (array fixed-size=25): list of supported PE sizes
567 : *
568 : * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored)
569 : */
570 2 : guint64 * bd_lvm_get_supported_pe_sizes (GError **error) {
571 2 : return _bd_lvm_get_supported_pe_sizes (error);
572 : }
573 :
574 :
575 0 : static guint64 bd_lvm_get_max_lv_size_stub (GError **error) {
576 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_max_lv_size' called, but not implemented!");
577 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
578 : "The function 'bd_lvm_get_max_lv_size' called, but not implemented!");
579 0 : return 0;
580 : }
581 :
582 : static guint64 (*_bd_lvm_get_max_lv_size) (GError **error) = bd_lvm_get_max_lv_size_stub;
583 :
584 : /**
585 : * bd_lvm_get_max_lv_size:
586 : * @error: (out) (optional): place to store error (if any)
587 : *
588 : * Returns: maximum LV size in bytes
589 : *
590 : * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored)
591 : */
592 13 : guint64 bd_lvm_get_max_lv_size (GError **error) {
593 13 : return _bd_lvm_get_max_lv_size (error);
594 : }
595 :
596 :
597 0 : static guint64 bd_lvm_round_size_to_pe_stub (guint64 size G_GNUC_UNUSED, guint64 pe_size G_GNUC_UNUSED, gboolean roundup G_GNUC_UNUSED, GError **error) {
598 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_round_size_to_pe' called, but not implemented!");
599 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
600 : "The function 'bd_lvm_round_size_to_pe' called, but not implemented!");
601 0 : return 0;
602 : }
603 :
604 : static guint64 (*_bd_lvm_round_size_to_pe) (guint64 size, guint64 pe_size, gboolean roundup, GError **error) = bd_lvm_round_size_to_pe_stub;
605 :
606 : /**
607 : * bd_lvm_round_size_to_pe:
608 : * @size: size to be rounded
609 : * @pe_size: physical extent (PE) size or 0 to use the default
610 : * @roundup: whether to round up or down (ceil or floor)
611 : * @error: (out) (optional): place to store error (if any)
612 : *
613 : * Returns: @size rounded to @pe_size according to the @roundup
614 : *
615 : * Rounds given @size up/down to a multiple of @pe_size according to the value
616 : * of the @roundup parameter. If the rounded value is too big to fit in the
617 : * return type, the result is rounded down (floored) regardless of the @roundup
618 : * parameter.
619 : *
620 : * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored)
621 : */
622 47 : guint64 bd_lvm_round_size_to_pe (guint64 size, guint64 pe_size, gboolean roundup, GError **error) {
623 47 : return _bd_lvm_round_size_to_pe (size, pe_size, roundup, error);
624 : }
625 :
626 :
627 0 : static guint64 bd_lvm_get_lv_physical_size_stub (guint64 lv_size G_GNUC_UNUSED, guint64 pe_size G_GNUC_UNUSED, GError **error) {
628 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_lv_physical_size' called, but not implemented!");
629 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
630 : "The function 'bd_lvm_get_lv_physical_size' called, but not implemented!");
631 0 : return 0;
632 : }
633 :
634 : static guint64 (*_bd_lvm_get_lv_physical_size) (guint64 lv_size, guint64 pe_size, GError **error) = bd_lvm_get_lv_physical_size_stub;
635 :
636 : /**
637 : * bd_lvm_get_lv_physical_size:
638 : * @lv_size: LV size
639 : * @pe_size: PE size
640 : * @error: (out) (optional): place to store error (if any)
641 : *
642 : * Returns: space taken on disk(s) by the LV with given @size
643 : *
644 : * Gives number of bytes needed for an LV with the size @lv_size on an LVM stack
645 : * using given @pe_size.
646 : *
647 : * Tech category: %BD_LVM_TECH_CALCS no mode (it is ignored)
648 : */
649 6 : guint64 bd_lvm_get_lv_physical_size (guint64 lv_size, guint64 pe_size, GError **error) {
650 6 : return _bd_lvm_get_lv_physical_size (lv_size, pe_size, error);
651 : }
652 :
653 :
654 0 : static guint64 bd_lvm_get_thpool_padding_stub (guint64 size G_GNUC_UNUSED, guint64 pe_size G_GNUC_UNUSED, gboolean included G_GNUC_UNUSED, GError **error) {
655 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_thpool_padding' called, but not implemented!");
656 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
657 : "The function 'bd_lvm_get_thpool_padding' called, but not implemented!");
658 0 : return 0;
659 : }
660 :
661 : static guint64 (*_bd_lvm_get_thpool_padding) (guint64 size, guint64 pe_size, gboolean included, GError **error) = bd_lvm_get_thpool_padding_stub;
662 :
663 : /**
664 : * bd_lvm_get_thpool_padding:
665 : * @size: size of the thin pool
666 : * @pe_size: PE size or 0 if the default value should be used
667 : * @included: if padding is already included in the size
668 : * @error: (out) (optional): place to store error (if any)
669 : *
670 : * Returns: size of the padding needed for a thin pool with the given @size
671 : * according to the @pe_size and @included
672 : *
673 : * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored)
674 : */
675 5 : guint64 bd_lvm_get_thpool_padding (guint64 size, guint64 pe_size, gboolean included, GError **error) {
676 5 : return _bd_lvm_get_thpool_padding (size, pe_size, included, error);
677 : }
678 :
679 :
680 0 : static guint64 bd_lvm_get_thpool_meta_size_stub (guint64 size G_GNUC_UNUSED, guint64 chunk_size G_GNUC_UNUSED, guint64 n_snapshots G_GNUC_UNUSED, GError **error) {
681 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_thpool_meta_size' called, but not implemented!");
682 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
683 : "The function 'bd_lvm_get_thpool_meta_size' called, but not implemented!");
684 0 : return 0;
685 : }
686 :
687 : static guint64 (*_bd_lvm_get_thpool_meta_size) (guint64 size, guint64 chunk_size, guint64 n_snapshots, GError **error) = bd_lvm_get_thpool_meta_size_stub;
688 :
689 : /**
690 : * bd_lvm_get_thpool_meta_size:
691 : * @size: size of the thin pool
692 : * @chunk_size: chunk size of the thin pool or 0 to use the default
693 : * @n_snapshots: ignored
694 : * @error: (out) (optional): place to store error (if any)
695 : *
696 : * Note: This function will be changed in 3.0: the @n_snapshots parameter
697 : * is currently not used and will be removed.
698 : *
699 : * Returns: recommended size of the metadata space for the specified pool
700 : *
701 : * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored)
702 : */
703 6 : guint64 bd_lvm_get_thpool_meta_size (guint64 size, guint64 chunk_size, guint64 n_snapshots, GError **error) {
704 6 : return _bd_lvm_get_thpool_meta_size (size, chunk_size, n_snapshots, error);
705 : }
706 :
707 :
708 0 : static gboolean bd_lvm_is_valid_thpool_md_size_stub (guint64 size G_GNUC_UNUSED, GError **error) {
709 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_is_valid_thpool_md_size' called, but not implemented!");
710 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
711 : "The function 'bd_lvm_is_valid_thpool_md_size' called, but not implemented!");
712 0 : return FALSE;
713 : }
714 :
715 : static gboolean (*_bd_lvm_is_valid_thpool_md_size) (guint64 size, GError **error) = bd_lvm_is_valid_thpool_md_size_stub;
716 :
717 : /**
718 : * bd_lvm_is_valid_thpool_md_size:
719 : * @size: the size to be tested
720 : * @error: (out) (optional): place to store error (if any)
721 : *
722 : * Returns: whether the given size is a valid thin pool metadata size or not
723 : *
724 : * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored)
725 : */
726 14 : gboolean bd_lvm_is_valid_thpool_md_size (guint64 size, GError **error) {
727 14 : return _bd_lvm_is_valid_thpool_md_size (size, error);
728 : }
729 :
730 :
731 0 : static gboolean bd_lvm_is_valid_thpool_chunk_size_stub (guint64 size G_GNUC_UNUSED, gboolean discard G_GNUC_UNUSED, GError **error) {
732 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_is_valid_thpool_chunk_size' called, but not implemented!");
733 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
734 : "The function 'bd_lvm_is_valid_thpool_chunk_size' called, but not implemented!");
735 0 : return FALSE;
736 : }
737 :
738 : static gboolean (*_bd_lvm_is_valid_thpool_chunk_size) (guint64 size, gboolean discard, GError **error) = bd_lvm_is_valid_thpool_chunk_size_stub;
739 :
740 : /**
741 : * bd_lvm_is_valid_thpool_chunk_size:
742 : * @size: the size to be tested
743 : * @discard: whether discard/TRIM is required to be supported or not
744 : * @error: (out) (optional): place to store error (if any)
745 : *
746 : * Returns: whether the given size is a valid thin pool chunk size or not
747 : *
748 : * Tech category: %BD_LVM_TECH_THIN_CALCS no mode (it is ignored)
749 : */
750 12 : gboolean bd_lvm_is_valid_thpool_chunk_size (guint64 size, gboolean discard, GError **error) {
751 12 : return _bd_lvm_is_valid_thpool_chunk_size (size, discard, error);
752 : }
753 :
754 :
755 0 : static gboolean bd_lvm_pvcreate_stub (const gchar *device G_GNUC_UNUSED, guint64 data_alignment G_GNUC_UNUSED, guint64 metadata_size G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
756 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_pvcreate' called, but not implemented!");
757 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
758 : "The function 'bd_lvm_pvcreate' called, but not implemented!");
759 0 : return FALSE;
760 : }
761 :
762 : static gboolean (*_bd_lvm_pvcreate) (const gchar *device, guint64 data_alignment, guint64 metadata_size, const BDExtraArg **extra, GError **error) = bd_lvm_pvcreate_stub;
763 :
764 : /**
765 : * bd_lvm_pvcreate:
766 : * @device: the device to make PV from
767 : * @data_alignment: data (first PE) alignment or 0 to use the default
768 : * @metadata_size: size of the area reserved for metadata or 0 to use the default
769 : * @extra: (nullable) (array zero-terminated=1): extra options for the PV creation
770 : * (just passed to LVM as is)
771 : * @error: (out) (optional): place to store error (if any)
772 : *
773 : * Returns: whether the PV was successfully created or not
774 : *
775 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_CREATE
776 : */
777 159 : gboolean bd_lvm_pvcreate (const gchar *device, guint64 data_alignment, guint64 metadata_size, const BDExtraArg **extra, GError **error) {
778 159 : return _bd_lvm_pvcreate (device, data_alignment, metadata_size, extra, error);
779 : }
780 :
781 :
782 0 : static gboolean bd_lvm_pvresize_stub (const gchar *device G_GNUC_UNUSED, guint64 size G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
783 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_pvresize' called, but not implemented!");
784 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
785 : "The function 'bd_lvm_pvresize' called, but not implemented!");
786 0 : return FALSE;
787 : }
788 :
789 : static gboolean (*_bd_lvm_pvresize) (const gchar *device, guint64 size, const BDExtraArg **extra, GError **error) = bd_lvm_pvresize_stub;
790 :
791 : /**
792 : * bd_lvm_pvresize:
793 : * @device: the device to resize
794 : * @size: the new requested size of the PV or 0 if it should be adjusted to device's size
795 : * @extra: (nullable) (array zero-terminated=1): extra options for the PV resize
796 : * (just passed to LVM as is)
797 : * @error: (out) (optional): place to store error (if any)
798 : *
799 : * Returns: whether the PV's size was successfully changed or not
800 : *
801 : * If given @size different from 0, sets the PV's size to the given value (see
802 : * pvresize(8)). If given @size 0, adjusts the PV's size to the underlying
803 : * block device's size.
804 : *
805 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
806 : */
807 8 : gboolean bd_lvm_pvresize (const gchar *device, guint64 size, const BDExtraArg **extra, GError **error) {
808 8 : return _bd_lvm_pvresize (device, size, extra, error);
809 : }
810 :
811 :
812 0 : static gboolean bd_lvm_pvremove_stub (const gchar *device G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
813 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_pvremove' called, but not implemented!");
814 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
815 : "The function 'bd_lvm_pvremove' called, but not implemented!");
816 0 : return FALSE;
817 : }
818 :
819 : static gboolean (*_bd_lvm_pvremove) (const gchar *device, const BDExtraArg **extra, GError **error) = bd_lvm_pvremove_stub;
820 :
821 : /**
822 : * bd_lvm_pvremove:
823 : * @device: the PV device to be removed/destroyed
824 : * @extra: (nullable) (array zero-terminated=1): extra options for the PV removal
825 : * (just passed to LVM as is)
826 : * @error: (out) (optional): place to store error (if any)
827 : *
828 : * Returns: whether the PV was successfully removed/destroyed or not
829 : *
830 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_REMOVE
831 : */
832 299 : gboolean bd_lvm_pvremove (const gchar *device, const BDExtraArg **extra, GError **error) {
833 299 : return _bd_lvm_pvremove (device, extra, error);
834 : }
835 :
836 :
837 0 : static gboolean bd_lvm_pvmove_stub (const gchar *src G_GNUC_UNUSED, const gchar *dest G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
838 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_pvmove' called, but not implemented!");
839 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
840 : "The function 'bd_lvm_pvmove' called, but not implemented!");
841 0 : return FALSE;
842 : }
843 :
844 : static gboolean (*_bd_lvm_pvmove) (const gchar *src, const gchar *dest, const BDExtraArg **extra, GError **error) = bd_lvm_pvmove_stub;
845 :
846 : /**
847 : * bd_lvm_pvmove:
848 : * @src: the PV device to move extents off of
849 : * @dest: (nullable): the PV device to move extents onto or %NULL
850 : * @extra: (nullable) (array zero-terminated=1): extra options for the PV move
851 : * (just passed to LVM as is)
852 : * @error: (out) (optional): place to store error (if any)
853 : *
854 : * Returns: whether the extents from the @src PV where successfully moved or not
855 : *
856 : * If @dest is %NULL, VG allocation rules are used for the extents from the @src
857 : * PV (see pvmove(8)).
858 : *
859 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
860 : */
861 0 : gboolean bd_lvm_pvmove (const gchar *src, const gchar *dest, const BDExtraArg **extra, GError **error) {
862 0 : return _bd_lvm_pvmove (src, dest, extra, error);
863 : }
864 :
865 :
866 0 : static gboolean bd_lvm_pvscan_stub (const gchar *device G_GNUC_UNUSED, gboolean update_cache G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
867 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_pvscan' called, but not implemented!");
868 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
869 : "The function 'bd_lvm_pvscan' called, but not implemented!");
870 0 : return FALSE;
871 : }
872 :
873 : static gboolean (*_bd_lvm_pvscan) (const gchar *device, gboolean update_cache, const BDExtraArg **extra, GError **error) = bd_lvm_pvscan_stub;
874 :
875 : /**
876 : * bd_lvm_pvscan:
877 : * @device: (nullable): the device to scan for PVs or %NULL
878 : * @update_cache: whether to update the lvmetad cache or not
879 : * @extra: (nullable) (array zero-terminated=1): extra options for the PV scan
880 : * (just passed to LVM as is)
881 : * @error: (out) (optional): place to store error (if any)
882 : *
883 : * Returns: whether the system or @device was successfully scanned for PVs or not
884 : *
885 : * The @device argument is used only if @update_cache is %TRUE. Otherwise the
886 : * whole system is scanned for PVs.
887 : *
888 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
889 : */
890 10 : gboolean bd_lvm_pvscan (const gchar *device, gboolean update_cache, const BDExtraArg **extra, GError **error) {
891 10 : return _bd_lvm_pvscan (device, update_cache, extra, error);
892 : }
893 :
894 :
895 0 : static gboolean bd_lvm_add_pv_tags_stub (const gchar *device G_GNUC_UNUSED, const gchar **tags G_GNUC_UNUSED, GError **error) {
896 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_add_pv_tags' called, but not implemented!");
897 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
898 : "The function 'bd_lvm_add_pv_tags' called, but not implemented!");
899 0 : return FALSE;
900 : }
901 :
902 : static gboolean (*_bd_lvm_add_pv_tags) (const gchar *device, const gchar **tags, GError **error) = bd_lvm_add_pv_tags_stub;
903 :
904 : /**
905 : * bd_lvm_add_pv_tags:
906 : * @device: the device to set PV tags for
907 : * @tags: (array zero-terminated=1): list of tags to add
908 : * @error: (out) (optional): place to store error (if any)
909 : *
910 : * Returns: whether the tags were successfully added to @device or not
911 : *
912 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
913 : */
914 4 : gboolean bd_lvm_add_pv_tags (const gchar *device, const gchar **tags, GError **error) {
915 4 : return _bd_lvm_add_pv_tags (device, tags, error);
916 : }
917 :
918 :
919 0 : static gboolean bd_lvm_delete_pv_tags_stub (const gchar *device G_GNUC_UNUSED, const gchar **tags G_GNUC_UNUSED, GError **error) {
920 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_delete_pv_tags' called, but not implemented!");
921 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
922 : "The function 'bd_lvm_delete_pv_tags' called, but not implemented!");
923 0 : return FALSE;
924 : }
925 :
926 : static gboolean (*_bd_lvm_delete_pv_tags) (const gchar *device, const gchar **tags, GError **error) = bd_lvm_delete_pv_tags_stub;
927 :
928 : /**
929 : * bd_lvm_delete_pv_tags:
930 : * @device: the device to set PV tags for
931 : * @tags: (array zero-terminated=1): list of tags to remove
932 : * @error: (out) (optional): place to store error (if any)
933 : *
934 : * Returns: whether the tags were successfully removed from @device or not
935 : *
936 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
937 : */
938 2 : gboolean bd_lvm_delete_pv_tags (const gchar *device, const gchar **tags, GError **error) {
939 2 : return _bd_lvm_delete_pv_tags (device, tags, error);
940 : }
941 :
942 :
943 0 : static BDLVMPVdata* bd_lvm_pvinfo_stub (const gchar *device G_GNUC_UNUSED, GError **error) {
944 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_pvinfo' called, but not implemented!");
945 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
946 : "The function 'bd_lvm_pvinfo' called, but not implemented!");
947 0 : return NULL;
948 : }
949 :
950 : static BDLVMPVdata* (*_bd_lvm_pvinfo) (const gchar *device, GError **error) = bd_lvm_pvinfo_stub;
951 :
952 : /**
953 : * bd_lvm_pvinfo:
954 : * @device: a PV to get information about or %NULL
955 : * @error: (out) (optional): place to store error (if any)
956 : *
957 : * Returns: (transfer full): information about the PV on the given @device or
958 : * %NULL in case of error (the @error) gets populated in those cases)
959 : *
960 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
961 : */
962 20 : BDLVMPVdata* bd_lvm_pvinfo (const gchar *device, GError **error) {
963 20 : return _bd_lvm_pvinfo (device, error);
964 : }
965 :
966 :
967 0 : static BDLVMPVdata** bd_lvm_pvs_stub (GError **error) {
968 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_pvs' called, but not implemented!");
969 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
970 : "The function 'bd_lvm_pvs' called, but not implemented!");
971 0 : return NULL;
972 : }
973 :
974 : static BDLVMPVdata** (*_bd_lvm_pvs) (GError **error) = bd_lvm_pvs_stub;
975 :
976 : /**
977 : * bd_lvm_pvs:
978 : * @error: (out) (optional): place to store error (if any)
979 : *
980 : * Returns: (array zero-terminated=1): information about PVs found in the system
981 : *
982 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
983 : */
984 6 : BDLVMPVdata** bd_lvm_pvs (GError **error) {
985 6 : return _bd_lvm_pvs (error);
986 : }
987 :
988 :
989 0 : static gboolean bd_lvm_vgcreate_stub (const gchar *name G_GNUC_UNUSED, const gchar **pv_list G_GNUC_UNUSED, guint64 pe_size G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
990 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgcreate' called, but not implemented!");
991 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
992 : "The function 'bd_lvm_vgcreate' called, but not implemented!");
993 0 : return FALSE;
994 : }
995 :
996 : static gboolean (*_bd_lvm_vgcreate) (const gchar *name, const gchar **pv_list, guint64 pe_size, const BDExtraArg **extra, GError **error) = bd_lvm_vgcreate_stub;
997 :
998 : /**
999 : * bd_lvm_vgcreate:
1000 : * @name: name of the newly created VG
1001 : * @pv_list: (array zero-terminated=1): list of PVs the newly created VG should use
1002 : * @pe_size: PE size or 0 if the default value should be used
1003 : * @extra: (nullable) (array zero-terminated=1): extra options for the VG creation
1004 : * (just passed to LVM as is)
1005 : * @error: (out) (optional): place to store error (if any)
1006 : *
1007 : * Returns: whether the VG @name was successfully created or not
1008 : *
1009 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_CREATE
1010 : */
1011 91 : gboolean bd_lvm_vgcreate (const gchar *name, const gchar **pv_list, guint64 pe_size, const BDExtraArg **extra, GError **error) {
1012 91 : return _bd_lvm_vgcreate (name, pv_list, pe_size, extra, error);
1013 : }
1014 :
1015 :
1016 0 : static gboolean bd_lvm_vgremove_stub (const gchar *vg_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1017 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgremove' called, but not implemented!");
1018 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1019 : "The function 'bd_lvm_vgremove' called, but not implemented!");
1020 0 : return FALSE;
1021 : }
1022 :
1023 : static gboolean (*_bd_lvm_vgremove) (const gchar *vg_name, const BDExtraArg **extra, GError **error) = bd_lvm_vgremove_stub;
1024 :
1025 : /**
1026 : * bd_lvm_vgremove:
1027 : * @vg_name: name of the to be removed VG
1028 : * @extra: (nullable) (array zero-terminated=1): extra options for the VG removal
1029 : * (just passed to LVM as is)
1030 : * @error: (out) (optional): place to store error (if any)
1031 : *
1032 : * Returns: whether the VG was successfully removed or not
1033 : *
1034 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_REMOVE
1035 : */
1036 97 : gboolean bd_lvm_vgremove (const gchar *vg_name, const BDExtraArg **extra, GError **error) {
1037 97 : return _bd_lvm_vgremove (vg_name, extra, error);
1038 : }
1039 :
1040 :
1041 0 : static gboolean bd_lvm_vgrename_stub (const gchar *old_vg_name G_GNUC_UNUSED, const gchar *new_vg_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1042 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgrename' called, but not implemented!");
1043 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1044 : "The function 'bd_lvm_vgrename' called, but not implemented!");
1045 0 : return FALSE;
1046 : }
1047 :
1048 : static gboolean (*_bd_lvm_vgrename) (const gchar *old_vg_name, const gchar *new_vg_name, const BDExtraArg **extra, GError **error) = bd_lvm_vgrename_stub;
1049 :
1050 : /**
1051 : * bd_lvm_vgrename:
1052 : * @old_vg_name: old name of the VG to rename
1053 : * @new_vg_name: new name for the @old_vg_name VG
1054 : * @extra: (nullable) (array zero-terminated=1): extra options for the VG rename
1055 : * (just passed to LVM as is)
1056 : * @error: (out) (optional): place to store error (if any)
1057 : *
1058 : * Returns: whether the VG was successfully renamed or not
1059 : *
1060 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1061 : */
1062 6 : gboolean bd_lvm_vgrename (const gchar *old_vg_name, const gchar *new_vg_name, const BDExtraArg **extra, GError **error) {
1063 6 : return _bd_lvm_vgrename (old_vg_name, new_vg_name, extra, error);
1064 : }
1065 :
1066 :
1067 0 : static gboolean bd_lvm_vgactivate_stub (const gchar *vg_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1068 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgactivate' called, but not implemented!");
1069 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1070 : "The function 'bd_lvm_vgactivate' called, but not implemented!");
1071 0 : return FALSE;
1072 : }
1073 :
1074 : static gboolean (*_bd_lvm_vgactivate) (const gchar *vg_name, const BDExtraArg **extra, GError **error) = bd_lvm_vgactivate_stub;
1075 :
1076 : /**
1077 : * bd_lvm_vgactivate:
1078 : * @vg_name: name of the to be activated VG
1079 : * @extra: (nullable) (array zero-terminated=1): extra options for the VG activation
1080 : * (just passed to LVM as is)
1081 : * @error: (out) (optional): place to store error (if any)
1082 : *
1083 : * Returns: whether the VG was successfully activated or not
1084 : *
1085 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1086 : */
1087 6 : gboolean bd_lvm_vgactivate (const gchar *vg_name, const BDExtraArg **extra, GError **error) {
1088 6 : return _bd_lvm_vgactivate (vg_name, extra, error);
1089 : }
1090 :
1091 :
1092 0 : static gboolean bd_lvm_vgdeactivate_stub (const gchar *vg_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1093 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgdeactivate' called, but not implemented!");
1094 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1095 : "The function 'bd_lvm_vgdeactivate' called, but not implemented!");
1096 0 : return FALSE;
1097 : }
1098 :
1099 : static gboolean (*_bd_lvm_vgdeactivate) (const gchar *vg_name, const BDExtraArg **extra, GError **error) = bd_lvm_vgdeactivate_stub;
1100 :
1101 : /**
1102 : * bd_lvm_vgdeactivate:
1103 : * @vg_name: name of the to be deactivated VG
1104 : * @extra: (nullable) (array zero-terminated=1): extra options for the VG deactivation
1105 : * (just passed to LVM as is)
1106 : * @error: (out) (optional): place to store error (if any)
1107 : *
1108 : * Returns: whether the VG was successfully deactivated or not
1109 : *
1110 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1111 : */
1112 6 : gboolean bd_lvm_vgdeactivate (const gchar *vg_name, const BDExtraArg **extra, GError **error) {
1113 6 : return _bd_lvm_vgdeactivate (vg_name, extra, error);
1114 : }
1115 :
1116 :
1117 0 : static gboolean bd_lvm_vgextend_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *device G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1118 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgextend' called, but not implemented!");
1119 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1120 : "The function 'bd_lvm_vgextend' called, but not implemented!");
1121 0 : return FALSE;
1122 : }
1123 :
1124 : static gboolean (*_bd_lvm_vgextend) (const gchar *vg_name, const gchar *device, const BDExtraArg **extra, GError **error) = bd_lvm_vgextend_stub;
1125 :
1126 : /**
1127 : * bd_lvm_vgextend:
1128 : * @vg_name: name of the to be extended VG
1129 : * @device: PV device to extend the @vg_name VG with
1130 : * @extra: (nullable) (array zero-terminated=1): extra options for the VG extension
1131 : * (just passed to LVM as is)
1132 : * @error: (out) (optional): place to store error (if any)
1133 : *
1134 : * Returns: whether the VG @vg_name was successfully extended with the given @device or not.
1135 : *
1136 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1137 : */
1138 8 : gboolean bd_lvm_vgextend (const gchar *vg_name, const gchar *device, const BDExtraArg **extra, GError **error) {
1139 8 : return _bd_lvm_vgextend (vg_name, device, extra, error);
1140 : }
1141 :
1142 :
1143 0 : static gboolean bd_lvm_vgreduce_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *device G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1144 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgreduce' called, but not implemented!");
1145 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1146 : "The function 'bd_lvm_vgreduce' called, but not implemented!");
1147 0 : return FALSE;
1148 : }
1149 :
1150 : static gboolean (*_bd_lvm_vgreduce) (const gchar *vg_name, const gchar *device, const BDExtraArg **extra, GError **error) = bd_lvm_vgreduce_stub;
1151 :
1152 : /**
1153 : * bd_lvm_vgreduce:
1154 : * @vg_name: name of the to be reduced VG
1155 : * @device: (nullable): PV device the @vg_name VG should be reduced of or %NULL
1156 : * if the VG should be reduced of the missing PVs
1157 : * @extra: (nullable) (array zero-terminated=1): extra options for the VG reduction
1158 : * (just passed to LVM as is)
1159 : * @error: (out) (optional): place to store error (if any)
1160 : *
1161 : * Returns: whether the VG @vg_name was successfully reduced of the given @device or not
1162 : *
1163 : * Note: This function does not move extents off of the PV before removing
1164 : * it from the VG. You must do that first by calling #bd_lvm_pvmove.
1165 : *
1166 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1167 : */
1168 7 : gboolean bd_lvm_vgreduce (const gchar *vg_name, const gchar *device, const BDExtraArg **extra, GError **error) {
1169 7 : return _bd_lvm_vgreduce (vg_name, device, extra, error);
1170 : }
1171 :
1172 :
1173 0 : static gboolean bd_lvm_add_vg_tags_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar **tags G_GNUC_UNUSED, GError **error) {
1174 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_add_vg_tags' called, but not implemented!");
1175 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1176 : "The function 'bd_lvm_add_vg_tags' called, but not implemented!");
1177 0 : return FALSE;
1178 : }
1179 :
1180 : static gboolean (*_bd_lvm_add_vg_tags) (const gchar *vg_name, const gchar **tags, GError **error) = bd_lvm_add_vg_tags_stub;
1181 :
1182 : /**
1183 : * bd_lvm_add_vg_tags:
1184 : * @vg_name: the VG to set tags on
1185 : * @tags: (array zero-terminated=1): list of tags to add
1186 : * @error: (out) (optional): place to store error (if any)
1187 : *
1188 : * Returns: whether the tags were successfully added to @vg_name or not
1189 : *
1190 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1191 : */
1192 4 : gboolean bd_lvm_add_vg_tags (const gchar *vg_name, const gchar **tags, GError **error) {
1193 4 : return _bd_lvm_add_vg_tags (vg_name, tags, error);
1194 : }
1195 :
1196 :
1197 0 : static gboolean bd_lvm_delete_vg_tags_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar **tags G_GNUC_UNUSED, GError **error) {
1198 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_delete_vg_tags' called, but not implemented!");
1199 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1200 : "The function 'bd_lvm_delete_vg_tags' called, but not implemented!");
1201 0 : return FALSE;
1202 : }
1203 :
1204 : static gboolean (*_bd_lvm_delete_vg_tags) (const gchar *vg_name, const gchar **tags, GError **error) = bd_lvm_delete_vg_tags_stub;
1205 :
1206 : /**
1207 : * bd_lvm_delete_vg_tags:
1208 : * @vg_name: the VG to set tags on
1209 : * @tags: (array zero-terminated=1): list of tags to remove
1210 : * @error: (out) (optional): place to store error (if any)
1211 : *
1212 : * Returns: whether the tags were successfully removed from @vg_name or not
1213 : *
1214 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1215 : */
1216 2 : gboolean bd_lvm_delete_vg_tags (const gchar *vg_name, const gchar **tags, GError **error) {
1217 2 : return _bd_lvm_delete_vg_tags (vg_name, tags, error);
1218 : }
1219 :
1220 :
1221 0 : static gboolean bd_lvm_vglock_start_stub (const gchar *vg_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1222 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vglock_start' called, but not implemented!");
1223 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1224 : "The function 'bd_lvm_vglock_start' called, but not implemented!");
1225 0 : return FALSE;
1226 : }
1227 :
1228 : static gboolean (*_bd_lvm_vglock_start) (const gchar *vg_name, const BDExtraArg **extra, GError **error) = bd_lvm_vglock_start_stub;
1229 :
1230 : /**
1231 : * bd_lvm_vglock_start:
1232 : * @vg_name: a shared VG to start the lockspace in lvmlockd
1233 : * @extra: (nullable) (array zero-terminated=1): extra options for the vgchange command
1234 : * (just passed to LVM as is)
1235 : * @error: (out) (optional): place to store error (if any)
1236 : *
1237 : * Returns: whether the lock was successfully started for @vg_name or not
1238 : *
1239 : * Tech category: %BD_LVM_TECH_SHARED-%BD_LVM_TECH_MODE_MODIFY
1240 : */
1241 0 : gboolean bd_lvm_vglock_start (const gchar *vg_name, const BDExtraArg **extra, GError **error) {
1242 0 : return _bd_lvm_vglock_start (vg_name, extra, error);
1243 : }
1244 :
1245 :
1246 0 : static gboolean bd_lvm_vglock_stop_stub (const gchar *vg_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1247 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vglock_stop' called, but not implemented!");
1248 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1249 : "The function 'bd_lvm_vglock_stop' called, but not implemented!");
1250 0 : return FALSE;
1251 : }
1252 :
1253 : static gboolean (*_bd_lvm_vglock_stop) (const gchar *vg_name, const BDExtraArg **extra, GError **error) = bd_lvm_vglock_stop_stub;
1254 :
1255 : /**
1256 : * bd_lvm_vglock_stop:
1257 : * @vg_name: a shared VG to stop the lockspace in lvmlockd
1258 : * @extra: (nullable) (array zero-terminated=1): extra options for the vgchange command
1259 : * (just passed to LVM as is)
1260 : * @error: (out) (optional): place to store error (if any)
1261 : *
1262 : * Returns: whether the lock was successfully stopped for @vg_name or not
1263 : *
1264 : * Tech category: %BD_LVM_TECH_SHARED-%BD_LVM_TECH_MODE_MODIFY
1265 : */
1266 0 : gboolean bd_lvm_vglock_stop (const gchar *vg_name, const BDExtraArg **extra, GError **error) {
1267 0 : return _bd_lvm_vglock_stop (vg_name, extra, error);
1268 : }
1269 :
1270 :
1271 0 : static BDLVMVGdata* bd_lvm_vginfo_stub (const gchar *vg_name G_GNUC_UNUSED, GError **error) {
1272 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vginfo' called, but not implemented!");
1273 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1274 : "The function 'bd_lvm_vginfo' called, but not implemented!");
1275 0 : return NULL;
1276 : }
1277 :
1278 : static BDLVMVGdata* (*_bd_lvm_vginfo) (const gchar *vg_name, GError **error) = bd_lvm_vginfo_stub;
1279 :
1280 : /**
1281 : * bd_lvm_vginfo:
1282 : * @vg_name: a VG to get information about
1283 : * @error: (out) (optional): place to store error (if any)
1284 : *
1285 : * Returns: (transfer full): information about the @vg_name VG or %NULL in case
1286 : * of error (the @error) gets populated in those cases)
1287 : *
1288 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1289 : */
1290 12 : BDLVMVGdata* bd_lvm_vginfo (const gchar *vg_name, GError **error) {
1291 12 : return _bd_lvm_vginfo (vg_name, error);
1292 : }
1293 :
1294 :
1295 0 : static BDLVMVGdata** bd_lvm_vgs_stub (GError **error) {
1296 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgs' called, but not implemented!");
1297 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1298 : "The function 'bd_lvm_vgs' called, but not implemented!");
1299 0 : return NULL;
1300 : }
1301 :
1302 : static BDLVMVGdata** (*_bd_lvm_vgs) (GError **error) = bd_lvm_vgs_stub;
1303 :
1304 : /**
1305 : * bd_lvm_vgs:
1306 : * @error: (out) (optional): place to store error (if any)
1307 : *
1308 : * Returns: (array zero-terminated=1): information about VGs found in the system
1309 : *
1310 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1311 : */
1312 4 : BDLVMVGdata** bd_lvm_vgs (GError **error) {
1313 4 : return _bd_lvm_vgs (error);
1314 : }
1315 :
1316 :
1317 0 : static gchar* bd_lvm_lvorigin_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, GError **error) {
1318 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvorigin' called, but not implemented!");
1319 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1320 : "The function 'bd_lvm_lvorigin' called, but not implemented!");
1321 0 : return NULL;
1322 : }
1323 :
1324 : static gchar* (*_bd_lvm_lvorigin) (const gchar *vg_name, const gchar *lv_name, GError **error) = bd_lvm_lvorigin_stub;
1325 :
1326 : /**
1327 : * bd_lvm_lvorigin:
1328 : * @vg_name: name of the VG containing the queried LV
1329 : * @lv_name: name of the queried LV
1330 : * @error: (out) (optional): place to store error (if any)
1331 : *
1332 : * Returns: (transfer full): the origin volume for the @vg_name/@lv_name LV or
1333 : * %NULL if failed to determine (@error) is set in those cases)
1334 : *
1335 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1336 : */
1337 2 : gchar* bd_lvm_lvorigin (const gchar *vg_name, const gchar *lv_name, GError **error) {
1338 2 : return _bd_lvm_lvorigin (vg_name, lv_name, error);
1339 : }
1340 :
1341 :
1342 0 : static gboolean bd_lvm_lvcreate_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, guint64 size G_GNUC_UNUSED, const gchar *type G_GNUC_UNUSED, const gchar **pv_list G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1343 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvcreate' called, but not implemented!");
1344 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1345 : "The function 'bd_lvm_lvcreate' called, but not implemented!");
1346 0 : return FALSE;
1347 : }
1348 :
1349 : static gboolean (*_bd_lvm_lvcreate) (const gchar *vg_name, const gchar *lv_name, guint64 size, const gchar *type, const gchar **pv_list, const BDExtraArg **extra, GError **error) = bd_lvm_lvcreate_stub;
1350 :
1351 : /**
1352 : * bd_lvm_lvcreate:
1353 : * @vg_name: name of the VG to create a new LV in
1354 : * @lv_name: name of the to-be-created LV
1355 : * @size: requested size of the new LV
1356 : * @type: (nullable): type of the new LV ("striped", "raid1",..., see lvcreate (8))
1357 : * @pv_list: (nullable) (array zero-terminated=1): list of PVs the newly created LV should use or %NULL
1358 : * if not specified
1359 : * @extra: (nullable) (array zero-terminated=1): extra options for the LV creation
1360 : * (just passed to LVM as is)
1361 : * @error: (out) (optional): place to store error (if any)
1362 : *
1363 : * Returns: whether the given @vg_name/@lv_name LV was successfully created or not
1364 : *
1365 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_CREATE
1366 : */
1367 92 : gboolean bd_lvm_lvcreate (const gchar *vg_name, const gchar *lv_name, guint64 size, const gchar *type, const gchar **pv_list, const BDExtraArg **extra, GError **error) {
1368 92 : return _bd_lvm_lvcreate (vg_name, lv_name, size, type, pv_list, extra, error);
1369 : }
1370 :
1371 :
1372 0 : static gboolean bd_lvm_lvremove_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, gboolean force G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1373 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvremove' called, but not implemented!");
1374 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1375 : "The function 'bd_lvm_lvremove' called, but not implemented!");
1376 0 : return FALSE;
1377 : }
1378 :
1379 : static gboolean (*_bd_lvm_lvremove) (const gchar *vg_name, const gchar *lv_name, gboolean force, const BDExtraArg **extra, GError **error) = bd_lvm_lvremove_stub;
1380 :
1381 : /**
1382 : * bd_lvm_lvremove:
1383 : * @vg_name: name of the VG containing the to-be-removed LV
1384 : * @lv_name: name of the to-be-removed LV
1385 : * @force: whether to force removal or not
1386 : * @extra: (nullable) (array zero-terminated=1): extra options for the LV removal
1387 : * (just passed to LVM as is)
1388 : * @error: (out) (optional): place to store error (if any)
1389 : *
1390 : * Returns: whether the @vg_name/@lv_name LV was successfully removed or not
1391 : *
1392 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_REMOVE
1393 : */
1394 107 : gboolean bd_lvm_lvremove (const gchar *vg_name, const gchar *lv_name, gboolean force, const BDExtraArg **extra, GError **error) {
1395 107 : return _bd_lvm_lvremove (vg_name, lv_name, force, extra, error);
1396 : }
1397 :
1398 :
1399 0 : static gboolean bd_lvm_lvrename_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, const gchar *new_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1400 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvrename' called, but not implemented!");
1401 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1402 : "The function 'bd_lvm_lvrename' called, but not implemented!");
1403 0 : return FALSE;
1404 : }
1405 :
1406 : static gboolean (*_bd_lvm_lvrename) (const gchar *vg_name, const gchar *lv_name, const gchar *new_name, const BDExtraArg **extra, GError **error) = bd_lvm_lvrename_stub;
1407 :
1408 : /**
1409 : * bd_lvm_lvrename:
1410 : * @vg_name: name of the VG containing the to-be-renamed LV
1411 : * @lv_name: name of the to-be-renamed LV
1412 : * @new_name: new name for the @vg_name/@lv_name LV
1413 : * @extra: (nullable) (array zero-terminated=1): extra options for the LV rename
1414 : * (just passed to LVM as is)
1415 : * @error: (out) (optional): place to store error (if any)
1416 : *
1417 : * Returns: whether the @vg_name/@lv_name LV was successfully renamed to
1418 : * @vg_name/@new_name or not
1419 : *
1420 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1421 : */
1422 13 : gboolean bd_lvm_lvrename (const gchar *vg_name, const gchar *lv_name, const gchar *new_name, const BDExtraArg **extra, GError **error) {
1423 13 : return _bd_lvm_lvrename (vg_name, lv_name, new_name, extra, error);
1424 : }
1425 :
1426 :
1427 0 : static gboolean bd_lvm_lvresize_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, guint64 size G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1428 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvresize' called, but not implemented!");
1429 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1430 : "The function 'bd_lvm_lvresize' called, but not implemented!");
1431 0 : return FALSE;
1432 : }
1433 :
1434 : static gboolean (*_bd_lvm_lvresize) (const gchar *vg_name, const gchar *lv_name, guint64 size, const BDExtraArg **extra, GError **error) = bd_lvm_lvresize_stub;
1435 :
1436 : /**
1437 : * bd_lvm_lvresize:
1438 : * @vg_name: name of the VG containing the to-be-resized LV
1439 : * @lv_name: name of the to-be-resized LV
1440 : * @size: the requested new size of the LV
1441 : * @extra: (nullable) (array zero-terminated=1): extra options for the LV resize
1442 : * (just passed to LVM as is)
1443 : * @error: (out) (optional): place to store error (if any)
1444 : *
1445 : * Returns: whether the @vg_name/@lv_name LV was successfully resized or not
1446 : *
1447 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1448 : */
1449 20 : gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 size, const BDExtraArg **extra, GError **error) {
1450 20 : return _bd_lvm_lvresize (vg_name, lv_name, size, extra, error);
1451 : }
1452 :
1453 :
1454 0 : static gboolean bd_lvm_lvrepair_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, const gchar **pv_list G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1455 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvrepair' called, but not implemented!");
1456 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1457 : "The function 'bd_lvm_lvrepair' called, but not implemented!");
1458 0 : return FALSE;
1459 : }
1460 :
1461 : static gboolean (*_bd_lvm_lvrepair) (const gchar *vg_name, const gchar *lv_name, const gchar **pv_list, const BDExtraArg **extra, GError **error) = bd_lvm_lvrepair_stub;
1462 :
1463 : /**
1464 : * bd_lvm_lvrepair:
1465 : * @vg_name: name of the VG containing the to-be-repaired LV
1466 : * @lv_name: name of the to-be-repaired LV
1467 : * @pv_list: (array zero-terminated=1): list of PVs to be used for the repair
1468 : * @extra: (nullable) (array zero-terminated=1): extra options for the LV repair
1469 : * (just passed to LVM as is)
1470 : * @error: (out) (optional): place to store error (if any)
1471 : *
1472 : * Returns: whether the @vg_name/@lv_name LV was successfully repaired or not
1473 : *
1474 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1475 : */
1476 1 : gboolean bd_lvm_lvrepair (const gchar *vg_name, const gchar *lv_name, const gchar **pv_list, const BDExtraArg **extra, GError **error) {
1477 1 : return _bd_lvm_lvrepair (vg_name, lv_name, pv_list, extra, error);
1478 : }
1479 :
1480 :
1481 0 : static gboolean bd_lvm_lvactivate_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, gboolean ignore_skip G_GNUC_UNUSED, gboolean shared G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1482 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvactivate' called, but not implemented!");
1483 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1484 : "The function 'bd_lvm_lvactivate' called, but not implemented!");
1485 0 : return FALSE;
1486 : }
1487 :
1488 : static gboolean (*_bd_lvm_lvactivate) (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) = bd_lvm_lvactivate_stub;
1489 :
1490 : /**
1491 : * bd_lvm_lvactivate:
1492 : * @vg_name: name of the VG containing the to-be-activated LV
1493 : * @lv_name: name of the to-be-activated LV
1494 : * @ignore_skip: whether to ignore the skip flag or not
1495 : * @shared: whether to activate the LV in shared mode (used for shared LVM setups with lvmlockd,
1496 : * use %FALSE if not sure)
1497 : * @extra: (nullable) (array zero-terminated=1): extra options for the LV activation
1498 : * (just passed to LVM as is)
1499 : * @error: (out) (optional): place to store error (if any)
1500 : *
1501 : * Returns: whether the @vg_name/@lv_name LV was successfully activated or not
1502 : *
1503 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1504 : */
1505 12 : gboolean bd_lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) {
1506 12 : return _bd_lvm_lvactivate (vg_name, lv_name, ignore_skip, shared, extra, error);
1507 : }
1508 :
1509 :
1510 0 : static gboolean bd_lvm_lvdeactivate_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1511 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvdeactivate' called, but not implemented!");
1512 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1513 : "The function 'bd_lvm_lvdeactivate' called, but not implemented!");
1514 0 : return FALSE;
1515 : }
1516 :
1517 : static gboolean (*_bd_lvm_lvdeactivate) (const gchar *vg_name, const gchar *lv_name, const BDExtraArg **extra, GError **error) = bd_lvm_lvdeactivate_stub;
1518 :
1519 : /**
1520 : * bd_lvm_lvdeactivate:
1521 : * @vg_name: name of the VG containing the to-be-deactivated LV
1522 : * @lv_name: name of the to-be-deactivated LV
1523 : * @extra: (nullable) (array zero-terminated=1): extra options for the LV deactivation
1524 : * (just passed to LVM as is)
1525 : * @error: (out) (optional): place to store error (if any)
1526 : *
1527 : * Returns: whether the @vg_name/@lv_name LV was successfully deactivated or not
1528 : *
1529 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
1530 : */
1531 26 : gboolean bd_lvm_lvdeactivate (const gchar *vg_name, const gchar *lv_name, const BDExtraArg **extra, GError **error) {
1532 26 : return _bd_lvm_lvdeactivate (vg_name, lv_name, extra, error);
1533 : }
1534 :
1535 :
1536 0 : static gboolean bd_lvm_lvsnapshotcreate_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *origin_name G_GNUC_UNUSED, const gchar *snapshot_name G_GNUC_UNUSED, guint64 size G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1537 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvsnapshotcreate' called, but not implemented!");
1538 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1539 : "The function 'bd_lvm_lvsnapshotcreate' called, but not implemented!");
1540 0 : return FALSE;
1541 : }
1542 :
1543 : static gboolean (*_bd_lvm_lvsnapshotcreate) (const gchar *vg_name, const gchar *origin_name, const gchar *snapshot_name, guint64 size, const BDExtraArg **extra, GError **error) = bd_lvm_lvsnapshotcreate_stub;
1544 :
1545 : /**
1546 : * bd_lvm_lvsnapshotcreate:
1547 : * @vg_name: name of the VG containing the LV a new snapshot should be created of
1548 : * @origin_name: name of the LV a new snapshot should be created of
1549 : * @snapshot_name: name of the to-be-created snapshot
1550 : * @size: requested size for the snapshot
1551 : * @extra: (nullable) (array zero-terminated=1): extra options for the LV snapshot creation
1552 : * (just passed to LVM as is)
1553 : * @error: (out) (optional): place to store error (if any)
1554 : *
1555 : * Returns: whether the @snapshot_name snapshot of the @vg_name/@origin_name LV
1556 : * was successfully created or not.
1557 : *
1558 : * Tech category: %BD_LVM_TECH_BASIC_SNAP-%BD_LVM_TECH_MODE_CREATE
1559 : */
1560 2 : gboolean bd_lvm_lvsnapshotcreate (const gchar *vg_name, const gchar *origin_name, const gchar *snapshot_name, guint64 size, const BDExtraArg **extra, GError **error) {
1561 2 : return _bd_lvm_lvsnapshotcreate (vg_name, origin_name, snapshot_name, size, extra, error);
1562 : }
1563 :
1564 :
1565 0 : static gboolean bd_lvm_lvsnapshotmerge_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *snapshot_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1566 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvsnapshotmerge' called, but not implemented!");
1567 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1568 : "The function 'bd_lvm_lvsnapshotmerge' called, but not implemented!");
1569 0 : return FALSE;
1570 : }
1571 :
1572 : static gboolean (*_bd_lvm_lvsnapshotmerge) (const gchar *vg_name, const gchar *snapshot_name, const BDExtraArg **extra, GError **error) = bd_lvm_lvsnapshotmerge_stub;
1573 :
1574 : /**
1575 : * bd_lvm_lvsnapshotmerge:
1576 : * @vg_name: name of the VG containing the to-be-merged LV snapshot
1577 : * @snapshot_name: name of the to-be-merged LV snapshot
1578 : * @extra: (nullable) (array zero-terminated=1): extra options for the LV snapshot merge
1579 : * (just passed to LVM as is)
1580 : * @error: (out) (optional): place to store error (if any)
1581 : *
1582 : * Returns: whether the @vg_name/@snapshot_name LV snapshot was successfully merged or not
1583 : *
1584 : * Tech category: %BD_LVM_TECH_BASIC_SNAP-%BD_LVM_TECH_MODE_MODIFY
1585 : */
1586 2 : gboolean bd_lvm_lvsnapshotmerge (const gchar *vg_name, const gchar *snapshot_name, const BDExtraArg **extra, GError **error) {
1587 2 : return _bd_lvm_lvsnapshotmerge (vg_name, snapshot_name, extra, error);
1588 : }
1589 :
1590 :
1591 0 : static gboolean bd_lvm_add_lv_tags_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, const gchar **tags G_GNUC_UNUSED, GError **error) {
1592 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_add_lv_tags' called, but not implemented!");
1593 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1594 : "The function 'bd_lvm_add_lv_tags' called, but not implemented!");
1595 0 : return FALSE;
1596 : }
1597 :
1598 : static gboolean (*_bd_lvm_add_lv_tags) (const gchar *vg_name, const gchar *lv_name, const gchar **tags, GError **error) = bd_lvm_add_lv_tags_stub;
1599 :
1600 : /**
1601 : * bd_lvm_add_lv_tags:
1602 : * @vg_name: name of the VG that contains the LV to set tags on
1603 : * @lv_name: name of the LV to set tags on
1604 : * @tags: (array zero-terminated=1): list of tags to add
1605 : * @error: (out) (optional): place to store error (if any)
1606 : *
1607 : * Returns: whether the tags were successfully added to @device or not
1608 : *
1609 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1610 : */
1611 4 : gboolean bd_lvm_add_lv_tags (const gchar *vg_name, const gchar *lv_name, const gchar **tags, GError **error) {
1612 4 : return _bd_lvm_add_lv_tags (vg_name, lv_name, tags, error);
1613 : }
1614 :
1615 :
1616 0 : static gboolean bd_lvm_delete_lv_tags_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, const gchar **tags G_GNUC_UNUSED, GError **error) {
1617 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_delete_lv_tags' called, but not implemented!");
1618 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1619 : "The function 'bd_lvm_delete_lv_tags' called, but not implemented!");
1620 0 : return FALSE;
1621 : }
1622 :
1623 : static gboolean (*_bd_lvm_delete_lv_tags) (const gchar *vg_name, const gchar *lv_name, const gchar **tags, GError **error) = bd_lvm_delete_lv_tags_stub;
1624 :
1625 : /**
1626 : * bd_lvm_delete_lv_tags:
1627 : * @vg_name: name of the VG that contains the LV to set tags on
1628 : * @lv_name: name of the LV to set tags on
1629 : * @tags: (array zero-terminated=1): list of tags to remove
1630 : * @error: (out) (optional): place to store error (if any)
1631 : *
1632 : * Returns: whether the tags were successfully removed from @device or not
1633 : *
1634 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1635 : */
1636 2 : gboolean bd_lvm_delete_lv_tags (const gchar *vg_name, const gchar *lv_name, const gchar **tags, GError **error) {
1637 2 : return _bd_lvm_delete_lv_tags (vg_name, lv_name, tags, error);
1638 : }
1639 :
1640 :
1641 0 : static BDLVMLVdata* bd_lvm_lvinfo_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, GError **error) {
1642 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvinfo' called, but not implemented!");
1643 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1644 : "The function 'bd_lvm_lvinfo' called, but not implemented!");
1645 0 : return NULL;
1646 : }
1647 :
1648 : static BDLVMLVdata* (*_bd_lvm_lvinfo) (const gchar *vg_name, const gchar *lv_name, GError **error) = bd_lvm_lvinfo_stub;
1649 :
1650 : /**
1651 : * bd_lvm_lvinfo:
1652 : * @vg_name: name of the VG that contains the LV to get information about
1653 : * @lv_name: name of the LV to get information about
1654 : * @error: (out) (optional): place to store error (if any)
1655 : *
1656 : * Returns: (transfer full): information about the @vg_name/@lv_name LV or %NULL in case
1657 : * of error (the @error) gets populated in those cases)
1658 : *
1659 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1660 : */
1661 73 : BDLVMLVdata* bd_lvm_lvinfo (const gchar *vg_name, const gchar *lv_name, GError **error) {
1662 73 : return _bd_lvm_lvinfo (vg_name, lv_name, error);
1663 : }
1664 :
1665 :
1666 0 : static BDLVMLVdata* bd_lvm_lvinfo_tree_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, GError **error) {
1667 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvinfo_tree' called, but not implemented!");
1668 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1669 : "The function 'bd_lvm_lvinfo_tree' called, but not implemented!");
1670 0 : return NULL;
1671 : }
1672 :
1673 : static BDLVMLVdata* (*_bd_lvm_lvinfo_tree) (const gchar *vg_name, const gchar *lv_name, GError **error) = bd_lvm_lvinfo_tree_stub;
1674 :
1675 : /**
1676 : * bd_lvm_lvinfo_tree:
1677 : * @vg_name: name of the VG that contains the LV to get information about
1678 : * @lv_name: name of the LV to get information about
1679 : * @error: (out) (optional): place to store error (if any)
1680 : *
1681 : * This function will fill out the data_lvs, metadata_lvs, and segs fields as well.
1682 : *
1683 : * Returns: (transfer full): information about the @vg_name/@lv_name LV or %NULL in case
1684 : * of error (the @error) gets populated in those cases)
1685 : *
1686 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1687 : */
1688 4 : BDLVMLVdata* bd_lvm_lvinfo_tree (const gchar *vg_name, const gchar *lv_name, GError **error) {
1689 4 : return _bd_lvm_lvinfo_tree (vg_name, lv_name, error);
1690 : }
1691 :
1692 :
1693 0 : static BDLVMLVdata** bd_lvm_lvs_stub (const gchar *vg_name G_GNUC_UNUSED, GError **error) {
1694 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvs' called, but not implemented!");
1695 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1696 : "The function 'bd_lvm_lvs' called, but not implemented!");
1697 0 : return NULL;
1698 : }
1699 :
1700 : static BDLVMLVdata** (*_bd_lvm_lvs) (const gchar *vg_name, GError **error) = bd_lvm_lvs_stub;
1701 :
1702 : /**
1703 : * bd_lvm_lvs:
1704 : * @vg_name: (nullable): name of the VG to get information about LVs from
1705 : * @error: (out) (optional): place to store error (if any)
1706 : *
1707 : * Returns: (array zero-terminated=1): information about LVs found in the given
1708 : * @vg_name VG or in system if @vg_name is %NULL
1709 : *
1710 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1711 : */
1712 28 : BDLVMLVdata** bd_lvm_lvs (const gchar *vg_name, GError **error) {
1713 28 : return _bd_lvm_lvs (vg_name, error);
1714 : }
1715 :
1716 :
1717 0 : static BDLVMLVdata** bd_lvm_lvs_tree_stub (const gchar *vg_name G_GNUC_UNUSED, GError **error) {
1718 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_lvs_tree' called, but not implemented!");
1719 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1720 : "The function 'bd_lvm_lvs_tree' called, but not implemented!");
1721 0 : return NULL;
1722 : }
1723 :
1724 : static BDLVMLVdata** (*_bd_lvm_lvs_tree) (const gchar *vg_name, GError **error) = bd_lvm_lvs_tree_stub;
1725 :
1726 : /**
1727 : * bd_lvm_lvs_tree:
1728 : * @vg_name: (nullable): name of the VG to get information about LVs from
1729 : * @error: (out) (optional): place to store error (if any)
1730 : *
1731 : * This function will fill out the data_lvs, metadata_lvs, and segs fields as well.
1732 : *
1733 : * Returns: (array zero-terminated=1): information about LVs found in the given
1734 : * @vg_name VG or in system if @vg_name is %NULL.
1735 : *
1736 : * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_QUERY
1737 : */
1738 4 : BDLVMLVdata** bd_lvm_lvs_tree (const gchar *vg_name, GError **error) {
1739 4 : return _bd_lvm_lvs_tree (vg_name, error);
1740 : }
1741 :
1742 :
1743 0 : static gboolean bd_lvm_thpoolcreate_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, guint64 size G_GNUC_UNUSED, guint64 md_size G_GNUC_UNUSED, guint64 chunk_size G_GNUC_UNUSED, const gchar *profile G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1744 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_thpoolcreate' called, but not implemented!");
1745 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1746 : "The function 'bd_lvm_thpoolcreate' called, but not implemented!");
1747 0 : return FALSE;
1748 : }
1749 :
1750 : static gboolean (*_bd_lvm_thpoolcreate) (const gchar *vg_name, const gchar *lv_name, guint64 size, guint64 md_size, guint64 chunk_size, const gchar *profile, const BDExtraArg **extra, GError **error) = bd_lvm_thpoolcreate_stub;
1751 :
1752 : /**
1753 : * bd_lvm_thpoolcreate:
1754 : * @vg_name: name of the VG to create a thin pool in
1755 : * @lv_name: name of the to-be-created pool LV
1756 : * @size: requested size of the to-be-created pool
1757 : * @md_size: requested metadata size or 0 to use the default
1758 : * @chunk_size: requested chunk size or 0 to use the default
1759 : * @profile: (nullable): profile to use (see lvm(8) for more information) or %NULL to use
1760 : * the default
1761 : * @extra: (nullable) (array zero-terminated=1): extra options for the thin pool creation
1762 : * (just passed to LVM as is)
1763 : * @error: (out) (optional): place to store error (if any)
1764 : *
1765 : * Returns: whether the @vg_name/@lv_name thin pool was successfully created or not
1766 : *
1767 : * Tech category: %BD_LVM_TECH_THIN-%BD_LVM_TECH_MODE_CREATE
1768 : */
1769 12 : gboolean bd_lvm_thpoolcreate (const gchar *vg_name, const gchar *lv_name, guint64 size, guint64 md_size, guint64 chunk_size, const gchar *profile, const BDExtraArg **extra, GError **error) {
1770 12 : return _bd_lvm_thpoolcreate (vg_name, lv_name, size, md_size, chunk_size, profile, extra, error);
1771 : }
1772 :
1773 :
1774 0 : static gboolean bd_lvm_thlvcreate_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, guint64 size G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1775 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_thlvcreate' called, but not implemented!");
1776 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1777 : "The function 'bd_lvm_thlvcreate' called, but not implemented!");
1778 0 : return FALSE;
1779 : }
1780 :
1781 : static gboolean (*_bd_lvm_thlvcreate) (const gchar *vg_name, const gchar *pool_name, const gchar *lv_name, guint64 size, const BDExtraArg **extra, GError **error) = bd_lvm_thlvcreate_stub;
1782 :
1783 : /**
1784 : * bd_lvm_thlvcreate:
1785 : * @vg_name: name of the VG containing the thin pool providing extents for the to-be-created thin LV
1786 : * @pool_name: name of the pool LV providing extents for the to-be-created thin LV
1787 : * @lv_name: name of the to-be-created thin LV
1788 : * @size: requested virtual size of the to-be-created thin LV
1789 : * @extra: (nullable) (array zero-terminated=1): extra options for the thin LV creation
1790 : * (just passed to LVM as is)
1791 : * @error: (out) (optional): place to store error (if any)
1792 : *
1793 : * Returns: whether the @vg_name/@lv_name thin LV was successfully created or not
1794 : *
1795 : * Tech category: %BD_LVM_TECH_THIN-%BD_LVM_TECH_MODE_CREATE
1796 : */
1797 4 : gboolean bd_lvm_thlvcreate (const gchar *vg_name, const gchar *pool_name, const gchar *lv_name, guint64 size, const BDExtraArg **extra, GError **error) {
1798 4 : return _bd_lvm_thlvcreate (vg_name, pool_name, lv_name, size, extra, error);
1799 : }
1800 :
1801 :
1802 0 : static gchar* bd_lvm_thlvpoolname_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, GError **error) {
1803 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_thlvpoolname' called, but not implemented!");
1804 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1805 : "The function 'bd_lvm_thlvpoolname' called, but not implemented!");
1806 0 : return NULL;
1807 : }
1808 :
1809 : static gchar* (*_bd_lvm_thlvpoolname) (const gchar *vg_name, const gchar *lv_name, GError **error) = bd_lvm_thlvpoolname_stub;
1810 :
1811 : /**
1812 : * bd_lvm_thlvpoolname:
1813 : * @vg_name: name of the VG containing the queried thin LV
1814 : * @lv_name: name of the queried thin LV
1815 : * @error: (out) (optional): place to store error (if any)
1816 : *
1817 : * Returns: (transfer full): the name of the pool volume for the @vg_name/@lv_name
1818 : * thin LV or %NULL if failed to determine (@error) is set in those cases)
1819 : *
1820 : * Tech category: %BD_LVM_TECH_THIN-%BD_LVM_TECH_MODE_QUERY
1821 : */
1822 3 : gchar* bd_lvm_thlvpoolname (const gchar *vg_name, const gchar *lv_name, GError **error) {
1823 3 : return _bd_lvm_thlvpoolname (vg_name, lv_name, error);
1824 : }
1825 :
1826 :
1827 0 : static gboolean bd_lvm_thsnapshotcreate_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *origin_name G_GNUC_UNUSED, const gchar *snapshot_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
1828 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_thsnapshotcreate' called, but not implemented!");
1829 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1830 : "The function 'bd_lvm_thsnapshotcreate' called, but not implemented!");
1831 0 : return FALSE;
1832 : }
1833 :
1834 : static gboolean (*_bd_lvm_thsnapshotcreate) (const gchar *vg_name, const gchar *origin_name, const gchar *snapshot_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) = bd_lvm_thsnapshotcreate_stub;
1835 :
1836 : /**
1837 : * bd_lvm_thsnapshotcreate:
1838 : * @vg_name: name of the VG containing the thin LV a new snapshot should be created of
1839 : * @origin_name: name of the thin LV a new snapshot should be created of
1840 : * @snapshot_name: name of the to-be-created snapshot
1841 : * @pool_name: (nullable): name of the thin pool to create the snapshot in or %NULL if not specified
1842 : * @extra: (nullable) (array zero-terminated=1): extra options for the thin LV snapshot creation
1843 : * (just passed to LVM as is)
1844 : * @error: (out) (optional): place to store error (if any)
1845 : *
1846 : * Returns: whether the @snapshot_name snapshot of the @vg_name/@origin_name
1847 : * thin LV was successfully created or not.
1848 : *
1849 : * Tech category: %BD_LVM_TECH_THIN-%BD_LVM_TECH_MODE_CREATE
1850 : */
1851 2 : gboolean bd_lvm_thsnapshotcreate (const gchar *vg_name, const gchar *origin_name, const gchar *snapshot_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) {
1852 2 : return _bd_lvm_thsnapshotcreate (vg_name, origin_name, snapshot_name, pool_name, extra, error);
1853 : }
1854 :
1855 :
1856 0 : static gboolean bd_lvm_set_global_config_stub (const gchar *new_config G_GNUC_UNUSED, GError **error) {
1857 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_set_global_config' called, but not implemented!");
1858 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1859 : "The function 'bd_lvm_set_global_config' called, but not implemented!");
1860 0 : return FALSE;
1861 : }
1862 :
1863 : static gboolean (*_bd_lvm_set_global_config) (const gchar *new_config, GError **error) = bd_lvm_set_global_config_stub;
1864 :
1865 : /**
1866 : * bd_lvm_set_global_config:
1867 : * @new_config: (nullable): string representation of the new global libblockdev LVM
1868 : * configuration to set or %NULL to reset to default
1869 : * @error: (out) (optional): place to store error (if any)
1870 : *
1871 : *
1872 : * Note: This function sets configuration options for LVM calls internally
1873 : * in libblockdev, it doesn't change the global lvm.conf config file.
1874 : * Calling this function with `backup {backup=0 archive=0}` for example
1875 : * means `--config=backup {backup=0 archive=0}"` will be added to all
1876 : * calls libblockdev makes.
1877 : *
1878 : * Returns: whether the new requested global config @new_config was successfully
1879 : * set or not
1880 : *
1881 : * Tech category: %BD_LVM_TECH_GLOB_CONF no mode (it is ignored)
1882 : */
1883 34 : gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error) {
1884 34 : return _bd_lvm_set_global_config (new_config, error);
1885 : }
1886 :
1887 :
1888 0 : static gchar* bd_lvm_get_global_config_stub (GError **error) {
1889 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_global_config' called, but not implemented!");
1890 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1891 : "The function 'bd_lvm_get_global_config' called, but not implemented!");
1892 0 : return NULL;
1893 : }
1894 :
1895 : static gchar* (*_bd_lvm_get_global_config) (GError **error) = bd_lvm_get_global_config_stub;
1896 :
1897 : /**
1898 : * bd_lvm_get_global_config:
1899 : * @error: (out) (optional): place to store error (if any)
1900 : *
1901 : * Returns: (transfer full): a copy of a string representation of the currently
1902 : * set libblockdev LVM global configuration
1903 : *
1904 : * Note: This function does not change the global `lvm.conf` config
1905 : * file, see %bd_lvm_set_global_config for details.
1906 : *
1907 : * Tech category: %BD_LVM_TECH_GLOB_CONF no mode (it is ignored)
1908 : */
1909 10 : gchar* bd_lvm_get_global_config (GError **error) {
1910 10 : return _bd_lvm_get_global_config (error);
1911 : }
1912 :
1913 :
1914 0 : static gboolean bd_lvm_set_devices_filter_stub (const gchar **devices G_GNUC_UNUSED, GError **error) {
1915 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_set_devices_filter' called, but not implemented!");
1916 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1917 : "The function 'bd_lvm_set_devices_filter' called, but not implemented!");
1918 0 : return FALSE;
1919 : }
1920 :
1921 : static gboolean (*_bd_lvm_set_devices_filter) (const gchar **devices, GError **error) = bd_lvm_set_devices_filter_stub;
1922 :
1923 : /**
1924 : * bd_lvm_set_devices_filter:
1925 : * @devices: (nullable) (array zero-terminated=1): list of devices for lvm commands to work on
1926 : * @error: (out) (optional): place to store error (if any)
1927 : *
1928 : * Returns: whether the devices filter was successfully set or not
1929 : *
1930 : * Tech category: %BD_LVM_TECH_DEVICES no mode (it is ignored)
1931 : */
1932 12 : gboolean bd_lvm_set_devices_filter (const gchar **devices, GError **error) {
1933 12 : return _bd_lvm_set_devices_filter (devices, error);
1934 : }
1935 :
1936 :
1937 0 : static gchar** bd_lvm_get_devices_filter_stub (GError **error) {
1938 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_devices_filter' called, but not implemented!");
1939 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1940 : "The function 'bd_lvm_get_devices_filter' called, but not implemented!");
1941 0 : return NULL;
1942 : }
1943 :
1944 : static gchar** (*_bd_lvm_get_devices_filter) (GError **error) = bd_lvm_get_devices_filter_stub;
1945 :
1946 : /**
1947 : * bd_lvm_get_devices_filter:
1948 : * @error: (out) (optional): place to store error (if any)
1949 : *
1950 : * Returns: (transfer full) (array zero-terminated=1): a copy of a string representation of
1951 : * the currently set LVM devices filter
1952 : *
1953 : * Tech category: %BD_LVM_TECH_DEVICES no mode (it is ignored)
1954 : */
1955 8 : gchar** bd_lvm_get_devices_filter (GError **error) {
1956 8 : return _bd_lvm_get_devices_filter (error);
1957 : }
1958 :
1959 :
1960 0 : static guint64 bd_lvm_cache_get_default_md_size_stub (guint64 cache_size G_GNUC_UNUSED, GError **error) {
1961 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_get_default_md_size' called, but not implemented!");
1962 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1963 : "The function 'bd_lvm_cache_get_default_md_size' called, but not implemented!");
1964 0 : return 0;
1965 : }
1966 :
1967 : static guint64 (*_bd_lvm_cache_get_default_md_size) (guint64 cache_size, GError **error) = bd_lvm_cache_get_default_md_size_stub;
1968 :
1969 : /**
1970 : * bd_lvm_cache_get_default_md_size:
1971 : * @cache_size: size of the cache to determine MD size for
1972 : * @error: (out) (optional): place to store error (if any)
1973 : *
1974 : * Returns: recommended default size of the cache metadata LV or 0 in case of error
1975 : *
1976 : * Tech category: %BD_LVM_TECH_CACHE_CALCS no mode (it is ignored)
1977 : */
1978 20 : guint64 bd_lvm_cache_get_default_md_size (guint64 cache_size, GError **error) {
1979 20 : return _bd_lvm_cache_get_default_md_size (cache_size, error);
1980 : }
1981 :
1982 :
1983 0 : static const gchar* bd_lvm_cache_get_mode_str_stub (BDLVMCacheMode mode G_GNUC_UNUSED, GError **error) {
1984 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_get_mode_str' called, but not implemented!");
1985 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
1986 : "The function 'bd_lvm_cache_get_mode_str' called, but not implemented!");
1987 0 : return NULL;
1988 : }
1989 :
1990 : static const gchar* (*_bd_lvm_cache_get_mode_str) (BDLVMCacheMode mode, GError **error) = bd_lvm_cache_get_mode_str_stub;
1991 :
1992 : /**
1993 : * bd_lvm_cache_get_mode_str:
1994 : * @mode: mode to get the string representation for
1995 : * @error: (out) (optional): place to store error (if any)
1996 : *
1997 : * Returns: string representation of @mode or %NULL in case of error
1998 : *
1999 : * Tech category: always provided/supported
2000 : */
2001 22 : const gchar* bd_lvm_cache_get_mode_str (BDLVMCacheMode mode, GError **error) {
2002 22 : return _bd_lvm_cache_get_mode_str (mode, error);
2003 : }
2004 :
2005 :
2006 0 : static BDLVMCacheMode bd_lvm_cache_get_mode_from_str_stub (const gchar *mode_str G_GNUC_UNUSED, GError **error) {
2007 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_get_mode_from_str' called, but not implemented!");
2008 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2009 : "The function 'bd_lvm_cache_get_mode_from_str' called, but not implemented!");
2010 0 : return 0;
2011 : }
2012 :
2013 : static BDLVMCacheMode (*_bd_lvm_cache_get_mode_from_str) (const gchar *mode_str, GError **error) = bd_lvm_cache_get_mode_from_str_stub;
2014 :
2015 : /**
2016 : * bd_lvm_cache_get_mode_from_str:
2017 : * @mode_str: string representation of a cache mode
2018 : * @error: (out) (optional): place to store error (if any)
2019 : *
2020 : * Returns: cache mode for the @mode_str or %BD_LVM_CACHE_MODE_UNKNOWN if
2021 : * failed to determine
2022 : *
2023 : * Tech category: always provided/supported
2024 : */
2025 8 : BDLVMCacheMode bd_lvm_cache_get_mode_from_str (const gchar *mode_str, GError **error) {
2026 8 : return _bd_lvm_cache_get_mode_from_str (mode_str, error);
2027 : }
2028 :
2029 :
2030 0 : static gboolean bd_lvm_cache_create_pool_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, guint64 pool_size G_GNUC_UNUSED, guint64 md_size G_GNUC_UNUSED, BDLVMCacheMode mode G_GNUC_UNUSED, BDLVMCachePoolFlags flags G_GNUC_UNUSED, const gchar **fast_pvs G_GNUC_UNUSED, GError **error) {
2031 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_create_pool' called, but not implemented!");
2032 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2033 : "The function 'bd_lvm_cache_create_pool' called, but not implemented!");
2034 0 : return FALSE;
2035 : }
2036 :
2037 : static gboolean (*_bd_lvm_cache_create_pool) (const gchar *vg_name, const gchar *pool_name, guint64 pool_size, guint64 md_size, BDLVMCacheMode mode, BDLVMCachePoolFlags flags, const gchar **fast_pvs, GError **error) = bd_lvm_cache_create_pool_stub;
2038 :
2039 : /**
2040 : * bd_lvm_cache_create_pool:
2041 : * @vg_name: name of the VG to create @pool_name in
2042 : * @pool_name: name of the cache pool LV to create
2043 : * @pool_size: desired size of the cache pool @pool_name
2044 : * @md_size: desired size of the @pool_name cache pool's metadata LV or 0 to
2045 : * use the default
2046 : * @mode: cache mode of the @pool_name cache pool
2047 : * @flags: a combination of (ORed) #BDLVMCachePoolFlags
2048 : * @fast_pvs: (array zero-terminated=1): list of (fast) PVs to create the @pool_name
2049 : * cache pool (and the metadata LV)
2050 : * @error: (out) (optional): place to store error (if any)
2051 : *
2052 : * Returns: whether the cache pool @vg_name/@pool_name was successfully created or not
2053 : *
2054 : * Tech category: %BD_LVM_TECH_CACHE-%BD_LVM_TECH_MODE_CREATE
2055 : */
2056 16 : gboolean bd_lvm_cache_create_pool (const gchar *vg_name, const gchar *pool_name, guint64 pool_size, guint64 md_size, BDLVMCacheMode mode, BDLVMCachePoolFlags flags, const gchar **fast_pvs, GError **error) {
2057 16 : return _bd_lvm_cache_create_pool (vg_name, pool_name, pool_size, md_size, mode, flags, fast_pvs, error);
2058 : }
2059 :
2060 :
2061 0 : static gboolean bd_lvm_cache_attach_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *data_lv G_GNUC_UNUSED, const gchar *cache_pool_lv G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2062 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_attach' called, but not implemented!");
2063 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2064 : "The function 'bd_lvm_cache_attach' called, but not implemented!");
2065 0 : return FALSE;
2066 : }
2067 :
2068 : static gboolean (*_bd_lvm_cache_attach) (const gchar *vg_name, const gchar *data_lv, const gchar *cache_pool_lv, const BDExtraArg **extra, GError **error) = bd_lvm_cache_attach_stub;
2069 :
2070 : /**
2071 : * bd_lvm_cache_attach:
2072 : * @vg_name: name of the VG containing the @data_lv and the @cache_pool_lv LVs
2073 : * @data_lv: data LV to attach the @cache_pool_lv to
2074 : * @cache_pool_lv: cache pool LV to attach to the @data_lv
2075 : * @extra: (nullable) (array zero-terminated=1): extra options for the cache attachment
2076 : * (just passed to LVM as is)
2077 : * @error: (out) (optional): place to store error (if any)
2078 : *
2079 : * Returns: whether the @cache_pool_lv was successfully attached to the @data_lv or not
2080 : *
2081 : * Note: Both @data_lv and @cache_lv will be deactivated before the operation.
2082 : *
2083 : * Tech category: %BD_LVM_TECH_CACHE-%BD_LVM_TECH_MODE_MODIFY
2084 : */
2085 12 : gboolean bd_lvm_cache_attach (const gchar *vg_name, const gchar *data_lv, const gchar *cache_pool_lv, const BDExtraArg **extra, GError **error) {
2086 12 : return _bd_lvm_cache_attach (vg_name, data_lv, cache_pool_lv, extra, error);
2087 : }
2088 :
2089 :
2090 0 : static gboolean bd_lvm_cache_detach_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *cached_lv G_GNUC_UNUSED, gboolean destroy G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2091 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_detach' called, but not implemented!");
2092 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2093 : "The function 'bd_lvm_cache_detach' called, but not implemented!");
2094 0 : return FALSE;
2095 : }
2096 :
2097 : static gboolean (*_bd_lvm_cache_detach) (const gchar *vg_name, const gchar *cached_lv, gboolean destroy, const BDExtraArg **extra, GError **error) = bd_lvm_cache_detach_stub;
2098 :
2099 : /**
2100 : * bd_lvm_cache_detach:
2101 : * @vg_name: name of the VG containing the @cached_lv
2102 : * @cached_lv: name of the cached LV to detach its cache from
2103 : * @destroy: whether to destroy the cache after detach or not
2104 : * @extra: (nullable) (array zero-terminated=1): extra options for the cache detachment
2105 : * (just passed to LVM as is)
2106 : * @error: (out) (optional): place to store error (if any)
2107 : *
2108 : * Returns: whether the cache was successfully detached from the @cached_lv or not
2109 : *
2110 : * Note: synces the cache first
2111 : *
2112 : * Tech category: %BD_LVM_TECH_CACHE-%BD_LVM_TECH_MODE_MODIFY
2113 : */
2114 8 : gboolean bd_lvm_cache_detach (const gchar *vg_name, const gchar *cached_lv, gboolean destroy, const BDExtraArg **extra, GError **error) {
2115 8 : return _bd_lvm_cache_detach (vg_name, cached_lv, destroy, extra, error);
2116 : }
2117 :
2118 :
2119 0 : static gboolean bd_lvm_cache_create_cached_lv_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, guint64 data_size G_GNUC_UNUSED, guint64 cache_size G_GNUC_UNUSED, guint64 md_size G_GNUC_UNUSED, BDLVMCacheMode mode G_GNUC_UNUSED, BDLVMCachePoolFlags flags G_GNUC_UNUSED, const gchar **slow_pvs G_GNUC_UNUSED, const gchar **fast_pvs G_GNUC_UNUSED, GError **error) {
2120 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_create_cached_lv' called, but not implemented!");
2121 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2122 : "The function 'bd_lvm_cache_create_cached_lv' called, but not implemented!");
2123 0 : return FALSE;
2124 : }
2125 :
2126 : static gboolean (*_bd_lvm_cache_create_cached_lv) (const gchar *vg_name, const gchar *lv_name, guint64 data_size, guint64 cache_size, guint64 md_size, BDLVMCacheMode mode, BDLVMCachePoolFlags flags, const gchar **slow_pvs, const gchar **fast_pvs, GError **error) = bd_lvm_cache_create_cached_lv_stub;
2127 :
2128 : /**
2129 : * bd_lvm_cache_create_cached_lv:
2130 : * @vg_name: name of the VG to create a cached LV in
2131 : * @lv_name: name of the cached LV to create
2132 : * @data_size: size of the data LV
2133 : * @cache_size: size of the cache (or cached LV more precisely)
2134 : * @md_size: size of the cache metadata LV or 0 to use the default
2135 : * @mode: cache mode for the cached LV
2136 : * @flags: a combination of (ORed) #BDLVMCachePoolFlags
2137 : * @slow_pvs: (array zero-terminated=1): list of slow PVs (used for the data LV)
2138 : * @fast_pvs: (array zero-terminated=1): list of fast PVs (used for the cache LV)
2139 : * @error: (out) (optional): place to store error (if any)
2140 : *
2141 : * Returns: whether the cached LV @lv_name was successfully created or not
2142 : *
2143 : * Tech category: %BD_LVM_TECH_CACHE-%BD_LVM_TECH_MODE_CREATE
2144 : */
2145 2 : gboolean bd_lvm_cache_create_cached_lv (const gchar *vg_name, const gchar *lv_name, guint64 data_size, guint64 cache_size, guint64 md_size, BDLVMCacheMode mode, BDLVMCachePoolFlags flags, const gchar **slow_pvs, const gchar **fast_pvs, GError **error) {
2146 2 : return _bd_lvm_cache_create_cached_lv (vg_name, lv_name, data_size, cache_size, md_size, mode, flags, slow_pvs, fast_pvs, error);
2147 : }
2148 :
2149 :
2150 0 : static gchar* bd_lvm_cache_pool_name_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *cached_lv G_GNUC_UNUSED, GError **error) {
2151 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_pool_name' called, but not implemented!");
2152 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2153 : "The function 'bd_lvm_cache_pool_name' called, but not implemented!");
2154 0 : return NULL;
2155 : }
2156 :
2157 : static gchar* (*_bd_lvm_cache_pool_name) (const gchar *vg_name, const gchar *cached_lv, GError **error) = bd_lvm_cache_pool_name_stub;
2158 :
2159 : /**
2160 : * bd_lvm_cache_pool_name:
2161 : * @vg_name: name of the VG containing the @cached_lv
2162 : * @cached_lv: cached LV to get the name of the its pool LV for
2163 : * @error: (out) (optional): place to store error (if any)
2164 : *
2165 : * Returns: name of the cache pool LV used by the @cached_lv or %NULL in case of error
2166 : *
2167 : * Tech category: %BD_LVM_TECH_CACHE-%BD_LVM_TECH_MODE_QUERY
2168 : */
2169 6 : gchar* bd_lvm_cache_pool_name (const gchar *vg_name, const gchar *cached_lv, GError **error) {
2170 6 : return _bd_lvm_cache_pool_name (vg_name, cached_lv, error);
2171 : }
2172 :
2173 :
2174 0 : static BDLVMCacheStats* bd_lvm_cache_stats_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *cached_lv G_GNUC_UNUSED, GError **error) {
2175 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_stats' called, but not implemented!");
2176 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2177 : "The function 'bd_lvm_cache_stats' called, but not implemented!");
2178 0 : return NULL;
2179 : }
2180 :
2181 : static BDLVMCacheStats* (*_bd_lvm_cache_stats) (const gchar *vg_name, const gchar *cached_lv, GError **error) = bd_lvm_cache_stats_stub;
2182 :
2183 : /**
2184 : * bd_lvm_cache_stats:
2185 : * @vg_name: name of the VG containing the @cached_lv
2186 : * @cached_lv: cached LV to get stats for
2187 : * @error: (out) (optional): place to store error (if any)
2188 : *
2189 : * Returns: stats for the @cached_lv or %NULL in case of error
2190 : *
2191 : * Tech category: %BD_LVM_TECH_CACHE-%BD_LVM_TECH_MODE_QUERY
2192 : */
2193 6 : BDLVMCacheStats* bd_lvm_cache_stats (const gchar *vg_name, const gchar *cached_lv, GError **error) {
2194 6 : return _bd_lvm_cache_stats (vg_name, cached_lv, error);
2195 : }
2196 :
2197 :
2198 0 : static gboolean bd_lvm_writecache_attach_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *data_lv G_GNUC_UNUSED, const gchar *cache_lv G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2199 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_writecache_attach' called, but not implemented!");
2200 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2201 : "The function 'bd_lvm_writecache_attach' called, but not implemented!");
2202 0 : return FALSE;
2203 : }
2204 :
2205 : static gboolean (*_bd_lvm_writecache_attach) (const gchar *vg_name, const gchar *data_lv, const gchar *cache_lv, const BDExtraArg **extra, GError **error) = bd_lvm_writecache_attach_stub;
2206 :
2207 : /**
2208 : * bd_lvm_writecache_attach:
2209 : * @vg_name: name of the VG containing the @data_lv and the @cache_pool_lv LVs
2210 : * @data_lv: data LV to attach the @cache_lv to
2211 : * @cache_lv: cache (fast) LV to attach to the @data_lv
2212 : * @extra: (nullable) (array zero-terminated=1): extra options for the cache attachment
2213 : * (just passed to LVM as is)
2214 : * @error: (out) (optional): place to store error (if any)
2215 : *
2216 : * Returns: whether the @cache_lv was successfully attached to the @data_lv or not
2217 : *
2218 : * Tech category: %BD_LVM_TECH_WRITECACHE-%BD_LVM_TECH_MODE_MODIFY
2219 : */
2220 6 : gboolean bd_lvm_writecache_attach (const gchar *vg_name, const gchar *data_lv, const gchar *cache_lv, const BDExtraArg **extra, GError **error) {
2221 6 : return _bd_lvm_writecache_attach (vg_name, data_lv, cache_lv, extra, error);
2222 : }
2223 :
2224 :
2225 0 : static gboolean bd_lvm_writecache_detach_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *cached_lv G_GNUC_UNUSED, gboolean destroy G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2226 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_writecache_detach' called, but not implemented!");
2227 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2228 : "The function 'bd_lvm_writecache_detach' called, but not implemented!");
2229 0 : return FALSE;
2230 : }
2231 :
2232 : static gboolean (*_bd_lvm_writecache_detach) (const gchar *vg_name, const gchar *cached_lv, gboolean destroy, const BDExtraArg **extra, GError **error) = bd_lvm_writecache_detach_stub;
2233 :
2234 : /**
2235 : * bd_lvm_writecache_detach:
2236 : * @vg_name: name of the VG containing the @cached_lv
2237 : * @cached_lv: name of the cached LV to detach its cache from
2238 : * @destroy: whether to destroy the cache after detach or not
2239 : * @extra: (nullable) (array zero-terminated=1): extra options for the cache detachment
2240 : * (just passed to LVM as is)
2241 : * @error: (out) (optional): place to store error (if any)
2242 : *
2243 : * Returns: whether the cache was successfully detached from the @cached_lv or not
2244 : *
2245 : * Note: synces the cache first
2246 : *
2247 : * Tech category: %BD_LVM_TECH_WRITECACHE-%BD_LVM_TECH_MODE_MODIFY
2248 : */
2249 4 : gboolean bd_lvm_writecache_detach (const gchar *vg_name, const gchar *cached_lv, gboolean destroy, const BDExtraArg **extra, GError **error) {
2250 4 : return _bd_lvm_writecache_detach (vg_name, cached_lv, destroy, extra, error);
2251 : }
2252 :
2253 :
2254 0 : static gboolean bd_lvm_writecache_create_cached_lv_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, guint64 data_size G_GNUC_UNUSED, guint64 cache_size G_GNUC_UNUSED, const gchar **slow_pvs G_GNUC_UNUSED, const gchar **fast_pvs G_GNUC_UNUSED, GError **error) {
2255 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_writecache_create_cached_lv' called, but not implemented!");
2256 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2257 : "The function 'bd_lvm_writecache_create_cached_lv' called, but not implemented!");
2258 0 : return FALSE;
2259 : }
2260 :
2261 : static gboolean (*_bd_lvm_writecache_create_cached_lv) (const gchar *vg_name, const gchar *lv_name, guint64 data_size, guint64 cache_size, const gchar **slow_pvs, const gchar **fast_pvs, GError **error) = bd_lvm_writecache_create_cached_lv_stub;
2262 :
2263 : /**
2264 : * bd_lvm_writecache_create_cached_lv:
2265 : * @vg_name: name of the VG to create a cached LV in
2266 : * @lv_name: name of the cached LV to create
2267 : * @data_size: size of the data LV
2268 : * @cache_size: size of the cache (or cached LV more precisely)
2269 : * @slow_pvs: (array zero-terminated=1): list of slow PVs (used for the data LV)
2270 : * @fast_pvs: (array zero-terminated=1): list of fast PVs (used for the cache LV)
2271 : * @error: (out) (optional): place to store error (if any)
2272 : *
2273 : * Returns: whether the cached LV @lv_name was successfully created or not
2274 : *
2275 : * Tech category: %BD_LVM_TECH_WRITECACHE-%BD_LVM_TECH_MODE_CREATE
2276 : */
2277 2 : gboolean bd_lvm_writecache_create_cached_lv (const gchar *vg_name, const gchar *lv_name, guint64 data_size, guint64 cache_size, const gchar **slow_pvs, const gchar **fast_pvs, GError **error) {
2278 2 : return _bd_lvm_writecache_create_cached_lv (vg_name, lv_name, data_size, cache_size, slow_pvs, fast_pvs, error);
2279 : }
2280 :
2281 :
2282 0 : static gboolean bd_lvm_thpool_convert_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *data_lv G_GNUC_UNUSED, const gchar *metadata_lv G_GNUC_UNUSED, const gchar *name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2283 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_thpool_convert' called, but not implemented!");
2284 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2285 : "The function 'bd_lvm_thpool_convert' called, but not implemented!");
2286 0 : return FALSE;
2287 : }
2288 :
2289 : static gboolean (*_bd_lvm_thpool_convert) (const gchar *vg_name, const gchar *data_lv, const gchar *metadata_lv, const gchar *name, const BDExtraArg **extra, GError **error) = bd_lvm_thpool_convert_stub;
2290 :
2291 : /**
2292 : * bd_lvm_thpool_convert:
2293 : * @vg_name: name of the VG to create the new thin pool in
2294 : * @data_lv: name of the LV that should become the data part of the new pool
2295 : * @metadata_lv: name of the LV that should become the metadata part of the new pool
2296 : * @name: (nullable): name for the thin pool (if %NULL, the name @data_lv is inherited)
2297 : * @extra: (nullable) (array zero-terminated=1): extra options for the thin pool creation
2298 : * (just passed to LVM as is)
2299 : * @error: (out) (optional): place to store error (if any)
2300 : *
2301 : * Converts the @data_lv and @metadata_lv into a new thin pool in the @vg_name
2302 : * VG.
2303 : *
2304 : * Returns: whether the new thin pool was successfully created from @data_lv and
2305 : * @metadata_lv or not
2306 : *
2307 : * Tech category: %BD_LVM_TECH_THIN-%BD_LVM_TECH_MODE_CREATE
2308 : */
2309 2 : gboolean bd_lvm_thpool_convert (const gchar *vg_name, const gchar *data_lv, const gchar *metadata_lv, const gchar *name, const BDExtraArg **extra, GError **error) {
2310 2 : return _bd_lvm_thpool_convert (vg_name, data_lv, metadata_lv, name, extra, error);
2311 : }
2312 :
2313 :
2314 0 : static gboolean bd_lvm_cache_pool_convert_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *data_lv G_GNUC_UNUSED, const gchar *metadata_lv G_GNUC_UNUSED, const gchar *name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2315 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_cache_pool_convert' called, but not implemented!");
2316 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2317 : "The function 'bd_lvm_cache_pool_convert' called, but not implemented!");
2318 0 : return FALSE;
2319 : }
2320 :
2321 : static gboolean (*_bd_lvm_cache_pool_convert) (const gchar *vg_name, const gchar *data_lv, const gchar *metadata_lv, const gchar *name, const BDExtraArg **extra, GError **error) = bd_lvm_cache_pool_convert_stub;
2322 :
2323 : /**
2324 : * bd_lvm_cache_pool_convert:
2325 : * @vg_name: name of the VG to create the new thin pool in
2326 : * @data_lv: name of the LV that should become the data part of the new pool
2327 : * @metadata_lv: name of the LV that should become the metadata part of the new pool
2328 : * @name: (nullable): name for the thin pool (if %NULL, the name @data_lv is inherited)
2329 : * @extra: (nullable) (array zero-terminated=1): extra options for the thin pool creation
2330 : * (just passed to LVM as is)
2331 : * @error: (out) (optional): place to store error (if any)
2332 : *
2333 : * Converts the @data_lv and @metadata_lv into a new cache pool in the @vg_name
2334 : * VG.
2335 : *
2336 : * Returns: whether the new cache pool was successfully created from @data_lv and
2337 : * @metadata_lv or not
2338 : *
2339 : * Tech category: %BD_LVM_TECH_CACHE-%BD_LVM_TECH_MODE_CREATE
2340 : */
2341 2 : gboolean bd_lvm_cache_pool_convert (const gchar *vg_name, const gchar *data_lv, const gchar *metadata_lv, const gchar *name, const BDExtraArg **extra, GError **error) {
2342 2 : return _bd_lvm_cache_pool_convert (vg_name, data_lv, metadata_lv, name, extra, error);
2343 : }
2344 :
2345 :
2346 0 : static gboolean bd_lvm_vdo_pool_create_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, guint64 data_size G_GNUC_UNUSED, guint64 virtual_size G_GNUC_UNUSED, guint64 index_memory G_GNUC_UNUSED, gboolean compression G_GNUC_UNUSED, gboolean deduplication G_GNUC_UNUSED, BDLVMVDOWritePolicy write_policy G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2347 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_pool_create' called, but not implemented!");
2348 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2349 : "The function 'bd_lvm_vdo_pool_create' called, but not implemented!");
2350 0 : return FALSE;
2351 : }
2352 :
2353 : static gboolean (*_bd_lvm_vdo_pool_create) (const gchar *vg_name, const gchar *lv_name, const gchar *pool_name, guint64 data_size, guint64 virtual_size, guint64 index_memory, gboolean compression, gboolean deduplication, BDLVMVDOWritePolicy write_policy, const BDExtraArg **extra, GError **error) = bd_lvm_vdo_pool_create_stub;
2354 :
2355 : /**
2356 : * bd_lvm_vdo_pool_create:
2357 : * @vg_name: name of the VG to create a new LV in
2358 : * @lv_name: name of the to-be-created VDO LV
2359 : * @pool_name: (nullable): name of the to-be-created VDO pool LV or %NULL for default name
2360 : * @data_size: requested size of the data VDO LV (physical size of the @pool_name VDO pool LV)
2361 : * @virtual_size: requested virtual_size of the @lv_name VDO LV
2362 : * @index_memory: amount of index memory (in bytes) or 0 for default
2363 : * @compression: whether to enable compression or not
2364 : * @deduplication: whether to enable deduplication or not
2365 : * @write_policy: write policy for the volume
2366 : * @extra: (nullable) (array zero-terminated=1): extra options for the VDO LV creation
2367 : * (just passed to LVM as is)
2368 : * @error: (out) (optional): place to store error (if any)
2369 : *
2370 : * Returns: whether the given @vg_name/@lv_name VDO LV was successfully created or not
2371 : *
2372 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_CREATE
2373 : */
2374 14 : gboolean bd_lvm_vdo_pool_create (const gchar *vg_name, const gchar *lv_name, const gchar *pool_name, guint64 data_size, guint64 virtual_size, guint64 index_memory, gboolean compression, gboolean deduplication, BDLVMVDOWritePolicy write_policy, const BDExtraArg **extra, GError **error) {
2375 14 : return _bd_lvm_vdo_pool_create (vg_name, lv_name, pool_name, data_size, virtual_size, index_memory, compression, deduplication, write_policy, extra, error);
2376 : }
2377 :
2378 :
2379 0 : static gboolean bd_lvm_vdo_enable_compression_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2380 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_enable_compression' called, but not implemented!");
2381 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2382 : "The function 'bd_lvm_vdo_enable_compression' called, but not implemented!");
2383 0 : return FALSE;
2384 : }
2385 :
2386 : static gboolean (*_bd_lvm_vdo_enable_compression) (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) = bd_lvm_vdo_enable_compression_stub;
2387 :
2388 : /**
2389 : * bd_lvm_vdo_enable_compression:
2390 : * @vg_name: name of the VG containing the to-be-changed VDO pool LV
2391 : * @pool_name: name of the VDO pool LV to enable compression on
2392 : * @extra: (nullable) (array zero-terminated=1): extra options for the VDO change
2393 : * (just passed to LVM as is)
2394 : * @error: (out) (optional): place to store error (if any)
2395 : *
2396 : * Returns: whether compression was successfully enabled on @vg_name/@pool_name LV or not
2397 : *
2398 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
2399 : */
2400 2 : gboolean bd_lvm_vdo_enable_compression (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) {
2401 2 : return _bd_lvm_vdo_enable_compression (vg_name, pool_name, extra, error);
2402 : }
2403 :
2404 :
2405 0 : static gboolean bd_lvm_vdo_disable_compression_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2406 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_disable_compression' called, but not implemented!");
2407 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2408 : "The function 'bd_lvm_vdo_disable_compression' called, but not implemented!");
2409 0 : return FALSE;
2410 : }
2411 :
2412 : static gboolean (*_bd_lvm_vdo_disable_compression) (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) = bd_lvm_vdo_disable_compression_stub;
2413 :
2414 : /**
2415 : * bd_lvm_vdo_disable_compression:
2416 : * @vg_name: name of the VG containing the to-be-changed VDO pool LV
2417 : * @pool_name: name of the VDO pool LV to disable compression on
2418 : * @extra: (nullable) (array zero-terminated=1): extra options for the VDO change
2419 : * (just passed to LVM as is)
2420 : * @error: (out) (optional): place to store error (if any)
2421 : *
2422 : * Returns: whether compression was successfully disabled on @vg_name/@pool_name LV or not
2423 : *
2424 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
2425 : */
2426 2 : gboolean bd_lvm_vdo_disable_compression (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) {
2427 2 : return _bd_lvm_vdo_disable_compression (vg_name, pool_name, extra, error);
2428 : }
2429 :
2430 :
2431 0 : static gboolean bd_lvm_vdo_enable_deduplication_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2432 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_enable_deduplication' called, but not implemented!");
2433 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2434 : "The function 'bd_lvm_vdo_enable_deduplication' called, but not implemented!");
2435 0 : return FALSE;
2436 : }
2437 :
2438 : static gboolean (*_bd_lvm_vdo_enable_deduplication) (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) = bd_lvm_vdo_enable_deduplication_stub;
2439 :
2440 : /**
2441 : * bd_lvm_vdo_enable_deduplication:
2442 : * @vg_name: name of the VG containing the to-be-changed VDO pool LV
2443 : * @pool_name: name of the VDO pool LV to enable deduplication on
2444 : * @extra: (nullable) (array zero-terminated=1): extra options for the VDO change
2445 : * (just passed to LVM as is)
2446 : * @error: (out) (optional): place to store error (if any)
2447 : *
2448 : * Returns: whether deduplication was successfully enabled on @vg_name/@pool_name LV or not
2449 : *
2450 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
2451 : */
2452 2 : gboolean bd_lvm_vdo_enable_deduplication (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) {
2453 2 : return _bd_lvm_vdo_enable_deduplication (vg_name, pool_name, extra, error);
2454 : }
2455 :
2456 :
2457 0 : static gboolean bd_lvm_vdo_disable_deduplication_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2458 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_disable_deduplication' called, but not implemented!");
2459 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2460 : "The function 'bd_lvm_vdo_disable_deduplication' called, but not implemented!");
2461 0 : return FALSE;
2462 : }
2463 :
2464 : static gboolean (*_bd_lvm_vdo_disable_deduplication) (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) = bd_lvm_vdo_disable_deduplication_stub;
2465 :
2466 : /**
2467 : * bd_lvm_vdo_disable_deduplication:
2468 : * @vg_name: name of the VG containing the to-be-changed VDO pool LV
2469 : * @pool_name: name of the VDO pool LV to disable deduplication on
2470 : * @extra: (nullable) (array zero-terminated=1): extra options for the VDO change
2471 : * (just passed to LVM as is)
2472 : * @error: (out) (optional): place to store error (if any)
2473 : *
2474 : * Returns: whether deduplication was successfully disabled on @vg_name/@pool_name LV or not
2475 : *
2476 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
2477 : */
2478 2 : gboolean bd_lvm_vdo_disable_deduplication (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) {
2479 2 : return _bd_lvm_vdo_disable_deduplication (vg_name, pool_name, extra, error);
2480 : }
2481 :
2482 :
2483 0 : static BDLVMVDOPooldata* bd_lvm_vdo_info_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, GError **error) {
2484 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_info' called, but not implemented!");
2485 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2486 : "The function 'bd_lvm_vdo_info' called, but not implemented!");
2487 0 : return NULL;
2488 : }
2489 :
2490 : static BDLVMVDOPooldata* (*_bd_lvm_vdo_info) (const gchar *vg_name, const gchar *lv_name, GError **error) = bd_lvm_vdo_info_stub;
2491 :
2492 : /**
2493 : * bd_lvm_vdo_info:
2494 : * @vg_name: name of the VG that contains the LV to get information about
2495 : * @lv_name: name of the LV to get information about
2496 : * @error: (out) (optional): place to store error (if any)
2497 : *
2498 : * Returns: (transfer full): information about the @vg_name/@lv_name LV or %NULL in case
2499 : * of error (the @error) gets populated in those cases)
2500 : *
2501 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_QUERY
2502 : */
2503 19 : BDLVMVDOPooldata* bd_lvm_vdo_info (const gchar *vg_name, const gchar *lv_name, GError **error) {
2504 19 : return _bd_lvm_vdo_info (vg_name, lv_name, error);
2505 : }
2506 :
2507 :
2508 0 : static gboolean bd_lvm_vdo_resize_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, guint64 size G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2509 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_resize' called, but not implemented!");
2510 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2511 : "The function 'bd_lvm_vdo_resize' called, but not implemented!");
2512 0 : return FALSE;
2513 : }
2514 :
2515 : static gboolean (*_bd_lvm_vdo_resize) (const gchar *vg_name, const gchar *lv_name, guint64 size, const BDExtraArg **extra, GError **error) = bd_lvm_vdo_resize_stub;
2516 :
2517 : /**
2518 : * bd_lvm_vdo_resize:
2519 : * @vg_name: name of the VG containing the to-be-resized VDO LV
2520 : * @lv_name: name of the to-be-resized VDO LV
2521 : * @size: the requested new size of the VDO LV
2522 : * @extra: (nullable) (array zero-terminated=1): extra options for the VDO LV resize
2523 : * (just passed to LVM as is)
2524 : * @error: (out) (optional): place to store error (if any)
2525 : *
2526 : * Returns: whether the @vg_name/@lv_name VDO LV was successfully resized or not
2527 : *
2528 : * Note: Reduction needs to process TRIM for reduced disk area to unmap used data blocks
2529 : * from the VDO pool LV and it may take a long time.
2530 : *
2531 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
2532 : */
2533 2 : gboolean bd_lvm_vdo_resize (const gchar *vg_name, const gchar *lv_name, guint64 size, const BDExtraArg **extra, GError **error) {
2534 2 : return _bd_lvm_vdo_resize (vg_name, lv_name, size, extra, error);
2535 : }
2536 :
2537 :
2538 0 : static gboolean bd_lvm_vdo_pool_resize_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, guint64 size G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2539 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_pool_resize' called, but not implemented!");
2540 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2541 : "The function 'bd_lvm_vdo_pool_resize' called, but not implemented!");
2542 0 : return FALSE;
2543 : }
2544 :
2545 : static gboolean (*_bd_lvm_vdo_pool_resize) (const gchar *vg_name, const gchar *pool_name, guint64 size, const BDExtraArg **extra, GError **error) = bd_lvm_vdo_pool_resize_stub;
2546 :
2547 : /**
2548 : * bd_lvm_vdo_pool_resize:
2549 : * @vg_name: name of the VG containing the to-be-resized VDO pool LV
2550 : * @pool_name: name of the to-be-resized VDO pool LV
2551 : * @size: the requested new size of the VDO pool LV
2552 : * @extra: (nullable) (array zero-terminated=1): extra options for the VDO pool LV resize
2553 : * (just passed to LVM as is)
2554 : * @error: (out) (optional): place to store error (if any)
2555 : *
2556 : * Returns: whether the @vg_name/@pool_name VDO pool LV was successfully resized or not
2557 : *
2558 : * Note: Size of the VDO pool LV can be only extended, not reduced.
2559 : *
2560 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
2561 : */
2562 4 : gboolean bd_lvm_vdo_pool_resize (const gchar *vg_name, const gchar *pool_name, guint64 size, const BDExtraArg **extra, GError **error) {
2563 4 : return _bd_lvm_vdo_pool_resize (vg_name, pool_name, size, extra, error);
2564 : }
2565 :
2566 :
2567 0 : static gboolean bd_lvm_vdo_pool_convert_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_lv G_GNUC_UNUSED, const gchar *name G_GNUC_UNUSED, guint64 virtual_size G_GNUC_UNUSED, guint64 index_memory G_GNUC_UNUSED, gboolean compression G_GNUC_UNUSED, gboolean deduplication G_GNUC_UNUSED, BDLVMVDOWritePolicy write_policy G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2568 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_pool_convert' called, but not implemented!");
2569 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2570 : "The function 'bd_lvm_vdo_pool_convert' called, but not implemented!");
2571 0 : return FALSE;
2572 : }
2573 :
2574 : static gboolean (*_bd_lvm_vdo_pool_convert) (const gchar *vg_name, const gchar *pool_lv, const gchar *name, guint64 virtual_size, guint64 index_memory, gboolean compression, gboolean deduplication, BDLVMVDOWritePolicy write_policy, const BDExtraArg **extra, GError **error) = bd_lvm_vdo_pool_convert_stub;
2575 :
2576 : /**
2577 : * bd_lvm_vdo_pool_convert:
2578 : * @vg_name: name of the VG that contains @pool_lv
2579 : * @pool_lv: name of the LV that should become the new VDO pool LV
2580 : * @name: (nullable): name for the VDO LV or %NULL for default name
2581 : * @virtual_size: virtual size for the new VDO LV
2582 : * @index_memory: amount of index memory (in bytes) or 0 for default
2583 : * @compression: whether to enable compression or not
2584 : * @deduplication: whether to enable deduplication or not
2585 : * @write_policy: write policy for the volume
2586 : * @extra: (nullable) (array zero-terminated=1): extra options for the VDO pool creation
2587 : * (just passed to LVM as is)
2588 : * @error: (out) (optional): place to store error (if any)
2589 : *
2590 : * Converts the @pool_lv into a new VDO pool LV in the @vg_name VG and creates a new
2591 : * @name VDO LV with size @virtual_size.
2592 : *
2593 : * Note: All data on @pool_lv will be irreversibly destroyed.
2594 : *
2595 : * Returns: whether the new VDO pool LV was successfully created from @pool_lv and or not
2596 : *
2597 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_CREATE&%BD_LVM_TECH_MODE_MODIFY
2598 : */
2599 1 : gboolean bd_lvm_vdo_pool_convert (const gchar *vg_name, const gchar *pool_lv, const gchar *name, guint64 virtual_size, guint64 index_memory, gboolean compression, gboolean deduplication, BDLVMVDOWritePolicy write_policy, const BDExtraArg **extra, GError **error) {
2600 1 : return _bd_lvm_vdo_pool_convert (vg_name, pool_lv, name, virtual_size, index_memory, compression, deduplication, write_policy, extra, error);
2601 : }
2602 :
2603 :
2604 0 : static gchar* bd_lvm_vdolvpoolname_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *lv_name G_GNUC_UNUSED, GError **error) {
2605 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdolvpoolname' called, but not implemented!");
2606 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2607 : "The function 'bd_lvm_vdolvpoolname' called, but not implemented!");
2608 0 : return NULL;
2609 : }
2610 :
2611 : static gchar* (*_bd_lvm_vdolvpoolname) (const gchar *vg_name, const gchar *lv_name, GError **error) = bd_lvm_vdolvpoolname_stub;
2612 :
2613 : /**
2614 : * bd_lvm_vdolvpoolname:
2615 : * @vg_name: name of the VG containing the queried VDO LV
2616 : * @lv_name: name of the queried VDO LV
2617 : * @error: (out) (optional): place to store error (if any)
2618 : *
2619 : * Returns: (transfer full): the name of the pool volume for the @vg_name/@lv_name
2620 : * VDO LV or %NULL if failed to determine (@error) is set in those cases)
2621 : *
2622 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_QUERY
2623 : */
2624 4 : gchar* bd_lvm_vdolvpoolname (const gchar *vg_name, const gchar *lv_name, GError **error) {
2625 4 : return _bd_lvm_vdolvpoolname (vg_name, lv_name, error);
2626 : }
2627 :
2628 :
2629 0 : static const gchar* bd_lvm_get_vdo_operating_mode_str_stub (BDLVMVDOOperatingMode mode G_GNUC_UNUSED, GError **error) {
2630 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_vdo_operating_mode_str' called, but not implemented!");
2631 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2632 : "The function 'bd_lvm_get_vdo_operating_mode_str' called, but not implemented!");
2633 0 : return NULL;
2634 : }
2635 :
2636 : static const gchar* (*_bd_lvm_get_vdo_operating_mode_str) (BDLVMVDOOperatingMode mode, GError **error) = bd_lvm_get_vdo_operating_mode_str_stub;
2637 :
2638 : /**
2639 : * bd_lvm_get_vdo_operating_mode_str:
2640 : * @mode: mode to get the string representation for
2641 : * @error: (out) (optional): place to store error (if any)
2642 : *
2643 : * Returns: string representation of @mode or %NULL in case of error
2644 : *
2645 : * Tech category: always provided/supported
2646 : */
2647 2 : const gchar* bd_lvm_get_vdo_operating_mode_str (BDLVMVDOOperatingMode mode, GError **error) {
2648 2 : return _bd_lvm_get_vdo_operating_mode_str (mode, error);
2649 : }
2650 :
2651 :
2652 0 : static const gchar* bd_lvm_get_vdo_compression_state_str_stub (BDLVMVDOCompressionState state G_GNUC_UNUSED, GError **error) {
2653 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_vdo_compression_state_str' called, but not implemented!");
2654 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2655 : "The function 'bd_lvm_get_vdo_compression_state_str' called, but not implemented!");
2656 0 : return NULL;
2657 : }
2658 :
2659 : static const gchar* (*_bd_lvm_get_vdo_compression_state_str) (BDLVMVDOCompressionState state, GError **error) = bd_lvm_get_vdo_compression_state_str_stub;
2660 :
2661 : /**
2662 : * bd_lvm_get_vdo_compression_state_str:
2663 : * @state: state to get the string representation for
2664 : * @error: (out) (optional): place to store error (if any)
2665 : *
2666 : * Returns: string representation of @state or %NULL in case of error
2667 : *
2668 : * Tech category: always provided/supported
2669 : */
2670 4 : const gchar* bd_lvm_get_vdo_compression_state_str (BDLVMVDOCompressionState state, GError **error) {
2671 4 : return _bd_lvm_get_vdo_compression_state_str (state, error);
2672 : }
2673 :
2674 :
2675 0 : static const gchar* bd_lvm_get_vdo_index_state_str_stub (BDLVMVDOIndexState state G_GNUC_UNUSED, GError **error) {
2676 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_vdo_index_state_str' called, but not implemented!");
2677 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2678 : "The function 'bd_lvm_get_vdo_index_state_str' called, but not implemented!");
2679 0 : return NULL;
2680 : }
2681 :
2682 : static const gchar* (*_bd_lvm_get_vdo_index_state_str) (BDLVMVDOIndexState state, GError **error) = bd_lvm_get_vdo_index_state_str_stub;
2683 :
2684 : /**
2685 : * bd_lvm_get_vdo_index_state_str:
2686 : * @state: state to get the string representation for
2687 : * @error: (out) (optional): place to store error (if any)
2688 : *
2689 : * Returns: string representation of @state or %NULL in case of error
2690 : *
2691 : * Tech category: always provided/supported
2692 : */
2693 0 : const gchar* bd_lvm_get_vdo_index_state_str (BDLVMVDOIndexState state, GError **error) {
2694 0 : return _bd_lvm_get_vdo_index_state_str (state, error);
2695 : }
2696 :
2697 :
2698 0 : static const gchar* bd_lvm_get_vdo_write_policy_str_stub (BDLVMVDOWritePolicy policy G_GNUC_UNUSED, GError **error) {
2699 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_vdo_write_policy_str' called, but not implemented!");
2700 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2701 : "The function 'bd_lvm_get_vdo_write_policy_str' called, but not implemented!");
2702 0 : return NULL;
2703 : }
2704 :
2705 : static const gchar* (*_bd_lvm_get_vdo_write_policy_str) (BDLVMVDOWritePolicy policy, GError **error) = bd_lvm_get_vdo_write_policy_str_stub;
2706 :
2707 : /**
2708 : * bd_lvm_get_vdo_write_policy_str:
2709 : * @policy: policy to get the string representation for
2710 : * @error: (out) (optional): place to store error (if any)
2711 : *
2712 : * Returns: string representation of @policy or %NULL in case of error
2713 : *
2714 : * Tech category: always provided/supported
2715 : */
2716 20 : const gchar* bd_lvm_get_vdo_write_policy_str (BDLVMVDOWritePolicy policy, GError **error) {
2717 20 : return _bd_lvm_get_vdo_write_policy_str (policy, error);
2718 : }
2719 :
2720 :
2721 0 : static BDLVMVDOWritePolicy bd_lvm_get_vdo_write_policy_from_str_stub (const gchar *policy_str G_GNUC_UNUSED, GError **error) {
2722 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_get_vdo_write_policy_from_str' called, but not implemented!");
2723 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2724 : "The function 'bd_lvm_get_vdo_write_policy_from_str' called, but not implemented!");
2725 0 : return 0;
2726 : }
2727 :
2728 : static BDLVMVDOWritePolicy (*_bd_lvm_get_vdo_write_policy_from_str) (const gchar *policy_str, GError **error) = bd_lvm_get_vdo_write_policy_from_str_stub;
2729 :
2730 : /**
2731 : * bd_lvm_get_vdo_write_policy_from_str:
2732 : * @policy_str: string representation of a policy
2733 : * @error: (out) (optional): place to store error (if any)
2734 : *
2735 : * Returns: write policy for the @policy_str or %BD_LVM_VDO_WRITE_POLICY_UNKNOWN if
2736 : * failed to determine
2737 : *
2738 : * Tech category: always provided/supported
2739 : */
2740 2 : BDLVMVDOWritePolicy bd_lvm_get_vdo_write_policy_from_str (const gchar *policy_str, GError **error) {
2741 2 : return _bd_lvm_get_vdo_write_policy_from_str (policy_str, error);
2742 : }
2743 :
2744 :
2745 0 : static GHashTable* bd_lvm_vdo_get_stats_full_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, GError **error) {
2746 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_get_stats_full' called, but not implemented!");
2747 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2748 : "The function 'bd_lvm_vdo_get_stats_full' called, but not implemented!");
2749 0 : return NULL;
2750 : }
2751 :
2752 : static GHashTable* (*_bd_lvm_vdo_get_stats_full) (const gchar *vg_name, const gchar *pool_name, GError **error) = bd_lvm_vdo_get_stats_full_stub;
2753 :
2754 : /**
2755 : * bd_lvm_vdo_get_stats_full:
2756 : * @vg_name: name of the VG that contains @pool_name VDO pool
2757 : * @pool_name: name of the VDO pool to get statistics for
2758 : * @error: (out) (optional): place to store error (if any)
2759 : *
2760 : * Returns: (transfer full) (element-type utf8 utf8): hashtable of type string - string of available
2761 : * statistics or %NULL in case of error
2762 : * (@error gets populated in those cases)
2763 : *
2764 : * Statistics are collected from the values exposed by the kernel `dm-vdo` module.
2765 : *
2766 : * Some of the keys are computed to mimic the information produced by the vdo tools.
2767 : * Please note the contents of the hashtable may vary depending on the actual dm-vdo module version.
2768 : *
2769 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_QUERY
2770 : */
2771 4 : GHashTable* bd_lvm_vdo_get_stats_full (const gchar *vg_name, const gchar *pool_name, GError **error) {
2772 4 : return _bd_lvm_vdo_get_stats_full (vg_name, pool_name, error);
2773 : }
2774 :
2775 :
2776 0 : static BDLVMVDOStats* bd_lvm_vdo_get_stats_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *pool_name G_GNUC_UNUSED, GError **error) {
2777 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vdo_get_stats' called, but not implemented!");
2778 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2779 : "The function 'bd_lvm_vdo_get_stats' called, but not implemented!");
2780 0 : return NULL;
2781 : }
2782 :
2783 : static BDLVMVDOStats* (*_bd_lvm_vdo_get_stats) (const gchar *vg_name, const gchar *pool_name, GError **error) = bd_lvm_vdo_get_stats_stub;
2784 :
2785 : /**
2786 : * bd_lvm_vdo_get_stats:
2787 : * @vg_name: name of the VG that contains @pool_name VDO pool
2788 : * @pool_name: name of the VDO pool to get statistics for
2789 : * @error: (out) (optional): place to store error (if any)
2790 : *
2791 : * Returns: (transfer full): a structure containing selected statistics or %NULL in case of error
2792 : * (@error gets populated in those cases)
2793 : *
2794 : * In contrast to @bd_lvm_vdo_get_stats_full this function will only return selected statistics
2795 : * in a fixed structure. In case a value is not available, -1 would be returned.
2796 : *
2797 : * Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_QUERY
2798 : */
2799 2 : BDLVMVDOStats* bd_lvm_vdo_get_stats (const gchar *vg_name, const gchar *pool_name, GError **error) {
2800 2 : return _bd_lvm_vdo_get_stats (vg_name, pool_name, error);
2801 : }
2802 :
2803 :
2804 0 : static gboolean bd_lvm_devices_add_stub (const gchar *device G_GNUC_UNUSED, const gchar *devices_file G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2805 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_devices_add' called, but not implemented!");
2806 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2807 : "The function 'bd_lvm_devices_add' called, but not implemented!");
2808 0 : return FALSE;
2809 : }
2810 :
2811 : static gboolean (*_bd_lvm_devices_add) (const gchar *device, const gchar *devices_file, const BDExtraArg **extra, GError **error) = bd_lvm_devices_add_stub;
2812 :
2813 : /**
2814 : * bd_lvm_devices_add:
2815 : * @device: device (PV) to add to the devices file
2816 : * @devices_file: (nullable): LVM devices file or %NULL for default
2817 : * @extra: (nullable) (array zero-terminated=1): extra options for the lvmdevices command
2818 : * @error: (out) (optional): place to store error (if any)
2819 : *
2820 : * Returns: whether the @device was successfully added to @devices_file or not
2821 : *
2822 : * Tech category: %BD_LVM_TECH_DEVICES no mode (it is ignored)
2823 : */
2824 6 : gboolean bd_lvm_devices_add (const gchar *device, const gchar *devices_file, const BDExtraArg **extra, GError **error) {
2825 6 : return _bd_lvm_devices_add (device, devices_file, extra, error);
2826 : }
2827 :
2828 :
2829 0 : static gboolean bd_lvm_devices_delete_stub (const gchar *device G_GNUC_UNUSED, const gchar *devices_file G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2830 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_devices_delete' called, but not implemented!");
2831 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2832 : "The function 'bd_lvm_devices_delete' called, but not implemented!");
2833 0 : return FALSE;
2834 : }
2835 :
2836 : static gboolean (*_bd_lvm_devices_delete) (const gchar *device, const gchar *devices_file, const BDExtraArg **extra, GError **error) = bd_lvm_devices_delete_stub;
2837 :
2838 : /**
2839 : * bd_lvm_devices_delete:
2840 : * @device: device (PV) to delete from the devices file
2841 : * @devices_file: (nullable): LVM devices file or %NULL for default
2842 : * @extra: (nullable) (array zero-terminated=1): extra options for the lvmdevices command
2843 : * @error: (out) (optional): place to store error (if any)
2844 : *
2845 : * Returns: whether the @device was successfully removed from @devices_file or not
2846 : *
2847 : * Tech category: %BD_LVM_TECH_DEVICES no mode (it is ignored)
2848 : */
2849 271 : gboolean bd_lvm_devices_delete (const gchar *device, const gchar *devices_file, const BDExtraArg **extra, GError **error) {
2850 271 : return _bd_lvm_devices_delete (device, devices_file, extra, error);
2851 : }
2852 :
2853 :
2854 0 : static gchar* bd_lvm_config_get_stub (const gchar *section G_GNUC_UNUSED, const gchar *setting G_GNUC_UNUSED, const gchar *type G_GNUC_UNUSED, gboolean values_only G_GNUC_UNUSED, gboolean global_config G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2855 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_config_get' called, but not implemented!");
2856 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2857 : "The function 'bd_lvm_config_get' called, but not implemented!");
2858 0 : return NULL;
2859 : }
2860 :
2861 : static gchar* (*_bd_lvm_config_get) (const gchar *section, const gchar *setting, const gchar *type, gboolean values_only, gboolean global_config, const BDExtraArg **extra, GError **error) = bd_lvm_config_get_stub;
2862 :
2863 : /**
2864 : * bd_lvm_config_get:
2865 : * @section: (nullable): LVM config section, e.g. 'global' or %NULL to print the entire config
2866 : * @setting: (nullable): name of the specific setting, e.g. 'umask' or %NULL to print the entire @section
2867 : * @type: type of the config, e.g. 'full' or 'current'
2868 : * @values_only: whether to include only values without keys in the output
2869 : * @global_config: whether to include our internal global config in the call or not
2870 : * @extra: (nullable) (array zero-terminated=1): extra options for the lvmconfig command
2871 : * (just passed to LVM as is)
2872 : * @error: (out) (optional): place to store error (if any)
2873 : *
2874 : * Returns: (transfer full): Requested LVM config @section and @setting configuration or %NULL in case of error.
2875 : *
2876 : * Tech category: %BD_LVM_TECH_CONFIG no mode (it is ignored)
2877 : */
2878 18 : gchar* bd_lvm_config_get (const gchar *section, const gchar *setting, const gchar *type, gboolean values_only, gboolean global_config, const BDExtraArg **extra, GError **error) {
2879 18 : return _bd_lvm_config_get (section, setting, type, values_only, global_config, extra, error);
2880 : }
2881 :
2882 :
2883 0 : static gboolean bd_lvm_vgcfgbackup_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *backup_file G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2884 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgcfgbackup' called, but not implemented!");
2885 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2886 : "The function 'bd_lvm_vgcfgbackup' called, but not implemented!");
2887 0 : return FALSE;
2888 : }
2889 :
2890 : static gboolean (*_bd_lvm_vgcfgbackup) (const gchar *vg_name, const gchar *backup_file, const BDExtraArg **extra, GError **error) = bd_lvm_vgcfgbackup_stub;
2891 :
2892 : /**
2893 : * bd_lvm_vgcfgbackup:
2894 : * @vg_name: name of the VG to backup configuration
2895 : * @backup_file: (nullable): file to save the backup to or %NULL for using the default backup file
2896 : * in /etc/lvm/backup
2897 : * @extra: (nullable) (array zero-terminated=1): extra options for the vgcfgbackup command
2898 : * (just passed to LVM as is)
2899 : * @error: (out) (optional): place to store error (if any)
2900 : *
2901 : * Note: This function does not back up the data content of LVs. See `vgcfbackup(8)` man page
2902 : * for more information.
2903 : *
2904 : * Returns: Whether the backup was successfully created or not.
2905 : *
2906 : * Tech category: %BD_LVM_TECH_VG_CFG_BACKUP_RESTORE no mode (it is ignored)
2907 : */
2908 4 : gboolean bd_lvm_vgcfgbackup (const gchar *vg_name, const gchar *backup_file, const BDExtraArg **extra, GError **error) {
2909 4 : return _bd_lvm_vgcfgbackup (vg_name, backup_file, extra, error);
2910 : }
2911 :
2912 :
2913 0 : static gboolean bd_lvm_vgcfgrestore_stub (const gchar *vg_name G_GNUC_UNUSED, const gchar *backup_file G_GNUC_UNUSED, const BDExtraArg **extra G_GNUC_UNUSED, GError **error) {
2914 0 : bd_utils_log_format (BD_UTILS_LOG_CRIT, "The function 'bd_lvm_vgcfgrestore' called, but not implemented!");
2915 0 : g_set_error (error, BD_INIT_ERROR, BD_INIT_ERROR_NOT_IMPLEMENTED,
2916 : "The function 'bd_lvm_vgcfgrestore' called, but not implemented!");
2917 0 : return FALSE;
2918 : }
2919 :
2920 : static gboolean (*_bd_lvm_vgcfgrestore) (const gchar *vg_name, const gchar *backup_file, const BDExtraArg **extra, GError **error) = bd_lvm_vgcfgrestore_stub;
2921 :
2922 : /**
2923 : * bd_lvm_vgcfgrestore:
2924 : * @vg_name: name of the VG to restore configuration
2925 : * @backup_file: (nullable): file to restore VG configuration from to or %NULL for using the
2926 : * latest backup in /etc/lvm/backup
2927 : * @extra: (nullable) (array zero-terminated=1): extra options for the vgcfgrestore command
2928 : * (just passed to LVM as is)
2929 : * @error: (out) (optional): place to store error (if any)
2930 : *
2931 : * Note: This function restores VG configuration created by %bd_lvm_vgcfgbackup from given
2932 : * @backup_file or from the latest backup in /etc/lvm/backup.
2933 : *
2934 : * Returns: Whether the configuration was successfully restored or not.
2935 : *
2936 : * Tech category: %BD_LVM_TECH_VG_CFG_BACKUP_RESTORE no mode (it is ignored)
2937 : */
2938 4 : gboolean bd_lvm_vgcfgrestore (const gchar *vg_name, const gchar *backup_file, const BDExtraArg **extra, GError **error) {
2939 4 : return _bd_lvm_vgcfgrestore (vg_name, backup_file, extra, error);
2940 : }
2941 :
2942 :
2943 34 : static gpointer load_lvm_from_plugin(const gchar *so_name) {
2944 34 : void *handle = NULL;
2945 34 : char *error = NULL;
2946 34 : gboolean (*init_fn) (void) = NULL;
2947 :
2948 34 : handle = dlopen(so_name, RTLD_LAZY);
2949 34 : if (!handle) {
2950 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load module lvm: %s", dlerror());
2951 0 : return NULL;
2952 : }
2953 :
2954 34 : dlerror();
2955 34 : * (void**) (&init_fn) = dlsym(handle, "bd_lvm_init");
2956 34 : if ((error = dlerror()) != NULL)
2957 0 : bd_utils_log_format (BD_UTILS_LOG_DEBUG, "failed to load the init() function for lvm: %s", error);
2958 : /* coverity[dead_error_condition] */
2959 34 : if (init_fn && !init_fn()) {
2960 0 : dlclose(handle);
2961 0 : return NULL;
2962 : }
2963 34 : init_fn = NULL;
2964 :
2965 34 : dlerror();
2966 34 : * (void**) (&_bd_lvm_is_tech_avail) = dlsym(handle, "bd_lvm_is_tech_avail");
2967 34 : if ((error = dlerror()) != NULL)
2968 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_is_tech_avail: %s", error);
2969 :
2970 34 : dlerror();
2971 34 : * (void**) (&_bd_lvm_is_supported_pe_size) = dlsym(handle, "bd_lvm_is_supported_pe_size");
2972 34 : if ((error = dlerror()) != NULL)
2973 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_is_supported_pe_size: %s", error);
2974 :
2975 34 : dlerror();
2976 34 : * (void**) (&_bd_lvm_get_supported_pe_sizes) = dlsym(handle, "bd_lvm_get_supported_pe_sizes");
2977 34 : if ((error = dlerror()) != NULL)
2978 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_supported_pe_sizes: %s", error);
2979 :
2980 34 : dlerror();
2981 34 : * (void**) (&_bd_lvm_get_max_lv_size) = dlsym(handle, "bd_lvm_get_max_lv_size");
2982 34 : if ((error = dlerror()) != NULL)
2983 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_max_lv_size: %s", error);
2984 :
2985 34 : dlerror();
2986 34 : * (void**) (&_bd_lvm_round_size_to_pe) = dlsym(handle, "bd_lvm_round_size_to_pe");
2987 34 : if ((error = dlerror()) != NULL)
2988 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_round_size_to_pe: %s", error);
2989 :
2990 34 : dlerror();
2991 34 : * (void**) (&_bd_lvm_get_lv_physical_size) = dlsym(handle, "bd_lvm_get_lv_physical_size");
2992 34 : if ((error = dlerror()) != NULL)
2993 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_lv_physical_size: %s", error);
2994 :
2995 34 : dlerror();
2996 34 : * (void**) (&_bd_lvm_get_thpool_padding) = dlsym(handle, "bd_lvm_get_thpool_padding");
2997 34 : if ((error = dlerror()) != NULL)
2998 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_thpool_padding: %s", error);
2999 :
3000 34 : dlerror();
3001 34 : * (void**) (&_bd_lvm_get_thpool_meta_size) = dlsym(handle, "bd_lvm_get_thpool_meta_size");
3002 34 : if ((error = dlerror()) != NULL)
3003 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_thpool_meta_size: %s", error);
3004 :
3005 34 : dlerror();
3006 34 : * (void**) (&_bd_lvm_is_valid_thpool_md_size) = dlsym(handle, "bd_lvm_is_valid_thpool_md_size");
3007 34 : if ((error = dlerror()) != NULL)
3008 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_is_valid_thpool_md_size: %s", error);
3009 :
3010 34 : dlerror();
3011 34 : * (void**) (&_bd_lvm_is_valid_thpool_chunk_size) = dlsym(handle, "bd_lvm_is_valid_thpool_chunk_size");
3012 34 : if ((error = dlerror()) != NULL)
3013 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_is_valid_thpool_chunk_size: %s", error);
3014 :
3015 34 : dlerror();
3016 34 : * (void**) (&_bd_lvm_pvcreate) = dlsym(handle, "bd_lvm_pvcreate");
3017 34 : if ((error = dlerror()) != NULL)
3018 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_pvcreate: %s", error);
3019 :
3020 34 : dlerror();
3021 34 : * (void**) (&_bd_lvm_pvresize) = dlsym(handle, "bd_lvm_pvresize");
3022 34 : if ((error = dlerror()) != NULL)
3023 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_pvresize: %s", error);
3024 :
3025 34 : dlerror();
3026 34 : * (void**) (&_bd_lvm_pvremove) = dlsym(handle, "bd_lvm_pvremove");
3027 34 : if ((error = dlerror()) != NULL)
3028 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_pvremove: %s", error);
3029 :
3030 34 : dlerror();
3031 34 : * (void**) (&_bd_lvm_pvmove) = dlsym(handle, "bd_lvm_pvmove");
3032 34 : if ((error = dlerror()) != NULL)
3033 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_pvmove: %s", error);
3034 :
3035 34 : dlerror();
3036 34 : * (void**) (&_bd_lvm_pvscan) = dlsym(handle, "bd_lvm_pvscan");
3037 34 : if ((error = dlerror()) != NULL)
3038 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_pvscan: %s", error);
3039 :
3040 34 : dlerror();
3041 34 : * (void**) (&_bd_lvm_add_pv_tags) = dlsym(handle, "bd_lvm_add_pv_tags");
3042 34 : if ((error = dlerror()) != NULL)
3043 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_add_pv_tags: %s", error);
3044 :
3045 34 : dlerror();
3046 34 : * (void**) (&_bd_lvm_delete_pv_tags) = dlsym(handle, "bd_lvm_delete_pv_tags");
3047 34 : if ((error = dlerror()) != NULL)
3048 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_delete_pv_tags: %s", error);
3049 :
3050 34 : dlerror();
3051 34 : * (void**) (&_bd_lvm_pvinfo) = dlsym(handle, "bd_lvm_pvinfo");
3052 34 : if ((error = dlerror()) != NULL)
3053 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_pvinfo: %s", error);
3054 :
3055 34 : dlerror();
3056 34 : * (void**) (&_bd_lvm_pvs) = dlsym(handle, "bd_lvm_pvs");
3057 34 : if ((error = dlerror()) != NULL)
3058 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_pvs: %s", error);
3059 :
3060 34 : dlerror();
3061 34 : * (void**) (&_bd_lvm_vgcreate) = dlsym(handle, "bd_lvm_vgcreate");
3062 34 : if ((error = dlerror()) != NULL)
3063 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgcreate: %s", error);
3064 :
3065 34 : dlerror();
3066 34 : * (void**) (&_bd_lvm_vgremove) = dlsym(handle, "bd_lvm_vgremove");
3067 34 : if ((error = dlerror()) != NULL)
3068 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgremove: %s", error);
3069 :
3070 34 : dlerror();
3071 34 : * (void**) (&_bd_lvm_vgrename) = dlsym(handle, "bd_lvm_vgrename");
3072 34 : if ((error = dlerror()) != NULL)
3073 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgrename: %s", error);
3074 :
3075 34 : dlerror();
3076 34 : * (void**) (&_bd_lvm_vgactivate) = dlsym(handle, "bd_lvm_vgactivate");
3077 34 : if ((error = dlerror()) != NULL)
3078 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgactivate: %s", error);
3079 :
3080 34 : dlerror();
3081 34 : * (void**) (&_bd_lvm_vgdeactivate) = dlsym(handle, "bd_lvm_vgdeactivate");
3082 34 : if ((error = dlerror()) != NULL)
3083 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgdeactivate: %s", error);
3084 :
3085 34 : dlerror();
3086 34 : * (void**) (&_bd_lvm_vgextend) = dlsym(handle, "bd_lvm_vgextend");
3087 34 : if ((error = dlerror()) != NULL)
3088 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgextend: %s", error);
3089 :
3090 34 : dlerror();
3091 34 : * (void**) (&_bd_lvm_vgreduce) = dlsym(handle, "bd_lvm_vgreduce");
3092 34 : if ((error = dlerror()) != NULL)
3093 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgreduce: %s", error);
3094 :
3095 34 : dlerror();
3096 34 : * (void**) (&_bd_lvm_add_vg_tags) = dlsym(handle, "bd_lvm_add_vg_tags");
3097 34 : if ((error = dlerror()) != NULL)
3098 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_add_vg_tags: %s", error);
3099 :
3100 34 : dlerror();
3101 34 : * (void**) (&_bd_lvm_delete_vg_tags) = dlsym(handle, "bd_lvm_delete_vg_tags");
3102 34 : if ((error = dlerror()) != NULL)
3103 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_delete_vg_tags: %s", error);
3104 :
3105 34 : dlerror();
3106 34 : * (void**) (&_bd_lvm_vglock_start) = dlsym(handle, "bd_lvm_vglock_start");
3107 34 : if ((error = dlerror()) != NULL)
3108 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vglock_start: %s", error);
3109 :
3110 34 : dlerror();
3111 34 : * (void**) (&_bd_lvm_vglock_stop) = dlsym(handle, "bd_lvm_vglock_stop");
3112 34 : if ((error = dlerror()) != NULL)
3113 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vglock_stop: %s", error);
3114 :
3115 34 : dlerror();
3116 34 : * (void**) (&_bd_lvm_vginfo) = dlsym(handle, "bd_lvm_vginfo");
3117 34 : if ((error = dlerror()) != NULL)
3118 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vginfo: %s", error);
3119 :
3120 34 : dlerror();
3121 34 : * (void**) (&_bd_lvm_vgs) = dlsym(handle, "bd_lvm_vgs");
3122 34 : if ((error = dlerror()) != NULL)
3123 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgs: %s", error);
3124 :
3125 34 : dlerror();
3126 34 : * (void**) (&_bd_lvm_lvorigin) = dlsym(handle, "bd_lvm_lvorigin");
3127 34 : if ((error = dlerror()) != NULL)
3128 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvorigin: %s", error);
3129 :
3130 34 : dlerror();
3131 34 : * (void**) (&_bd_lvm_lvcreate) = dlsym(handle, "bd_lvm_lvcreate");
3132 34 : if ((error = dlerror()) != NULL)
3133 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvcreate: %s", error);
3134 :
3135 34 : dlerror();
3136 34 : * (void**) (&_bd_lvm_lvremove) = dlsym(handle, "bd_lvm_lvremove");
3137 34 : if ((error = dlerror()) != NULL)
3138 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvremove: %s", error);
3139 :
3140 34 : dlerror();
3141 34 : * (void**) (&_bd_lvm_lvrename) = dlsym(handle, "bd_lvm_lvrename");
3142 34 : if ((error = dlerror()) != NULL)
3143 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvrename: %s", error);
3144 :
3145 34 : dlerror();
3146 34 : * (void**) (&_bd_lvm_lvresize) = dlsym(handle, "bd_lvm_lvresize");
3147 34 : if ((error = dlerror()) != NULL)
3148 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvresize: %s", error);
3149 :
3150 34 : dlerror();
3151 34 : * (void**) (&_bd_lvm_lvrepair) = dlsym(handle, "bd_lvm_lvrepair");
3152 34 : if ((error = dlerror()) != NULL)
3153 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvrepair: %s", error);
3154 :
3155 34 : dlerror();
3156 34 : * (void**) (&_bd_lvm_lvactivate) = dlsym(handle, "bd_lvm_lvactivate");
3157 34 : if ((error = dlerror()) != NULL)
3158 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvactivate: %s", error);
3159 :
3160 34 : dlerror();
3161 34 : * (void**) (&_bd_lvm_lvdeactivate) = dlsym(handle, "bd_lvm_lvdeactivate");
3162 34 : if ((error = dlerror()) != NULL)
3163 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvdeactivate: %s", error);
3164 :
3165 34 : dlerror();
3166 34 : * (void**) (&_bd_lvm_lvsnapshotcreate) = dlsym(handle, "bd_lvm_lvsnapshotcreate");
3167 34 : if ((error = dlerror()) != NULL)
3168 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvsnapshotcreate: %s", error);
3169 :
3170 34 : dlerror();
3171 34 : * (void**) (&_bd_lvm_lvsnapshotmerge) = dlsym(handle, "bd_lvm_lvsnapshotmerge");
3172 34 : if ((error = dlerror()) != NULL)
3173 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvsnapshotmerge: %s", error);
3174 :
3175 34 : dlerror();
3176 34 : * (void**) (&_bd_lvm_add_lv_tags) = dlsym(handle, "bd_lvm_add_lv_tags");
3177 34 : if ((error = dlerror()) != NULL)
3178 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_add_lv_tags: %s", error);
3179 :
3180 34 : dlerror();
3181 34 : * (void**) (&_bd_lvm_delete_lv_tags) = dlsym(handle, "bd_lvm_delete_lv_tags");
3182 34 : if ((error = dlerror()) != NULL)
3183 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_delete_lv_tags: %s", error);
3184 :
3185 34 : dlerror();
3186 34 : * (void**) (&_bd_lvm_lvinfo) = dlsym(handle, "bd_lvm_lvinfo");
3187 34 : if ((error = dlerror()) != NULL)
3188 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvinfo: %s", error);
3189 :
3190 34 : dlerror();
3191 34 : * (void**) (&_bd_lvm_lvinfo_tree) = dlsym(handle, "bd_lvm_lvinfo_tree");
3192 34 : if ((error = dlerror()) != NULL)
3193 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvinfo_tree: %s", error);
3194 :
3195 34 : dlerror();
3196 34 : * (void**) (&_bd_lvm_lvs) = dlsym(handle, "bd_lvm_lvs");
3197 34 : if ((error = dlerror()) != NULL)
3198 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvs: %s", error);
3199 :
3200 34 : dlerror();
3201 34 : * (void**) (&_bd_lvm_lvs_tree) = dlsym(handle, "bd_lvm_lvs_tree");
3202 34 : if ((error = dlerror()) != NULL)
3203 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_lvs_tree: %s", error);
3204 :
3205 34 : dlerror();
3206 34 : * (void**) (&_bd_lvm_thpoolcreate) = dlsym(handle, "bd_lvm_thpoolcreate");
3207 34 : if ((error = dlerror()) != NULL)
3208 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_thpoolcreate: %s", error);
3209 :
3210 34 : dlerror();
3211 34 : * (void**) (&_bd_lvm_thlvcreate) = dlsym(handle, "bd_lvm_thlvcreate");
3212 34 : if ((error = dlerror()) != NULL)
3213 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_thlvcreate: %s", error);
3214 :
3215 34 : dlerror();
3216 34 : * (void**) (&_bd_lvm_thlvpoolname) = dlsym(handle, "bd_lvm_thlvpoolname");
3217 34 : if ((error = dlerror()) != NULL)
3218 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_thlvpoolname: %s", error);
3219 :
3220 34 : dlerror();
3221 34 : * (void**) (&_bd_lvm_thsnapshotcreate) = dlsym(handle, "bd_lvm_thsnapshotcreate");
3222 34 : if ((error = dlerror()) != NULL)
3223 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_thsnapshotcreate: %s", error);
3224 :
3225 34 : dlerror();
3226 34 : * (void**) (&_bd_lvm_set_global_config) = dlsym(handle, "bd_lvm_set_global_config");
3227 34 : if ((error = dlerror()) != NULL)
3228 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_set_global_config: %s", error);
3229 :
3230 34 : dlerror();
3231 34 : * (void**) (&_bd_lvm_get_global_config) = dlsym(handle, "bd_lvm_get_global_config");
3232 34 : if ((error = dlerror()) != NULL)
3233 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_global_config: %s", error);
3234 :
3235 34 : dlerror();
3236 34 : * (void**) (&_bd_lvm_set_devices_filter) = dlsym(handle, "bd_lvm_set_devices_filter");
3237 34 : if ((error = dlerror()) != NULL)
3238 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_set_devices_filter: %s", error);
3239 :
3240 34 : dlerror();
3241 34 : * (void**) (&_bd_lvm_get_devices_filter) = dlsym(handle, "bd_lvm_get_devices_filter");
3242 34 : if ((error = dlerror()) != NULL)
3243 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_devices_filter: %s", error);
3244 :
3245 34 : dlerror();
3246 34 : * (void**) (&_bd_lvm_cache_get_default_md_size) = dlsym(handle, "bd_lvm_cache_get_default_md_size");
3247 34 : if ((error = dlerror()) != NULL)
3248 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_get_default_md_size: %s", error);
3249 :
3250 34 : dlerror();
3251 34 : * (void**) (&_bd_lvm_cache_get_mode_str) = dlsym(handle, "bd_lvm_cache_get_mode_str");
3252 34 : if ((error = dlerror()) != NULL)
3253 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_get_mode_str: %s", error);
3254 :
3255 34 : dlerror();
3256 34 : * (void**) (&_bd_lvm_cache_get_mode_from_str) = dlsym(handle, "bd_lvm_cache_get_mode_from_str");
3257 34 : if ((error = dlerror()) != NULL)
3258 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_get_mode_from_str: %s", error);
3259 :
3260 34 : dlerror();
3261 34 : * (void**) (&_bd_lvm_cache_create_pool) = dlsym(handle, "bd_lvm_cache_create_pool");
3262 34 : if ((error = dlerror()) != NULL)
3263 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_create_pool: %s", error);
3264 :
3265 34 : dlerror();
3266 34 : * (void**) (&_bd_lvm_cache_attach) = dlsym(handle, "bd_lvm_cache_attach");
3267 34 : if ((error = dlerror()) != NULL)
3268 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_attach: %s", error);
3269 :
3270 34 : dlerror();
3271 34 : * (void**) (&_bd_lvm_cache_detach) = dlsym(handle, "bd_lvm_cache_detach");
3272 34 : if ((error = dlerror()) != NULL)
3273 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_detach: %s", error);
3274 :
3275 34 : dlerror();
3276 34 : * (void**) (&_bd_lvm_cache_create_cached_lv) = dlsym(handle, "bd_lvm_cache_create_cached_lv");
3277 34 : if ((error = dlerror()) != NULL)
3278 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_create_cached_lv: %s", error);
3279 :
3280 34 : dlerror();
3281 34 : * (void**) (&_bd_lvm_cache_pool_name) = dlsym(handle, "bd_lvm_cache_pool_name");
3282 34 : if ((error = dlerror()) != NULL)
3283 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_pool_name: %s", error);
3284 :
3285 34 : dlerror();
3286 34 : * (void**) (&_bd_lvm_cache_stats) = dlsym(handle, "bd_lvm_cache_stats");
3287 34 : if ((error = dlerror()) != NULL)
3288 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_stats: %s", error);
3289 :
3290 34 : dlerror();
3291 34 : * (void**) (&_bd_lvm_writecache_attach) = dlsym(handle, "bd_lvm_writecache_attach");
3292 34 : if ((error = dlerror()) != NULL)
3293 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_writecache_attach: %s", error);
3294 :
3295 34 : dlerror();
3296 34 : * (void**) (&_bd_lvm_writecache_detach) = dlsym(handle, "bd_lvm_writecache_detach");
3297 34 : if ((error = dlerror()) != NULL)
3298 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_writecache_detach: %s", error);
3299 :
3300 34 : dlerror();
3301 34 : * (void**) (&_bd_lvm_writecache_create_cached_lv) = dlsym(handle, "bd_lvm_writecache_create_cached_lv");
3302 34 : if ((error = dlerror()) != NULL)
3303 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_writecache_create_cached_lv: %s", error);
3304 :
3305 34 : dlerror();
3306 34 : * (void**) (&_bd_lvm_thpool_convert) = dlsym(handle, "bd_lvm_thpool_convert");
3307 34 : if ((error = dlerror()) != NULL)
3308 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_thpool_convert: %s", error);
3309 :
3310 34 : dlerror();
3311 34 : * (void**) (&_bd_lvm_cache_pool_convert) = dlsym(handle, "bd_lvm_cache_pool_convert");
3312 34 : if ((error = dlerror()) != NULL)
3313 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_cache_pool_convert: %s", error);
3314 :
3315 34 : dlerror();
3316 34 : * (void**) (&_bd_lvm_vdo_pool_create) = dlsym(handle, "bd_lvm_vdo_pool_create");
3317 34 : if ((error = dlerror()) != NULL)
3318 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_pool_create: %s", error);
3319 :
3320 34 : dlerror();
3321 34 : * (void**) (&_bd_lvm_vdo_enable_compression) = dlsym(handle, "bd_lvm_vdo_enable_compression");
3322 34 : if ((error = dlerror()) != NULL)
3323 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_enable_compression: %s", error);
3324 :
3325 34 : dlerror();
3326 34 : * (void**) (&_bd_lvm_vdo_disable_compression) = dlsym(handle, "bd_lvm_vdo_disable_compression");
3327 34 : if ((error = dlerror()) != NULL)
3328 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_disable_compression: %s", error);
3329 :
3330 34 : dlerror();
3331 34 : * (void**) (&_bd_lvm_vdo_enable_deduplication) = dlsym(handle, "bd_lvm_vdo_enable_deduplication");
3332 34 : if ((error = dlerror()) != NULL)
3333 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_enable_deduplication: %s", error);
3334 :
3335 34 : dlerror();
3336 34 : * (void**) (&_bd_lvm_vdo_disable_deduplication) = dlsym(handle, "bd_lvm_vdo_disable_deduplication");
3337 34 : if ((error = dlerror()) != NULL)
3338 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_disable_deduplication: %s", error);
3339 :
3340 34 : dlerror();
3341 34 : * (void**) (&_bd_lvm_vdo_info) = dlsym(handle, "bd_lvm_vdo_info");
3342 34 : if ((error = dlerror()) != NULL)
3343 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_info: %s", error);
3344 :
3345 34 : dlerror();
3346 34 : * (void**) (&_bd_lvm_vdo_resize) = dlsym(handle, "bd_lvm_vdo_resize");
3347 34 : if ((error = dlerror()) != NULL)
3348 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_resize: %s", error);
3349 :
3350 34 : dlerror();
3351 34 : * (void**) (&_bd_lvm_vdo_pool_resize) = dlsym(handle, "bd_lvm_vdo_pool_resize");
3352 34 : if ((error = dlerror()) != NULL)
3353 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_pool_resize: %s", error);
3354 :
3355 34 : dlerror();
3356 34 : * (void**) (&_bd_lvm_vdo_pool_convert) = dlsym(handle, "bd_lvm_vdo_pool_convert");
3357 34 : if ((error = dlerror()) != NULL)
3358 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_pool_convert: %s", error);
3359 :
3360 34 : dlerror();
3361 34 : * (void**) (&_bd_lvm_vdolvpoolname) = dlsym(handle, "bd_lvm_vdolvpoolname");
3362 34 : if ((error = dlerror()) != NULL)
3363 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdolvpoolname: %s", error);
3364 :
3365 34 : dlerror();
3366 34 : * (void**) (&_bd_lvm_get_vdo_operating_mode_str) = dlsym(handle, "bd_lvm_get_vdo_operating_mode_str");
3367 34 : if ((error = dlerror()) != NULL)
3368 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_vdo_operating_mode_str: %s", error);
3369 :
3370 34 : dlerror();
3371 34 : * (void**) (&_bd_lvm_get_vdo_compression_state_str) = dlsym(handle, "bd_lvm_get_vdo_compression_state_str");
3372 34 : if ((error = dlerror()) != NULL)
3373 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_vdo_compression_state_str: %s", error);
3374 :
3375 34 : dlerror();
3376 34 : * (void**) (&_bd_lvm_get_vdo_index_state_str) = dlsym(handle, "bd_lvm_get_vdo_index_state_str");
3377 34 : if ((error = dlerror()) != NULL)
3378 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_vdo_index_state_str: %s", error);
3379 :
3380 34 : dlerror();
3381 34 : * (void**) (&_bd_lvm_get_vdo_write_policy_str) = dlsym(handle, "bd_lvm_get_vdo_write_policy_str");
3382 34 : if ((error = dlerror()) != NULL)
3383 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_vdo_write_policy_str: %s", error);
3384 :
3385 34 : dlerror();
3386 34 : * (void**) (&_bd_lvm_get_vdo_write_policy_from_str) = dlsym(handle, "bd_lvm_get_vdo_write_policy_from_str");
3387 34 : if ((error = dlerror()) != NULL)
3388 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_get_vdo_write_policy_from_str: %s", error);
3389 :
3390 34 : dlerror();
3391 34 : * (void**) (&_bd_lvm_vdo_get_stats_full) = dlsym(handle, "bd_lvm_vdo_get_stats_full");
3392 34 : if ((error = dlerror()) != NULL)
3393 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_get_stats_full: %s", error);
3394 :
3395 34 : dlerror();
3396 34 : * (void**) (&_bd_lvm_vdo_get_stats) = dlsym(handle, "bd_lvm_vdo_get_stats");
3397 34 : if ((error = dlerror()) != NULL)
3398 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vdo_get_stats: %s", error);
3399 :
3400 34 : dlerror();
3401 34 : * (void**) (&_bd_lvm_devices_add) = dlsym(handle, "bd_lvm_devices_add");
3402 34 : if ((error = dlerror()) != NULL)
3403 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_devices_add: %s", error);
3404 :
3405 34 : dlerror();
3406 34 : * (void**) (&_bd_lvm_devices_delete) = dlsym(handle, "bd_lvm_devices_delete");
3407 34 : if ((error = dlerror()) != NULL)
3408 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_devices_delete: %s", error);
3409 :
3410 34 : dlerror();
3411 34 : * (void**) (&_bd_lvm_config_get) = dlsym(handle, "bd_lvm_config_get");
3412 34 : if ((error = dlerror()) != NULL)
3413 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_config_get: %s", error);
3414 :
3415 34 : dlerror();
3416 34 : * (void**) (&_bd_lvm_vgcfgbackup) = dlsym(handle, "bd_lvm_vgcfgbackup");
3417 34 : if ((error = dlerror()) != NULL)
3418 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgcfgbackup: %s", error);
3419 :
3420 34 : dlerror();
3421 34 : * (void**) (&_bd_lvm_vgcfgrestore) = dlsym(handle, "bd_lvm_vgcfgrestore");
3422 34 : if ((error = dlerror()) != NULL)
3423 0 : bd_utils_log_format (BD_UTILS_LOG_WARNING, "failed to load bd_lvm_vgcfgrestore: %s", error);
3424 :
3425 34 : return handle;
3426 : }
3427 :
3428 34 : static gboolean unload_lvm (gpointer handle) {
3429 34 : char *error = NULL;
3430 34 : gboolean (*close_fn) (void) = NULL;
3431 :
3432 34 : _bd_lvm_is_tech_avail = bd_lvm_is_tech_avail_stub;
3433 34 : _bd_lvm_is_supported_pe_size = bd_lvm_is_supported_pe_size_stub;
3434 34 : _bd_lvm_get_supported_pe_sizes = bd_lvm_get_supported_pe_sizes_stub;
3435 34 : _bd_lvm_get_max_lv_size = bd_lvm_get_max_lv_size_stub;
3436 34 : _bd_lvm_round_size_to_pe = bd_lvm_round_size_to_pe_stub;
3437 34 : _bd_lvm_get_lv_physical_size = bd_lvm_get_lv_physical_size_stub;
3438 34 : _bd_lvm_get_thpool_padding = bd_lvm_get_thpool_padding_stub;
3439 34 : _bd_lvm_get_thpool_meta_size = bd_lvm_get_thpool_meta_size_stub;
3440 34 : _bd_lvm_is_valid_thpool_md_size = bd_lvm_is_valid_thpool_md_size_stub;
3441 34 : _bd_lvm_is_valid_thpool_chunk_size = bd_lvm_is_valid_thpool_chunk_size_stub;
3442 34 : _bd_lvm_pvcreate = bd_lvm_pvcreate_stub;
3443 34 : _bd_lvm_pvresize = bd_lvm_pvresize_stub;
3444 34 : _bd_lvm_pvremove = bd_lvm_pvremove_stub;
3445 34 : _bd_lvm_pvmove = bd_lvm_pvmove_stub;
3446 34 : _bd_lvm_pvscan = bd_lvm_pvscan_stub;
3447 34 : _bd_lvm_add_pv_tags = bd_lvm_add_pv_tags_stub;
3448 34 : _bd_lvm_delete_pv_tags = bd_lvm_delete_pv_tags_stub;
3449 34 : _bd_lvm_pvinfo = bd_lvm_pvinfo_stub;
3450 34 : _bd_lvm_pvs = bd_lvm_pvs_stub;
3451 34 : _bd_lvm_vgcreate = bd_lvm_vgcreate_stub;
3452 34 : _bd_lvm_vgremove = bd_lvm_vgremove_stub;
3453 34 : _bd_lvm_vgrename = bd_lvm_vgrename_stub;
3454 34 : _bd_lvm_vgactivate = bd_lvm_vgactivate_stub;
3455 34 : _bd_lvm_vgdeactivate = bd_lvm_vgdeactivate_stub;
3456 34 : _bd_lvm_vgextend = bd_lvm_vgextend_stub;
3457 34 : _bd_lvm_vgreduce = bd_lvm_vgreduce_stub;
3458 34 : _bd_lvm_add_vg_tags = bd_lvm_add_vg_tags_stub;
3459 34 : _bd_lvm_delete_vg_tags = bd_lvm_delete_vg_tags_stub;
3460 34 : _bd_lvm_vglock_start = bd_lvm_vglock_start_stub;
3461 34 : _bd_lvm_vglock_stop = bd_lvm_vglock_stop_stub;
3462 34 : _bd_lvm_vginfo = bd_lvm_vginfo_stub;
3463 34 : _bd_lvm_vgs = bd_lvm_vgs_stub;
3464 34 : _bd_lvm_lvorigin = bd_lvm_lvorigin_stub;
3465 34 : _bd_lvm_lvcreate = bd_lvm_lvcreate_stub;
3466 34 : _bd_lvm_lvremove = bd_lvm_lvremove_stub;
3467 34 : _bd_lvm_lvrename = bd_lvm_lvrename_stub;
3468 34 : _bd_lvm_lvresize = bd_lvm_lvresize_stub;
3469 34 : _bd_lvm_lvrepair = bd_lvm_lvrepair_stub;
3470 34 : _bd_lvm_lvactivate = bd_lvm_lvactivate_stub;
3471 34 : _bd_lvm_lvdeactivate = bd_lvm_lvdeactivate_stub;
3472 34 : _bd_lvm_lvsnapshotcreate = bd_lvm_lvsnapshotcreate_stub;
3473 34 : _bd_lvm_lvsnapshotmerge = bd_lvm_lvsnapshotmerge_stub;
3474 34 : _bd_lvm_add_lv_tags = bd_lvm_add_lv_tags_stub;
3475 34 : _bd_lvm_delete_lv_tags = bd_lvm_delete_lv_tags_stub;
3476 34 : _bd_lvm_lvinfo = bd_lvm_lvinfo_stub;
3477 34 : _bd_lvm_lvinfo_tree = bd_lvm_lvinfo_tree_stub;
3478 34 : _bd_lvm_lvs = bd_lvm_lvs_stub;
3479 34 : _bd_lvm_lvs_tree = bd_lvm_lvs_tree_stub;
3480 34 : _bd_lvm_thpoolcreate = bd_lvm_thpoolcreate_stub;
3481 34 : _bd_lvm_thlvcreate = bd_lvm_thlvcreate_stub;
3482 34 : _bd_lvm_thlvpoolname = bd_lvm_thlvpoolname_stub;
3483 34 : _bd_lvm_thsnapshotcreate = bd_lvm_thsnapshotcreate_stub;
3484 34 : _bd_lvm_set_global_config = bd_lvm_set_global_config_stub;
3485 34 : _bd_lvm_get_global_config = bd_lvm_get_global_config_stub;
3486 34 : _bd_lvm_set_devices_filter = bd_lvm_set_devices_filter_stub;
3487 34 : _bd_lvm_get_devices_filter = bd_lvm_get_devices_filter_stub;
3488 34 : _bd_lvm_cache_get_default_md_size = bd_lvm_cache_get_default_md_size_stub;
3489 34 : _bd_lvm_cache_get_mode_str = bd_lvm_cache_get_mode_str_stub;
3490 34 : _bd_lvm_cache_get_mode_from_str = bd_lvm_cache_get_mode_from_str_stub;
3491 34 : _bd_lvm_cache_create_pool = bd_lvm_cache_create_pool_stub;
3492 34 : _bd_lvm_cache_attach = bd_lvm_cache_attach_stub;
3493 34 : _bd_lvm_cache_detach = bd_lvm_cache_detach_stub;
3494 34 : _bd_lvm_cache_create_cached_lv = bd_lvm_cache_create_cached_lv_stub;
3495 34 : _bd_lvm_cache_pool_name = bd_lvm_cache_pool_name_stub;
3496 34 : _bd_lvm_cache_stats = bd_lvm_cache_stats_stub;
3497 34 : _bd_lvm_writecache_attach = bd_lvm_writecache_attach_stub;
3498 34 : _bd_lvm_writecache_detach = bd_lvm_writecache_detach_stub;
3499 34 : _bd_lvm_writecache_create_cached_lv = bd_lvm_writecache_create_cached_lv_stub;
3500 34 : _bd_lvm_thpool_convert = bd_lvm_thpool_convert_stub;
3501 34 : _bd_lvm_cache_pool_convert = bd_lvm_cache_pool_convert_stub;
3502 34 : _bd_lvm_vdo_pool_create = bd_lvm_vdo_pool_create_stub;
3503 34 : _bd_lvm_vdo_enable_compression = bd_lvm_vdo_enable_compression_stub;
3504 34 : _bd_lvm_vdo_disable_compression = bd_lvm_vdo_disable_compression_stub;
3505 34 : _bd_lvm_vdo_enable_deduplication = bd_lvm_vdo_enable_deduplication_stub;
3506 34 : _bd_lvm_vdo_disable_deduplication = bd_lvm_vdo_disable_deduplication_stub;
3507 34 : _bd_lvm_vdo_info = bd_lvm_vdo_info_stub;
3508 34 : _bd_lvm_vdo_resize = bd_lvm_vdo_resize_stub;
3509 34 : _bd_lvm_vdo_pool_resize = bd_lvm_vdo_pool_resize_stub;
3510 34 : _bd_lvm_vdo_pool_convert = bd_lvm_vdo_pool_convert_stub;
3511 34 : _bd_lvm_vdolvpoolname = bd_lvm_vdolvpoolname_stub;
3512 34 : _bd_lvm_get_vdo_operating_mode_str = bd_lvm_get_vdo_operating_mode_str_stub;
3513 34 : _bd_lvm_get_vdo_compression_state_str = bd_lvm_get_vdo_compression_state_str_stub;
3514 34 : _bd_lvm_get_vdo_index_state_str = bd_lvm_get_vdo_index_state_str_stub;
3515 34 : _bd_lvm_get_vdo_write_policy_str = bd_lvm_get_vdo_write_policy_str_stub;
3516 34 : _bd_lvm_get_vdo_write_policy_from_str = bd_lvm_get_vdo_write_policy_from_str_stub;
3517 34 : _bd_lvm_vdo_get_stats_full = bd_lvm_vdo_get_stats_full_stub;
3518 34 : _bd_lvm_vdo_get_stats = bd_lvm_vdo_get_stats_stub;
3519 34 : _bd_lvm_devices_add = bd_lvm_devices_add_stub;
3520 34 : _bd_lvm_devices_delete = bd_lvm_devices_delete_stub;
3521 34 : _bd_lvm_config_get = bd_lvm_config_get_stub;
3522 34 : _bd_lvm_vgcfgbackup = bd_lvm_vgcfgbackup_stub;
3523 34 : _bd_lvm_vgcfgrestore = bd_lvm_vgcfgrestore_stub;
3524 :
3525 34 : dlerror();
3526 34 : * (void**) (&close_fn) = dlsym(handle, "bd_lvm_close");
3527 34 : if (((error = dlerror()) != NULL) || !close_fn)
3528 0 : bd_utils_log_format (BD_UTILS_LOG_DEBUG, "failed to load the close_plugin() function for lvm: %s", error);
3529 : /* coverity[dead_error_condition] */
3530 34 : if (close_fn) {
3531 34 : close_fn();
3532 : }
3533 :
3534 34 : return dlclose(handle) == 0;
3535 : }
3536 :
|