24 #ifndef STORAGE_DEVICEGRAPH_H
25 #define STORAGE_DEVICEGRAPH_H
28 #include <boost/noncopyable.hpp>
30 #include "storage/Devices/Device.h"
31 #include "storage/Graphviz.h"
32 #include "storage/Utils/Swig.h"
33 #include "storage/UsedFeatures.h"
195 void load(
const std::string& filename);
202 void save(
const std::string& filename)
const;
382 uint64_t used_features() const ST_DEPRECATED;
418 friend std::ostream& operator<<(std::ostream& out, const
Devicegraph& devicegraph);
424 Impl& get_impl() {
return *impl; }
425 const Impl& get_impl()
const {
return *impl; }
429 const std::unique_ptr<Impl> impl;
std::vector< const Disk * > get_all_disks() const
Get all Disks.
const Device * find_device(sid_t sid) const
View
Enum with possible views on the devicegraph.
Definition: View.h:34
std::vector< const Holder * > find_holders(sid_t source_sid, sid_t target_sid) const
Find all holders with source_sid and sid_t target_sid.
std::vector< Md * > get_all_mds()
Get all Mds.
Definition: Devicegraph.h:58
size_t num_devices() const
Return the number of devices.
GraphvizFlags
Bitfield to control graphviz output.
Definition: Graphviz.h:45
void load(const std::string &filename)
Load the devicegraph from a file.
Holder * find_holder(sid_t source_sid, sid_t target_sid)
Find the holder with source_sid and target_sid.
void check(const CheckCallbacks *check_callbacks=nullptr) const
Checks the devicegraph.
uint64_t uf_t
Type for used features.
Definition: UsedFeatures.h:55
Definition: Devicegraph.h:114
Storage * get_storage()
Get the storage object the devicegraph belongs to.
std::vector< const BlkFilesystem * > get_all_blk_filesystems() const
Get all BlkFilesystems.
std::vector< Holder * > find_holders(sid_t source_sid, sid_t target_sid)
Find all holders with source_sid and sid_t target_sid.
bool device_exists(sid_t sid) const
Check whether the device with sid exists.
const Storage * get_storage() const
Get the storage object the devicegraph belongs to.
std::vector< BlkFilesystem * > get_all_blk_filesystems()
Get all BlkFilesystems.
std::vector< const Filesystem * > get_all_filesystems() const
Get all Filesystems.
UsedFeaturesDependencyType
Enum specifying the dependency type of used features.
Definition: UsedFeatures.h:38
std::vector< const LvmVg * > get_all_lvm_vgs() const
Get all LvmVgs.
The main entry point to libstorage.
Definition: Storage.h:262
std::vector< const Md * > get_all_mds() const
Get all Mds.
The storage namespace.
Definition: Actiongraph.h:39
Definition: Devicegraph.h:106
void write_graphviz(const std::string &filename, DevicegraphStyleCallbacks *style_callbacks, View view) const
Writes the devicegraph in graphviz format.
bool holder_exists(sid_t source_sid, sid_t target_sid) const
Check whether a holder with source_sid and target_sid exists.
std::vector< LvmVg * > get_all_lvm_vgs()
Get all LvmVgs.
size_t num_holders() const
Return the number of holders.
Definition: Devicegraph.h:90
Definition: Devicegraph.h:98
std::vector< Filesystem * > get_all_filesystems()
Get all Filesystems.
const std::string & msg() const
Return the message string provided to the constructor.
Definition: Exception.h:150
Definition: Devicegraph.h:122
Definition: Devicegraph.h:74
Definition: Devicegraph.h:82
void remove_device(Device *a)
Removes the device from the devicegraph.
The main container of the libstorage-ng.
Definition: Devicegraph.h:170
Definition: Devicegraph.h:66
bool empty() const
Query whether the devicegraph is empty.
Definition: Devicegraph.h:50
Definition: Storage.h:241
Style callbacks used by Devicegraph::write_graphviz().
Definition: Graphviz.h:105
void save(const std::string &filename) const
Save the devicegraph to a file.
void remove_device(sid_t sid)
Removes the device with sid from the devicegraph.
Device * find_device(sid_t sid)
An abstract base class for storage devices.
Definition: Device.h:82
std::vector< Disk * > get_all_disks()
Get all Disks.
void remove_holder(Holder *holder)
Removes the holder from the devicegraph.
Base class for storage exceptions.
Definition: Exception.h:114
const Holder * find_holder(sid_t source_sid, sid_t target_sid) const
Find the holder with source_sid and target_sid.
void clear()
Clear the devicegraph.
An abstract base class for storage holders.
Definition: Holder.h:57
void remove_devices(std::vector< Device * > devices)
Removes the devices from the devicegraph.
unsigned int sid_t
An integer storage ID.
Definition: Device.h:67