29#include "storage/Devices/Partitionable.h"
43 UNKNOWN, RAID0, RAID1, RAID4, RAID5, RAID6, RAID10, CONTAINER, LINEAR
52 DEFAULT, LEFT_ASYMMETRIC, LEFT_SYMMETRIC, RIGHT_ASYMMETRIC,
53 RIGHT_SYMMETRIC, FIRST, LAST, LEFT_ASYMMETRIC_6, LEFT_SYMMETRIC_6,
54 RIGHT_ASYMMETRIC_6, RIGHT_SYMMETRIC_6, FIRST_6, NEAR_2, OFFSET_2,
55 FAR_2, NEAR_3, OFFSET_3, FAR_3
93 static Md* load(
Devicegraph* devicegraph,
const xmlNode* node);
110 std::vector<BlkDevice*> get_devices() ST_DEPRECATED;
111 std::vector<const
BlkDevice*> get_devices() const ST_DEPRECATED;
278 std::function<
bool(const
Md*)> pred);
284 std::function<
bool(const
Md*)> pred);
318 unsigned long long size);
334 const Impl& get_impl() const;
336 virtual
Md* clone() const override;
An abstract Block Device.
Definition BlkDevice.h:49
An abstract base class for storage devices.
Definition Device.h:82
The main container of the libstorage-ng.
Definition Devicegraph.h:170
Holder from a BlkDevice to an Md.
Definition MdUser.h:39
A MD device.
Definition Md.h:79
unsigned long get_chunk_size() const
Get the chunk size of the MD RAID.
bool supports_journal_device() const
Return whether the RAID supports a journal device.
MdUser * add_device(BlkDevice *blk_device)
Add another device to a RAID.
unsigned int minimal_number_of_devices() const
Return the minimal number of devices required by the RAID (without spare and journal devices).
void set_in_etc_mdadm(bool in_etc_mdadm)
Set whether the MD RAID will be present in /etc/mdadm.conf.
bool is_numeric() const
Returns true if the name of the MD is numeric.
unsigned int get_number() const
Returns the number of the MD.
std::vector< BlkDevice * > get_blk_devices()
Return blk devices used for the MD RAID.
bool supports_spare_devices() const
Return whether the RAID supports spare devices.
static unsigned long long calculate_underlying_size(MdLevel md_level, unsigned int number_of_devices, unsigned long long size)
Calculate the required size of the underlying block devices to get an MD of the desired size.
bool is_in_etc_mdadm() const
Query whether the MD RAID is present (probed devicegraph) or will be present (staging devicegraph) in...
void set_md_parity(MdParity md_parity)
Set the parity of the MD RAID.
const std::string & get_uuid() const
Get the UUID.
MdLevel get_md_level() const
Get the MD RAID level.
const std::string & get_metadata() const
A string like "1.0" or "1.2" for Linux RAID, "imsm" or "ddf" for BIOS RAID containers and empty for B...
bool is_chunk_size_meaningful() const
Is the chunk size meaningful for the RAID (so far only depends on RAID level)?
void remove_device(BlkDevice *blk_device)
void set_md_level(MdLevel md_level)
Set the MD RAID level.
std::vector< MdParity > get_allowed_md_parities() const
Get the allowed parities for the MD RAID.
static std::string find_free_numeric_name(const Devicegraph *devicegraph)
Find a free numeric name for a MD, e.g.
void set_uuid(const std::string &uuid)
Set the UUID.
static Md * find_by_name(Devicegraph *devicegraph, const std::string &name)
Find a Md by its name.
static std::vector< Md * > get_all(Devicegraph *devicegraph)
Get all Mds.
void set_chunk_size(unsigned long chunk_size)
Set the chunk size of the MD RAID.
static Md * create(Devicegraph *devicegraph, const std::string &name)
Create a MD in devicegraph with name.
static bool compare_by_number(const Md *lhs, const Md *rhs)
Compare (less than) two Mds by number.
static std::vector< Md * > get_all_if(Devicegraph *devicegraph, std::function< bool(const Md *)> pred)
Get all Mds for which the predicate pred returns true.
void set_metadata(const std::string &metadata)
Set metadata for new created Linux RAID.
MdParity get_md_parity() const
Get the parity of the MD RAID.
Definition Partitionable.h:40
The storage namespace.
Definition Actiongraph.h:40
Md * to_md(Device *device)
Converts pointer to Device to pointer to Md.
bool is_md(const Device *device)
Checks whether device points to a Md.
std::string get_md_parity_name(MdParity md_parity)
Convert the MD parity algorithm md_parity to a string.
MdParity
MD parity algorithms for RAID5, RAID6 and RAID10.
Definition Md.h:51
std::string get_md_level_name(MdLevel md_level)
Convert the MD RAID level md_level to a string.
MdLevel
MD RAID levels.
Definition Md.h:42