29 #include "storage/Devices/Partitionable.h" 39 UNKNOWN, RAID0, RAID1, RAID4, RAID5, RAID6, RAID10, CONTAINER
44 DEFAULT, LEFT_ASYMMETRIC, LEFT_SYMMETRIC, RIGHT_ASYMMETRIC,
45 RIGHT_SYMMETRIC, FIRST, LAST, LEFT_ASYMMETRIC_6, LEFT_SYMMETRIC_6,
46 RIGHT_ASYMMETRIC_6, RIGHT_SYMMETRIC_6, FIRST_6, NEAR_2, OFFSET_2,
47 FAR_2, NEAR_3, OFFSET_3, FAR_3
51 std::string get_md_level_name(MdLevel md_level);
53 std::string get_md_parity_name(MdParity md_parity);
72 static Md* load(
Devicegraph* devicegraph,
const xmlNode* node);
84 std::vector<BlkDevice*> get_devices();
85 std::vector<const BlkDevice*> get_devices()
const;
99 MdLevel get_md_level()
const;
100 void set_md_level(MdLevel md_level);
123 unsigned long get_chunk_size()
const;
124 void set_chunk_size(
unsigned long chunk_size);
126 const std::string& get_uuid()
const;
171 std::function<
bool(
const Md*)> pred);
177 std::function<
bool(
const Md*)> pred);
209 const Impl& get_impl()
const;
211 virtual Md* clone()
const override;
220 bool is_md(
const Device* device);
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.
bool is_numeric() const
Returns true if the name of the MD is numeric.
void set_in_etc_mdadm(bool in_etc_mdadm)
Set whether the MD RAID will be present in /etc/mdadm.conf.
std::vector< MdParity > get_allowed_md_parities() const
Get the allowed parities for the MD RAID.
static Md * create(Devicegraph *devicegraph, const std::string &name)
Create a MD in devicegraph with name.
static std::vector< Md * > get_all(Devicegraph *devicegraph)
Get all Mds.
MdUser * add_device(BlkDevice *blk_device)
void remove_device(BlkDevice *blk_device)
MdParity get_md_parity() const
Get the parity of the MD RAID.
const std::string & get_metadata() const
A string like "1.0" for Linux RAID, "imsm" or "ddf" for BIOS RAID containers and empty for BIOS RAID ...
A MD device.
Definition: Md.h:59
The master container of the libstorage.
Definition: Devicegraph.h:153
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.
unsigned int get_number() const
Returns the number of the MD.
An abstract Block Device.
Definition: BlkDevice.h:41
unsigned int minimal_number_of_devices() const
Return the minimal number of devices required by the RAID.
void set_metadata(const std::string &metadata)
Currently create always uses metadata 1.0.
An abstract base class of storage devices, and a vertex in the Devicegraph.
Definition: Device.h:75
Definition: Partitionable.h:40
static std::string find_free_numeric_name(const Devicegraph *devicegraph)
Find a free numeric name for a MD.
static bool compare_by_number(const Md *lhs, const Md *rhs)
Compare (less than) two Mds by number.
The storage namespace.
Definition: Actiongraph.h:37
Md * to_md(Device *device)
Converts pointer to Device to pointer to Md.
static Md * find_by_name(Devicegraph *devicegraph, const std::string &name)
Find a Md by its name.