24 #ifndef STORAGE_STORAGE_H 25 #define STORAGE_STORAGE_H 32 #include <boost/noncopyable.hpp> 34 #include "storage/Filesystems/Mountable.h" 35 #include "storage/CommitOptions.h" 36 #include "storage/Utils/Callbacks.h" 103 virtual bool multipath(
bool looks_like_real_multipath)
const = 0;
117 virtual std::pair<bool, std::string>
luks(
const std::string& uuid,
int attempt)
const = 0;
133 const std::string& get_device_name()
const;
135 const std::string& get_uuid()
const;
137 const std::string& get_label()
const;
143 Impl& get_impl() {
return *impl; }
144 const Impl& get_impl()
const {
return *impl; }
148 const std::unique_ptr<Impl> impl;
167 virtual std::pair<bool, std::string>
luks(
const LuksInfo& info,
int attempt)
const = 0;
215 virtual bool missing_command(
const std::string& message,
const std::string& what,
216 const std::string& command, uint64_t used_features)
const = 0;
235 virtual void end()
const {}
246 virtual void error(
const std::string& message)
const = 0;
277 const Arch& get_arch()
const;
303 bool equal_devicegraph(
const std::string& lhs,
const std::string& rhs)
const;
398 const std::string& get_rootprefix()
const;
399 void set_rootprefix(
const std::string& rootprefix);
511 std::map<std::string, const Pool*>
get_pools()
const;
529 Impl& get_impl() {
return *impl; }
530 const Impl& get_impl()
const {
return *impl; }
534 const std::unique_ptr<Impl> impl;
Provides information whether deactivate() was able to deactivate subsystems.
Definition: Storage.h:177
void remove_pool(const std::string &name)
Remove a pool by name.
Definition: Environment.h:52
void probe(const ProbeCallbacks *probe_callbacks=nullptr)
Probe the system and replace the probed, system and staging devicegraphs.
MountByType get_default_mount_by() const
Query the default mount-by method.
Definition: Storage.h:221
Devicegraph * copy_devicegraph(const std::string &source_name, const std::string &dest_name)
void restore_devicegraph(const std::string &name)
const Devicegraph * get_probed() const
Return the probed devicegraph.
bool exist_devicegraph(const std::string &name) const
Check whether a devicegraph exists by name.
Storage(const Environment &environment)
Construct Storage object.
void check(const CheckCallbacks *check_callbacks=nullptr) const
Checks all devicegraphs.
void commit(const CommitOptions &commit_options, const CommitCallbacks *commit_callbacks=nullptr)
The actiongraph must be valid.
virtual void begin() const
Called at the begin of probing.
Definition: Storage.h:230
virtual std::pair< bool, std::string > luks(const std::string &uuid, int attempt) const =0
Decide whether the LUKS with uuid should be activated.
std::string prepend_rootprefix(const std::string &mount_point) const
Prepends the root prefix to a mount point if necessary.
bool exists_pool(const std::string &name) const
Check whether a pool exists by name.
DeactivateStatus deactivate() const
Deactivate devices like multipath, DM and MD RAID, LVM and LUKS.
const Actiongraph * calculate_actiongraph()
The actiongraph is only valid until either the probed or staging devicegraph is modified.
The main container of the libstorage-ng.
Definition: Devicegraph.h:169
Devicegraph * get_devicegraph(const std::string &name)
Return a devicegraph by name.
Definition: Storage.h:251
The actiongraph has all actions including the dependencies among them to get from one devicegraph to ...
Definition: Actiongraph.h:60
virtual bool multipath(bool looks_like_real_multipath) const =0
Decide whether multipath should be activated.
Pool * create_pool(const std::string &name)
Create a pool with name.
void set_default_mount_by(MountByType default_mount_by)
Set the default mount-by method.
Devicegraph * get_staging()
Return the staging devicegraph.
virtual bool missing_command(const std::string &message, const std::string &what, const std::string &command, uint64_t used_features) const =0
Callback for missing commands.
void activate(const ActivateCallbacks *activate_callbacks) const
Activate devices like multipath, DM and MD RAID, LVM and LUKS.
virtual void end() const
Called at the end of probing.
Definition: Storage.h:235
Stores information about a LUKS device.
Definition: Storage.h:125
Definition: Storage.h:197
Devicegraph * get_system()
Return the system devicegraph.
std::vector< std::string > get_devicegraph_names() const ST_DEPRECATED
Get the names of all devicegraphs.
std::map< std::string, const Pool * > get_pools() const
Get all pools with their names.
virtual std::pair< bool, std::string > luks(const LuksInfo &info, int attempt) const =0
Decide whether the LUKS should be activated.
std::vector< std::string > get_pool_names() const ST_DEPRECATED
Get the names of all pools.
Specialized callbacks with a more generic parameter for LUKS activation.
Definition: Storage.h:156
The main entry point to libstorage.
Definition: Storage.h:261
void generate_pools(const Devicegraph *devicegraph)
Generate pools, e.g.
Devicegraph * create_devicegraph(const std::string &name)
Create a devicegraph with name.
Definition: Storage.h:188
The storage namespace.
Definition: Actiongraph.h:38
void remove_devicegraph(const std::string &name)
Remove a devicegraph by name.
A pool represents a collection of devices.
Definition: Pool.h:80
Definition: Storage.h:240
std::map< std::string, const Devicegraph * > get_devicegraphs() const
Get all devicegraphs with their names.
Pool * get_pool(const std::string &name)
Return a pool by name.
Other storage subsystems are activated automatically, e.g.
Definition: Storage.h:92
MountByType
The key by which the mount program identifies a mountable.
Definition: Mountable.h:60