## Mpath Mpath — plugin for basic operations with multipath devices |

## Functions

gboolean | bd_mpath_init ()
void | bd_mpath_close ()
GQuark | bd_mpath_error_quark ()
gboolean | bd_mpath_flush_mpaths ()
gboolean | bd_mpath_is_mpath_member ()
gchar ** | bd_mpath_get_mpath_members ()
gboolean | bd_mpath_set_friendly_names ()
gboolean | bd_mpath_is_tech_avail ()

## Types and Values

#define | BD_MPATH_ERROR
enum | BDMpathError
enum | BDMpathTech
enum | BDMpathTechMode

## Includes

    #include <mpath.h>

## Description

A plugin for basic operations with multipath devices.

## Functions

### bd_mpath_init ()

    gboolean
    bd_mpath_init (void);

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

### bd_mpath_close ()

    void
    bd_mpath_close (void);

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

### bd_mpath_error_quark ()

    GQuark
    bd_mpath_error_quark (void);

[skip]

### bd_mpath_flush_mpaths ()

    gboolean
    bd_mpath_flush_mpaths (GError **error);

#### Parameters

error | place to store error (if any). | [out][optional]

#### Returns

whether multipath device maps were successfully flushed or not

Flushes all unused multipath device maps.

Tech category: `BD_MPATH_TECH_BASE`-`BD_MPATH_TECH_MODE_MODIFY`

### bd_mpath_is_mpath_member ()

    gboolean
    bd_mpath_is_mpath_member (const gchar *device,
                              GError **error);

#### Parameters

device | device to test |
error | place to store error (if any). | [out][optional]

#### Returns

`TRUE` if the device is a multipath member, `FALSE` if not or an error appeared when queried (`error` is set in those cases)

Tech category: `BD_MPATH_TECH_BASE`-`BD_MPATH_TECH_MODE_QUERY`

### bd_mpath_get_mpath_members ()

    gchar **
    bd_mpath_get_mpath_members (GError **error);

#### Parameters

error | place to store error (if any). | [out][optional]

#### Returns

list of names of all devices that are members of the mpath mappings (or `NULL` in case of error)

Tech category: `BD_MPATH_TECH_BASE`-`BD_MPATH_TECH_MODE_QUERY`.

[transfer full][array zero-terminated=1]

### bd_mpath_set_friendly_names ()

    gboolean
    bd_mpath_set_friendly_names (gboolean enabled,
                                 GError **error);

#### Parameters

enabled | whether friendly names should be enabled or not |
error | place to store error (if any). | [out][optional]

#### Returns

if successfully set or not

Tech category: `BD_MPATH_TECH_FRIENDLY_NAMES`-`BD_MPATH_TECH_MODE_MODIFY`

### bd_mpath_is_tech_avail ()

    gboolean
    bd_mpath_is_tech_avail (BDMpathTech tech,
                            guint64 mode,
                            GError **error);

#### Parameters

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

#### Returns

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

## Types and Values

### BD_MPATH_ERROR

    #define             BD_MPATH_ERROR

### enum BDMpathError

#### Members

BD_MPATH_ERROR_TECH_UNAVAIL |  |
BD_MPATH_ERROR_INVAL |  |
BD_MPATH_ERROR_FLUSH |  |
BD_MPATH_ERROR_NOT_ROOT |  |
BD_MPATH_ERROR_DM_ERROR |  |

### enum BDMpathTech

#### Members

BD_MPATH_TECH_BASE |  |
BD_MPATH_TECH_FRIENDLY_NAMES |  |

### enum BDMpathTechMode

#### Members

BD_MPATH_TECH_MODE_QUERY |  |
BD_MPATH_TECH_MODE_MODIFY |  |