24 #ifndef STORAGE_DEVICEGRAPH_H 25 #define STORAGE_DEVICEGRAPH_H 29 #include <boost/noncopyable.hpp> 31 #include "storage/Devices/Device.h" 32 #include "storage/Graphviz.h" 165 const Storage* get_storage()
const;
170 void load(
const std::string& filename);
175 void save(
const std::string& filename)
const;
179 size_t num_devices()
const;
180 size_t num_holders()
const;
205 std::vector<Disk*> get_all_disks();
206 std::vector<const Disk*> get_all_disks()
const;
208 std::vector<Md*> get_all_mds();
209 std::vector<const Md*> get_all_mds()
const;
211 std::vector<LvmVg*> get_all_lvm_vgs();
212 std::vector<const LvmVg*> get_all_lvm_vgs()
const;
214 std::vector<Filesystem*> get_all_filesystems();
215 std::vector<const Filesystem*> get_all_filesystems()
const;
217 std::vector<BlkFilesystem*> get_all_blk_filesystems();
218 std::vector<const BlkFilesystem*> get_all_blk_filesystems()
const;
233 void remove_devices(std::vector<Device*> devices);
245 void remove_holder(
Holder* holder);
273 friend std::ostream& operator<<(std::ostream& out,
const Devicegraph& devicegraph);
279 Impl& get_impl() {
return *impl; }
280 const Impl& get_impl()
const {
return *impl; }
284 const std::unique_ptr<Impl> impl;
GraphvizFlags
Bitfield to control graphviz output.
Definition: Graphviz.h:36
Definition: Devicegraph.h:72
Definition: Devicegraph.h:96
Holder * find_holder(sid_t source_sid, sid_t 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.
void check(const CheckCallbacks *check_callbacks=nullptr) const
Checks the devicegraph.
uint64_t used_features() const
Calculates a bit-field with the used features of the devicegraph.
The master container of the libstorage.
Definition: Devicegraph.h:153
Definition: Devicegraph.h:104
Definition: Devicegraph.h:80
An abstract base class of storage devices, and a vertex in the Devicegraph.
Definition: Device.h:75
Definition: Devicegraph.h:56
bool holder_exists(sid_t source_sid, sid_t target_sid) const
Check whether the holder with source sid and target sid exists.
Definition: Devicegraph.h:88
Definition: Devicegraph.h:48
Definition: Devicegraph.h:64
void save(const std::string &filename) const
Definition: Devicegraph.h:112
void remove_device(sid_t sid)
Removes the device with sid from the devicegraph.
The main entry point to libstorage.
Definition: Storage.h:156
Device * find_device(sid_t sid)
void write_graphviz(const std::string &filename, GraphvizFlags flags=GraphvizFlags::NAME, GraphvizFlags tooltip_flags=GraphvizFlags::NONE) const
Writes the devicegraph in graphviz format.
Base class for storage exceptions.
Definition: Exception.h:113
The storage namespace.
Definition: Actiongraph.h:37
unsigned int sid_t
An integer storage ID.
Definition: Device.h:66
void load(const std::string &filename)
Definition: Storage.h:135