libstorage-ng
 All Classes Namespaces Functions Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Friends | List of all members
storage::Devicegraph Class Reference

The master container of the libstorage. More...

#include <Devicegraph.h>

Inheritance diagram for storage::Devicegraph:
Inheritance graph
[legend]
Collaboration diagram for storage::Devicegraph:
Collaboration graph
[legend]

Public Member Functions

 Devicegraph (const Storage *storage=nullptr)
 
bool operator== (const Devicegraph &rhs) const
 
bool operator!= (const Devicegraph &rhs) const
 
const Storageget_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
 
Devicefind_device (sid_t sid)
 
const Devicefind_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)
 
Holderfind_holder (sid_t source_sid, sid_t target_sid)
 
const Holderfind_holder (sid_t source_sid, sid_t target_sid) const
 
void remove_holder (Holder *holder)
 
void check () const
 
uint64_t used_features () const
 Calculates a bit-field with the used features of the devicegraph.
 
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)
 

Detailed Description

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.

Whenever possible use the high-level functions.

Member Function Documentation

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?


The documentation for this class was generated from the following file: