The master container of the libstorage. More...
#include <Devicegraph.h>


Public Member Functions | |
| Devicegraph (const Storage *storage=nullptr) | |
| bool | operator== (const Devicegraph &rhs) const |
| bool | operator!= (const Devicegraph &rhs) const |
| const Storage * | get_storage () const |
| void | load (const std::string &filename) |
| void | save (const std::string &filename) const |
| bool | empty () const |
| size_t | num_devices () const |
| size_t | num_holders () const |
| Device * | find_device (sid_t sid) |
| const Device * | find_device (sid_t sid) const |
| bool | device_exists (sid_t sid) const |
| void | clear () |
| std::vector< Disk * > | get_all_disks () |
| std::vector< const Disk * > | get_all_disks () const |
| std::vector< Md * > | get_all_mds () |
| std::vector< const Md * > | get_all_mds () const |
| std::vector< LvmVg * > | get_all_lvm_vgs () |
| std::vector< const LvmVg * > | get_all_lvm_vgs () const |
| std::vector< Filesystem * > | get_all_filesystems () |
| std::vector< const Filesystem * > | get_all_filesystems () const |
| void | remove_device (sid_t sid) |
| Removes the device with sid from the devicegraph. More... | |
| void | remove_device (Device *a) |
| void | remove_devices (std::vector< Device * > devices) |
| Holder * | find_holder (sid_t source_sid, sid_t target_sid) |
| const Holder * | find_holder (sid_t source_sid, sid_t target_sid) const |
| void | remove_holder (Holder *holder) |
| void | check () const |
| void | copy (Devicegraph &dest) const |
| void | write_graphviz (const std::string &filename, GraphvizFlags graphviz_flags=GraphvizFlags::NONE) const |
| Impl & | get_impl () |
| const Impl & | get_impl () const |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const Devicegraph &devicegraph) |
The master container of the libstorage.
There are two levels of functions to manipulate the device graph. As an example we show how to create a partition table containing one partition on the disk sda.
High-level
These functions will not only create the Gpt and Partition object but also the holders in the device graph.
Low-level
As you can see with the low-level functions you have to create the holders yourself.
Whenever possible use the high-level functions.
| void storage::Devicegraph::remove_device | ( | sid_t | sid | ) |
Removes the device with sid from the devicegraph.
Only use this function if there is no special function to delete a device, e.g. PartitionTable.delete_partition() or LvmVg.delete_lvm_lv().
TODO internally redirect to special delete functions?
1.8.5