## VDO VDO — DEPRECATED plugin for operations with VDO devices |

## Functions

gboolean | bd_vdo_check_deps ()
gboolean | bd_vdo_init ()
void | bd_vdo_close ()
GQuark | bd_vdo_error_quark ()
const gchar * | bd_vdo_get_write_policy_str ()
BDVDOWritePolicy | bd_vdo_get_write_policy_from_str ()
BDVDOInfo * | bd_vdo_info ()
gboolean | bd_vdo_create ()
gboolean | bd_vdo_remove ()
gboolean | bd_vdo_change_write_policy ()
gboolean | bd_vdo_enable_compression ()
gboolean | bd_vdo_disable_compression ()
gboolean | bd_vdo_enable_deduplication ()
gboolean | bd_vdo_disable_deduplication ()
gboolean | bd_vdo_activate ()
gboolean | bd_vdo_deactivate ()
gboolean | bd_vdo_start ()
gboolean | bd_vdo_stop ()
gboolean | bd_vdo_grow_logical ()
gboolean | bd_vdo_grow_physical ()
BDVDOStats * | bd_vdo_get_stats ()
GHashTable * | bd_vdo_get_stats_full ()
gboolean | bd_vdo_is_tech_avail ()

## Types and Values

enum | BDVDOError
#define | BD_VDO_ERROR
| BDVDOInfo
| BDVDOStats
enum | BDVDOTech
enum | BDVDOTechMode

## Includes

    #include <vdo.h>

## Description

A plugin for operations with VDO devices.

This plugin has been deprecated since version 2.24 and should not be used in newly-written code. Use LVM-VDO integration instead.

## Functions

### bd_vdo_check_deps ()

    gboolean
    bd_vdo_check_deps (void);

`bd_vdo_check_deps` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Returns

whether the plugin's runtime dependencies are satisfied or not

Function checking plugin's runtime dependencies.

### bd_vdo_init ()

    gboolean
    bd_vdo_init (void);

`bd_vdo_init` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

Initializes the plugin. **This function is called automatically by the library's initialization functions.**

### bd_vdo_close ()

    void
    bd_vdo_close (void);

`bd_vdo_close` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

Cleans up after the plugin. **This function is called automatically by the library's functions that unload it.**

### bd_vdo_error_quark ()

    GQuark
    bd_vdo_error_quark (void);

[skip]

### bd_vdo_get_write_policy_str ()

    const gchar *
    bd_vdo_get_write_policy_str (BDVDOWritePolicy policy,
                                 GError **error);

`bd_vdo_get_write_policy_str` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

policy | policy to get the string representation for |
error | place to store error (if any). | [out]

#### Returns

string representation of `policy` or `NULL` in case of error

Tech category: always provided/supported

### bd_vdo_get_write_policy_from_str ()

    BDVDOWritePolicy
    bd_vdo_get_write_policy_from_str (const gchar *policy_str,
                                      GError **error);

`bd_vdo_get_write_policy_from_str` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

policy_str | string representation of a write policy mode |
error | place to store error (if any). | [out]

#### Returns

write policy for the `mode_str` or `BD_VDO_WRITE_POLICY_UNKNOWN` if failed to determine

Tech category: always provided/supported

### bd_vdo_info ()

    BDVDOInfo *
    bd_vdo_info (const gchar *name,
                 GError **error);

`bd_vdo_info` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | a VDO volume to get information about |
error | place to store error (if any). | [out]

#### Returns

information about the VDO volume or `NULL` in case of error (`error` gets populated in those cases)

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_QUERY`.

[transfer full]

### bd_vdo_create ()

    gboolean
    bd_vdo_create (const gchar *name,
                   const gchar *backing_device,
                   guint64 logical_size,
                   guint64 index_memory,
                   gboolean compression,
                   gboolean deduplication,
                   BDVDOWritePolicy write_policy,
                   const BDExtraArg **extra,
                   GError **error);

`bd_vdo_create` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name for the VDO volume |
backing_device | device to use for VDO storage |
logical_size | logical VDO volume size or 0 for default (size of `backing_device` ) |
index_memory | amount of index memory or 0 for default; note that only some sizes are valid here (0.25, 0.5 and 0.75 GB and integer multiples of 1 GB) invalid sizes will be rounded DOWN to nearest GB (or one of the allowed decimal values) |
compression | whether to enable compression or not |
deduplication | whether to enable deduplication or not |
write_policy | write policy for the volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the VDO volume was successfully created or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_CREATE`

### bd_vdo_remove ()

    gboolean
    bd_vdo_remove (const gchar *name,
                   gboolean force,
                   const BDExtraArg **extra,
                   GError **error);

`bd_vdo_remove` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
force | force remove the volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the VDO volume was successfully removed or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_MODIFY`

### bd_vdo_change_write_policy ()

    gboolean
    bd_vdo_change_write_policy (const gchar *name,
                                BDVDOWritePolicy write_policy,
                                const BDExtraArg **extra,
                                GError **error);

`bd_vdo_change_write_policy` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
write_policy | new write policy for the volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the policy was successfully changed or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_MODIFY`

### bd_vdo_enable_compression ()

    gboolean
    bd_vdo_enable_compression (const gchar *name,
                               const BDExtraArg **extra,
                               GError **error);

`bd_vdo_enable_compression` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the compression was successfully enabled or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_MODIFY`

### bd_vdo_disable_compression ()

    gboolean
    bd_vdo_disable_compression (const gchar *name,
                                const BDExtraArg **extra,
                                GError **error);

`bd_vdo_disable_compression` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the compression was successfully disabled or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_MODIFY`

### bd_vdo_enable_deduplication ()

    gboolean
    bd_vdo_enable_deduplication (const gchar *name,
                                 const BDExtraArg **extra,
                                 GError **error);

`bd_vdo_enable_deduplication` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the deduplication was successfully enabled or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_MODIFY`

### bd_vdo_disable_deduplication ()

    gboolean
    bd_vdo_disable_deduplication (const gchar *name,
                                  const BDExtraArg **extra,
                                  GError **error);

`bd_vdo_disable_deduplication` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the deduplication was successfully disabled or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_MODIFY`

### bd_vdo_activate ()

    gboolean
    bd_vdo_activate (const gchar *name,
                     const BDExtraArg **extra,
                     GError **error);

`bd_vdo_activate` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the VDO volume was successfully activated or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_ACTIVATE_DEACTIVATE`

### bd_vdo_deactivate ()

    gboolean
    bd_vdo_deactivate (const gchar *name,
                       const BDExtraArg **extra,
                       GError **error);

`bd_vdo_deactivate` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the VDO volume was successfully deactivated or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_ACTIVATE_DEACTIVATE`

### bd_vdo_start ()

    gboolean
    bd_vdo_start (const gchar *name,
                  gboolean rebuild,
                  const BDExtraArg **extra,
                  GError **error);

`bd_vdo_start` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
rebuild | force rebuild the volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the VDO volume was successfully started or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_START_STOP`

### bd_vdo_stop ()

    gboolean
    bd_vdo_stop (const gchar *name,
                 gboolean force,
                 const BDExtraArg **extra,
                 GError **error);

`bd_vdo_stop` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
force | force stop the volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the VDO volume was successfully stopped or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_START_STOP`

### bd_vdo_grow_logical ()

    gboolean
    bd_vdo_grow_logical (const gchar *name,
                         guint64 size,
                         const BDExtraArg **extra,
                         GError **error);

`bd_vdo_grow_logical` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
size | new logical size for the volume |
extra | extra options for the VDO creation (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the VDO volume was successfully resized or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_GROW`

### bd_vdo_grow_physical ()

    gboolean
    bd_vdo_grow_physical (const gchar *name,
                          const BDExtraArg **extra,
                          GError **error);

`bd_vdo_grow_physical` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
extra | extra options for the VDO tool (just passed to VDO as is). | [allow-none][array zero-terminated=1]
error | place to store error (if any). | [out]

#### Returns

whether the VDO volume was successfully grown or not

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_GROW`

### bd_vdo_get_stats ()

    BDVDOStats *
    bd_vdo_get_stats (const gchar *name,
                      GError **error);

`bd_vdo_get_stats` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
error | place to store error (if any). | [out]

#### Returns

a structure containing selected statistics or `NULL` in case of error (`error` gets populated in those cases)

In contrast to `bd_vdo_get_stats_full` this function will only return selected statistics in a fixed structure. In case a value is not available, -1 would be returned.

The following statistics are presented:

- `"block_size"`: The block size of a VDO volume, in bytes.

- `"logical_block_size"`: The logical block size, in bytes.

- `"physical_blocks"`: The total number of physical blocks allocated for a VDO volume.

- `"data_blocks_used"`: The number of physical blocks currently in use by a VDO volume to store data.

- `"overhead_blocks_used"`: The number of physical blocks currently in use by a VDO volume to store VDO metadata.

- `"logical_blocks_used"`: The number of logical blocks currently mapped.

- `"usedPercent"`: The percentage of physical blocks used on a VDO volume (= used blocks / allocated blocks * 100).

- `"savingPercent"`: The percentage of physical blocks saved on a VDO volume (= [logical blocks used - physical blocks used] / logical blocks used).

- `"writeAmplificationRatio"`: The average number of block writes to the underlying storage per block written to the VDO device.

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_QUERY`.

[transfer full]

### bd_vdo_get_stats_full ()

    GHashTable *
    bd_vdo_get_stats_full (const gchar *name,
                           GError **error);

`bd_vdo_get_stats_full` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

name | name of an existing VDO volume |
error | place to store error (if any). | [out]

#### Returns

hashtable of type string - string of available statistics or `NULL` in case of error (`error` gets populated in those cases)

Statistics are collected from the values exposed by the kernel `kvdo` module at the `/sys/kvdo/&lt;VDO_NAME>/statistics/` path. Some of the keys are computed to mimic the information produced by the vdo tools. Please note the contents of the hashtable may vary depending on the actual kvdo module version.

Tech category: `BD_VDO_TECH_VDO`-`BD_VDO_TECH_MODE_QUERY`.

[transfer full][element-type utf8 utf8]

### bd_vdo_is_tech_avail ()

    gboolean
    bd_vdo_is_tech_avail (BDVDOTech tech,
                          guint64 mode,
                          GError **error);

`bd_vdo_is_tech_avail` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Parameters

tech | the queried tech |
mode | a bit mask of queried modes of operation (BDVDOTechMode) for `tech` |
error | place to store error (details about why the `tech` -`mode` combination is not available). | [out]

#### Returns

whether the `tech` -`mode` combination is available -- supported by the plugin implementation and having all the runtime dependencies available

## Types and Values

### enum BDVDOError

#### Members

BD_VDO_ERROR_FAIL |  |
BD_VDO_ERROR_PARSE |  |
BD_VDO_ERROR_TECH_UNAVAIL |  |
BD_VDO_ERROR_POLICY_INVAL |  |

### BD_VDO_ERROR

    #define             BD_VDO_ERROR

### BDVDOInfo

    typedef struct {
        gchar *name;
        gchar *device;
        gboolean active;
        gboolean deduplication;
        gboolean compression;
        guint64 logical_size;
        guint64 physical_size;
        guint64 index_memory;
        BDVDOWritePolicy write_policy;
    } BDVDOInfo;

`BDVDOInfo` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Members

gchar *`name`; | name of the VDO volume |
gchar *`device`; | underlying block device |
gboolean `active`; | whether the volume is active or not |
gboolean `deduplication`; | whether deduplication is enabled |
gboolean `compression`; | whether compression is enabled |
guint64 `logical_size`; | logical size of the volume |
guint64 `physical_size`; | sphysical size of the volume |
guint64 `index_memory`; | index memory size |
BDVDOWritePolicy `write_policy`; | write policy of the volume |

### BDVDOStats

    typedef struct {
        gint64 block_size;
        gint64 logical_block_size;
        gint64 physical_blocks;
        gint64 data_blocks_used;
        gint64 overhead_blocks_used;
        gint64 logical_blocks_used;
        gint64 used_percent;
        gint64 saving_percent;
        gdouble write_amplification_ratio;
    } BDVDOStats;

`BDVDOStats` has been deprecated since version 2.24 and should not be used in newly-written code.

Use LVM-VDO integration instead.

#### Members

gint64 `block_size`; | block size of a VDO volume, in bytes |
gint64 `logical_block_size`; | logical block size, in bytes |
gint64 `physical_blocks`; | total number of physical blocks allocated |
gint64 `data_blocks_used`; | number of physical blocks currently in use to store data |
gint64 `overhead_blocks_used`; | number of physical blocks currently in use to store VDO metadata |
gint64 `logical_blocks_used`; | number of logical blocks currently mapped |
gint64 `used_percent`; | percentage of physical blocks used |
gint64 `saving_percent`; | percentage of physical blocks saved |
gdouble `write_amplification_ratio`; | average number of block writes to the underlying storage per block written |

### enum BDVDOTech

#### Members

BD_VDO_TECH_VDO |  |

### enum BDVDOTechMode

#### Members

BD_VDO_TECH_MODE_CREATE |  |
BD_VDO_TECH_MODE_REMOVE |  |
BD_VDO_TECH_MODE_MODIFY |  |
BD_VDO_TECH_MODE_ACTIVATE_DEACTIVATE |  |
BD_VDO_TECH_MODE_START_STOP |  |
BD_VDO_TECH_MODE_QUERY |  |
BD_VDO_TECH_MODE_GROW |  |