|
Packit Service |
158247 |
#include <glib.h>
|
|
Packit Service |
158247 |
#include <glib-object.h>
|
|
Packit Service |
158247 |
#include <blockdev/utils.h>
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
#ifndef BD_MD_API
|
|
Packit Service |
158247 |
#define BD_MD_API
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/* taken from blivet */
|
|
Packit Service |
158247 |
// these defaults were determined empirically
|
|
Packit Service |
158247 |
#define BD_MD_SUPERBLOCK_SIZE (2 * 1048576ULL)
|
|
Packit Service |
158247 |
#define BD_MD_CHUNK_SIZE (512 * 1024ULL)
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
GQuark bd_md_error_quark (void);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
#define BD_MD_ERROR bd_md_error_quark ()
|
|
Packit Service |
158247 |
typedef enum {
|
|
Packit Service |
158247 |
BD_MD_ERROR_PARSE,
|
|
Packit Service |
158247 |
BD_MD_ERROR_BAD_FORMAT,
|
|
Packit Service |
158247 |
BD_MD_ERROR_NO_MATCH,
|
|
Packit Service |
158247 |
BD_MD_ERROR_INVAL,
|
|
Packit Service |
158247 |
BD_MD_ERROR_FAIL,
|
|
Packit Service |
158247 |
BD_MD_ERROR_TECH_UNAVAIL,
|
|
Packit Service |
158247 |
} BDMDError;
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
#define BD_MD_TYPE_EXAMINEDATA (bd_md_examine_data_get_type ())
|
|
Packit Service |
158247 |
GType bd_md_examine_data_get_type ();
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
typedef struct BDMDExamineData {
|
|
Packit Service |
158247 |
gchar *device;
|
|
Packit Service |
158247 |
gchar *level;
|
|
Packit Service |
158247 |
guint64 num_devices;
|
|
Packit Service |
158247 |
gchar *name;
|
|
Packit Service |
158247 |
guint64 size;
|
|
Packit Service |
158247 |
gchar *uuid;
|
|
Packit Service |
158247 |
guint64 update_time;
|
|
Packit Service |
158247 |
gchar *dev_uuid;
|
|
Packit Service |
158247 |
guint64 events;
|
|
Packit Service |
158247 |
gchar *metadata;
|
|
Packit Service |
158247 |
guint64 chunk_size;
|
|
Packit Service |
158247 |
} BDMDExamineData;
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* BDMDExamineData:
|
|
Packit Service |
158247 |
* @device: path of the MD device
|
|
Packit Service |
158247 |
* @level: RAID level of the device
|
|
Packit Service |
158247 |
* @num_devices: number of devices used by the MD device
|
|
Packit Service |
158247 |
* @name: name of the MD device
|
|
Packit Service |
158247 |
* @size: size of the MD device
|
|
Packit Service |
158247 |
* @uuid: array UUID
|
|
Packit Service |
158247 |
* @update_time: update time of the MD device
|
|
Packit Service |
158247 |
* @dev_uuid: UUID of the member device
|
|
Packit Service |
158247 |
* @events: number of events on the MD device
|
|
Packit Service |
158247 |
* @metadata: version of the metadata used by the MD device
|
|
Packit Service |
158247 |
* @chunk_size: chunk size used by the MD device
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_examine_data_copy: (skip)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Creates a new copy of @data.
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
BDMDExamineData* bd_md_examine_data_copy (BDMDExamineData *data);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_examine_data_free: (skip)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Frees @data.
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
void bd_md_examine_data_free (BDMDExamineData *data);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
#define BD_MD_TYPE_DETAILDATA (bd_md_detail_data_get_type ())
|
|
Packit Service |
158247 |
GType bd_md_detail_data_get_type ();
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
typedef struct BDMDDetailData {
|
|
Packit Service |
158247 |
gchar *device;
|
|
Packit Service |
158247 |
gchar *metadata;
|
|
Packit Service |
158247 |
gchar *creation_time;
|
|
Packit Service |
158247 |
gchar *level;
|
|
Packit Service |
158247 |
gchar *name;
|
|
Packit Service |
158247 |
guint64 array_size;
|
|
Packit Service |
158247 |
guint64 use_dev_size;
|
|
Packit Service |
158247 |
guint64 raid_devices;
|
|
Packit Service |
158247 |
guint64 total_devices;
|
|
Packit Service |
158247 |
guint64 active_devices;
|
|
Packit Service |
158247 |
guint64 working_devices;
|
|
Packit Service |
158247 |
guint64 failed_devices;
|
|
Packit Service |
158247 |
guint64 spare_devices;
|
|
Packit Service |
158247 |
gboolean clean;
|
|
Packit Service |
158247 |
gchar *uuid;
|
|
Packit Service |
158247 |
} BDMDDetailData;
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* BDMDDetailData:
|
|
Packit Service |
158247 |
* @device: path of the device
|
|
Packit Service |
158247 |
* @metadata: version of the metadata used by the device
|
|
Packit Service |
158247 |
* @creation_time: creation time
|
|
Packit Service |
158247 |
* @level: level of the MD RAID
|
|
Packit Service |
158247 |
* @name: name of the MD device
|
|
Packit Service |
158247 |
* @array_size: size of the MD array
|
|
Packit Service |
158247 |
* @use_dev_size: size of the used space
|
|
Packit Service |
158247 |
* @raid_devices: number of devices in the MD array
|
|
Packit Service |
158247 |
* @total_devices: total number of devices in the MD array
|
|
Packit Service |
158247 |
* @active_devices: number of active devices in the MD array
|
|
Packit Service |
158247 |
* @working_devices: number of working devices in the MD array
|
|
Packit Service |
158247 |
* @failed_devices: number of failed devices in the MD array
|
|
Packit Service |
158247 |
* @spare_devices: number of spare devices in the MD array
|
|
Packit Service |
158247 |
* @clean: whether the MD array is clean or not
|
|
Packit Service |
158247 |
* @uuid: uuid of the MD array
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_detail_data_copy: (skip)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Creates a new copy of @data.
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
BDMDDetailData* bd_md_detail_data_copy (BDMDDetailData *data);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_detail_data_free: (skip)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Frees @data.
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
void bd_md_detail_data_free (BDMDDetailData *data);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
typedef enum {
|
|
Packit Service |
158247 |
BD_MD_TECH_MDRAID = 0,
|
|
Packit Service |
158247 |
} BDMDTech;
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
typedef enum {
|
|
Packit Service |
158247 |
BD_MD_TECH_MODE_CREATE = 1 << 0,
|
|
Packit Service |
158247 |
BD_MD_TECH_MODE_DELETE = 1 << 1,
|
|
Packit Service |
158247 |
BD_MD_TECH_MODE_MODIFY = 1 << 2,
|
|
Packit Service |
158247 |
BD_MD_TECH_MODE_QUERY = 1 << 3,
|
|
Packit Service |
158247 |
} BDMDTechMode;
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_is_tech_avail:
|
|
Packit Service |
158247 |
* @tech: the queried tech
|
|
Packit Service |
158247 |
* @mode: a bit mask of queried modes of operation for @tech
|
|
Packit Service |
158247 |
* @error: (out): place to store error (details about why the @tech-@mode combination is not available)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the @tech-@mode combination is available -- supported by the
|
|
Packit Service |
158247 |
* plugin implementation and having all the runtime dependencies available
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_is_tech_avail (BDMDTech tech, guint64 mode, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_get_superblock_size:
|
|
Packit Service |
158247 |
* @member_size: size of an array member
|
|
Packit Service |
158247 |
* @version: (allow-none): metadata version or %NULL to use the current default version
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: Calculated superblock size for an array with a given @member_size
|
|
Packit Service |
158247 |
* and metadata @version or default if unsupported @version is used.
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: always available
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
guint64 bd_md_get_superblock_size (guint64 member_size, const gchar *version, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_create:
|
|
Packit Service |
158247 |
* @device_name: name of the device to create
|
|
Packit Service |
158247 |
* @level: RAID level (as understood by mdadm, see mdadm(8))
|
|
Packit Service |
158247 |
* @disks: (array zero-terminated=1): disks to use for the new RAID (including spares)
|
|
Packit Service |
158247 |
* @spares: number of spare devices
|
|
Packit Service |
158247 |
* @version: (allow-none): metadata version
|
|
Packit Service |
158247 |
* @bitmap: whether to create an internal bitmap on the device or not
|
|
Packit Service |
158247 |
* @chunk_size: chunk size of the device to create
|
|
Packit Service |
158247 |
* @extra: (allow-none) (array zero-terminated=1): extra options for the creation (right now
|
|
Packit Service |
158247 |
* passed to the 'mdadm' utility)
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the new MD RAID device @device_name was successfully created or not
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_CREATE
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_create (const gchar *device_name, const gchar *level, const gchar **disks, guint64 spares, const gchar *version, gboolean bitmap, guint64 chunk_size, const BDExtraArg **extra, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_destroy:
|
|
Packit Service |
158247 |
* @device: device to destroy MD RAID metadata on
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the MD RAID metadata was successfully destroyed on @device or not
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_DELETE
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_destroy (const gchar *device, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_deactivate:
|
|
Packit Service |
158247 |
* @raid_spec: specification of the RAID device (name, node or path)
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the RAID device @raid_spec was successfully deactivated or not
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_MODIFY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_deactivate (const gchar *raid_spec, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_activate:
|
|
Packit Service |
158247 |
* @raid_spec: (allow-none): specification of the RAID device (name, node or path) to activate (if not given "--scan" is implied and @members is ignored)
|
|
Packit Service |
158247 |
* @members: (allow-none) (array zero-terminated=1): member devices to be considered for @device activation
|
|
Packit Service |
158247 |
* @uuid: (allow-none): UUID (in the MD RAID format!) of the MD RAID to activate
|
|
Packit Service |
158247 |
* @start_degraded: whether to start the array even if it's degraded
|
|
Packit Service |
158247 |
* @extra: (allow-none) (array zero-terminated=1): extra options for the activation (right now
|
|
Packit Service |
158247 |
* passed to the 'mdadm' utility)
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the MD RAID @device was successfully activated or not
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Note: either @members or @uuid (or both) have to be specified.
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_MODIFY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_activate (const gchar *raid_spec, const gchar **members, const gchar *uuid, gboolean start_degraded, const BDExtraArg **extra, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_run:
|
|
Packit Service |
158247 |
* @raid_spec: specification of the (possibly degraded) RAID device (name, node or path) to be started
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the @raid_spec was successfully started or not
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_MODIFY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_run (const gchar *raid_spec, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_nominate:
|
|
Packit Service |
158247 |
* @device: device to nominate (add to its appropriate RAID) as a MD RAID device
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the @device was successfully nominated (added to its
|
|
Packit Service |
158247 |
* appropriate RAID) or not
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Note: may start the MD RAID if it becomes ready by adding @device.
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_MODIFY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_nominate (const gchar *device, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_denominate:
|
|
Packit Service |
158247 |
* @device: device to denominate (remove from its appropriate RAID) as a MD RAID device
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the @device was successfully denominated (added to its
|
|
Packit Service |
158247 |
* appropriate RAID) or not
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Note: may start the MD RAID if it becomes ready by adding @device.
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_MODIFY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_denominate (const gchar *device, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_add:
|
|
Packit Service |
158247 |
* @raid_spec: specification of the RAID device (name, node or path) to add @device into
|
|
Packit Service |
158247 |
* @device: name of the device to add to the @raid_spec RAID device
|
|
Packit Service |
158247 |
* @raid_devs: number of devices the @raid_spec RAID should actively use or 0
|
|
Packit Service |
158247 |
* to leave unspecified (see below)
|
|
Packit Service |
158247 |
* @extra: (allow-none) (array zero-terminated=1): extra options for the addition (right now
|
|
Packit Service |
158247 |
* passed to the 'mdadm' utility)
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the @device was successfully added to the @raid_spec RAID or
|
|
Packit Service |
158247 |
* not
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* The @raid_devs parameter is used when adding devices to a raid array that has
|
|
Packit Service |
158247 |
* no actual redundancy. In this case it is necessary to explicitly grow the
|
|
Packit Service |
158247 |
* array all at once rather than manage it in the sense of adding spares.
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Whether the new device will be added as a spare or an active member is
|
|
Packit Service |
158247 |
* decided by mdadm.
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_MODIFY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_add (const gchar *raid_spec, const gchar *device, guint64 raid_devs, const BDExtraArg **extra, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_remove:
|
|
Packit Service |
158247 |
* @raid_spec: specification of the RAID device (name, node or path) to remove @device from
|
|
Packit Service |
158247 |
* @device: device to remove from the @raid_spec RAID
|
|
Packit Service |
158247 |
* @fail: whether to mark the @device as failed before removing
|
|
Packit Service |
158247 |
* @extra: (allow-none) (array zero-terminated=1): extra options for the removal (right now
|
|
Packit Service |
158247 |
* passed to the 'mdadm' utility)
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the @device was successfully removed from the @raid_spec
|
|
Packit Service |
158247 |
* RAID or not.
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_MODIFY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_remove (const gchar *raid_spec, const gchar *device, gboolean fail, const BDExtraArg **extra, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_examine:
|
|
Packit Service |
158247 |
* @device: name of the device (a member of an MD RAID) to examine
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: information about the MD RAID extracted from the @device
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_QUERY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
BDMDExamineData* bd_md_examine (const gchar *device, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_detail:
|
|
Packit Service |
158247 |
* @raid_spec: specification of the RAID device (name, node or path) to examine
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: information about the MD RAID @raid_spec
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_QUERY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
BDMDDetailData* bd_md_detail (const gchar *raid_spec, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_canonicalize_uuid:
|
|
Packit Service |
158247 |
* @uuid: UUID to canonicalize
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: (transfer full): cannonicalized form of @uuid
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* This function expects a UUID in the form that mdadm returns. The change is as
|
|
Packit Service |
158247 |
* follows: 3386ff85:f5012621:4a435f06:1eb47236 -> 3386ff85-f501-2621-4a43-5f061eb47236
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: always available
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gchar* bd_md_canonicalize_uuid (const gchar *uuid, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_get_md_uuid:
|
|
Packit Service |
158247 |
* @uuid: UUID to transform into format used by MD RAID
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: (transfer full): transformed form of @uuid
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* This function expects a UUID in the canonical (traditional format) and
|
|
Packit Service |
158247 |
* returns a UUID in the format used by MD RAID and is thus reverse to
|
|
Packit Service |
158247 |
* bd_md_canonicalize_uuid(). The change is as follows:
|
|
Packit Service |
158247 |
* 3386ff85-f501-2621-4a43-5f061eb47236 -> 3386ff85:f5012621:4a435f06:1eb47236
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: always available
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gchar* bd_md_get_md_uuid (const gchar *uuid, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_node_from_name:
|
|
Packit Service |
158247 |
* @name: name of the MD RAID
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: device node of the @name MD RAID or %NULL in case of error
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: always available
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gchar* bd_md_node_from_name (const gchar *name, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_name_from_node:
|
|
Packit Service |
158247 |
* @node: path of the MD RAID's device node
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: @name of the MD RAID the device node belongs to or %NULL in case of error
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: always available
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gchar* bd_md_name_from_node (const gchar *node, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_get_status
|
|
Packit Service |
158247 |
* @raid_spec: specification of the RAID device (name, node or path) to get status
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: (transfer full): status of the @raid_spec RAID.
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_QUERY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gchar* bd_md_get_status (const gchar *raid_spec, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_set_bitmap_location:
|
|
Packit Service |
158247 |
* @raid_spec: specification of the RAID device (name, node or path) to set the bitmap location
|
|
Packit Service |
158247 |
* @location: bitmap location (none, internal or path)
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether @location was successfully set for @raid_spec
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_MODIFY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_set_bitmap_location (const gchar *raid_spec, const gchar *location, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_get_bitmap_location:
|
|
Packit Service |
158247 |
* @raid_spec: specification of the RAID device (name, node or path) to get the bitmap location
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: (transfer full): bitmap location for @raid_spec
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_QUERY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gchar* bd_md_get_bitmap_location (const gchar *raid_spec, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
/**
|
|
Packit Service |
158247 |
* bd_md_request_sync_action:
|
|
Packit Service |
158247 |
* @raid_spec: specification of the RAID device (name, node or path) to request sync action on
|
|
Packit Service |
158247 |
* @action: requested sync action (resync, recovery, check, repair or idle)
|
|
Packit Service |
158247 |
* @error: (out): place to store error (if any)
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Returns: whether the @action was successfully requested for the @raid_spec
|
|
Packit Service |
158247 |
* RAID or not.
|
|
Packit Service |
158247 |
*
|
|
Packit Service |
158247 |
* Tech category: %BD_MD_TECH_MDRAID-%BD_MD_TECH_MODE_MODIFY
|
|
Packit Service |
158247 |
*/
|
|
Packit Service |
158247 |
gboolean bd_md_request_sync_action (const gchar *raid_spec, const gchar *action, GError **error);
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
|
|
Packit Service |
158247 |
#endif /* BD_MD_API */
|