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" 198 void load(
const std::string& filename);
205 void load(
const std::string& filename,
bool keep_sids);
212 void save(
const std::string& filename)
const;
392 uint64_t used_features()
const ST_DEPRECATED;
426 GraphvizFlags tooltip_flags = GraphvizFlags::NONE)
const ST_DEPRECATED;
428 friend std::ostream& operator<<(std::ostream& out,
const Devicegraph& devicegraph);
434 Impl& get_impl() {
return *impl; }
435 const Impl& get_impl()
const {
return *impl; }
439 const std::unique_ptr<Impl> impl;
bool empty() const
Query whether the devicegraph is empty.
GraphvizFlags
Bitfield to control graphviz output.
Definition: Graphviz.h:44
uint64_t uf_t
Type for used features.
Definition: UsedFeatures.h:63
std::vector< Md * > get_all_mds()
Get all Mds.
Definition: Devicegraph.h:73
Definition: Devicegraph.h:97
std::vector< Filesystem * > get_all_filesystems()
Get all Filesystems.
Holder * find_holder(sid_t source_sid, sid_t target_sid)
Find the holder with source_sid and target_sid.
const std::string & msg() const
Return the message string provided to the constructor.
Definition: Exception.h:150
bool device_exists(sid_t sid) const
Check whether the device with sid exists.
std::vector< BlkFilesystem * > get_all_blk_filesystems()
Get all BlkFilesystems.
std::vector< LvmVg * > get_all_lvm_vgs()
Get all LvmVgs.
void clear()
Clear the devicegraph.
void check(const CheckCallbacks *check_callbacks=nullptr) const
Checks the devicegraph.
UsedFeaturesDependencyType
Enum specifying the dependency type of used features.
Definition: UsedFeatures.h:37
size_t num_devices() const
Return the number of devices.
size_t num_holders() const
Return the number of holders.
The main container of the libstorage-ng.
Definition: Devicegraph.h:169
void write_graphviz(const std::string &filename, DevicegraphStyleCallbacks *style_callbacks, View view) const
Writes the devicegraph in graphviz format.
Definition: Devicegraph.h:105
void remove_devices(std::vector< Device *> devices)
Removes the devices from the devicegraph.
Definition: Devicegraph.h:121
Definition: Devicegraph.h:81
An abstract base class for storage devices.
Definition: Device.h:81
Definition: Devicegraph.h:57
bool holder_exists(sid_t source_sid, sid_t target_sid) const
Check whether a holder with source_sid and target_sid exists.
Definition: Devicegraph.h:89
Definition: Devicegraph.h:49
Definition: Devicegraph.h:65
void save(const std::string &filename) const
Save the devicegraph to a file.
An abstract base class for storage holders.
Definition: Holder.h:56
Definition: Devicegraph.h:113
void remove_device(sid_t sid)
Removes the device with sid from the devicegraph.
The main entry point to libstorage.
Definition: Storage.h:442
Device * find_device(sid_t sid)
Base class for storage exceptions.
Definition: Exception.h:113
The storage namespace.
Definition: Actiongraph.h:39
unsigned int sid_t
An integer storage ID.
Definition: Device.h:67
void load(const std::string &filename)
Load the devicegraph from a file.
std::vector< Holder * > find_holders(sid_t source_sid, sid_t target_sid)
Find all holders with source_sid and sid_t target_sid.
Definition: Storage.h:392
std::vector< Disk * > get_all_disks()
Get all Disks.
Storage * get_storage()
Get the storage object the devicegraph belongs to.
View
Enum with possible views on the devicegraph.
Definition: View.h:33
void remove_holder(Holder *holder)
Removes the holder from the devicegraph.
Style callbacks used by Devicegraph::write_graphviz().
Definition: Graphviz.h:104