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" 99 virtual bool multipath(
bool looks_like_real_multipath)
const = 0;
113 virtual std::pair<bool, std::string>
luks(
const std::string& uuid,
int attempt)
const = 0;
135 virtual std::pair<bool, std::string>
luks(
const LuksInfo& info,
int attempt)
const = 0;
151 const std::string& get_device_name()
const;
153 const std::string& get_uuid()
const;
155 const std::string& get_label()
const;
161 Impl& get_impl() {
return *impl; }
162 const Impl& get_impl()
const {
return *impl; }
166 const std::unique_ptr<Impl> impl;
213 virtual bool missing_command(
const std::string& message,
const std::string& what,
214 const std::string& command, uint64_t used_features)
const = 0;
233 virtual void end()
const {}
244 virtual void error(
const std::string& message)
const = 0;
275 const Arch& get_arch()
const;
297 bool equal_devicegraph(
const std::string& lhs,
const std::string& rhs)
const;
299 bool exist_devicegraph(
const std::string& name)
const;
300 std::vector<std::string> get_devicegraph_names()
const;
379 const std::string& get_rootprefix()
const;
380 void set_rootprefix(
const std::string& rootprefix);
463 Impl& get_impl() {
return *impl; }
464 const Impl& get_impl()
const {
return *impl; }
468 const std::unique_ptr<Impl> impl;
Provides information whether deactivate() was able to deactivate subsystems.
Definition: Storage.h:175
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:219
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.
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:228
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.
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 master container of the libstorage.
Definition: Devicegraph.h:153
Devicegraph * get_devicegraph(const std::string &name)
Return a devicegraph by name.
Definition: Storage.h:249
Definition: Actiongraph.h:55
virtual bool multipath(bool looks_like_real_multipath) const =0
Decide whether multipath should be activated.
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:233
Stores information about a LUKS device.
Definition: Storage.h:143
Definition: Storage.h:195
Devicegraph * get_system()
Return the system devicegraph.
virtual std::pair< bool, std::string > luks(const LuksInfo &info, int attempt) const =0
Decide whether the LUKS should be activated.
Specialized callbacks with a more generic parameter for LUKS activation.
Definition: Storage.h:124
The main entry point to libstorage.
Definition: Storage.h:259
Devicegraph * create_devicegraph(const std::string &name)
Definition: Storage.h:186
The storage namespace.
Definition: Actiongraph.h:37
void remove_devicegraph(const std::string &name)
Definition: Storage.h:238
Other storage subsystems are activated automatically, e.g.
Definition: Storage.h:88
MountByType
The key by which the mount program identifies a mountable.
Definition: Mountable.h:55