libstorage-ng
Loading...
Searching...
No Matches
storage::Holder Class Referenceabstract

An abstract base class for storage holders. More...

#include <Holder.h>

Inheritance diagram for storage::Holder:
[legend]
Collaboration diagram for storage::Holder:
[legend]

Public Member Functions

Deviceget_source ()
 Get the source device of the holder.
const Deviceget_source () const
 Get the source device of the holder.
void set_source (const Device *source)
 Set the source device of the holder.
void set_target (const Device *target)
 Set the target device of the holder.
sid_t get_source_sid () const
 Return the storage id (sid) of the source of the holder.
Deviceget_target ()
 Get the target device of the holder.
const Deviceget_target () const
 Get the target device of the holder.
sid_t get_target_sid () const
 Return the storage id (sid) of the target of the holder.
bool operator== (const Holder &rhs) const
bool operator!= (const Holder &rhs) const
Holdercopy_to_devicegraph (Devicegraph *devicegraph) const
 Copies the holder to the devicegraph.
bool exists_in_devicegraph (const Devicegraph *devicegraph) const
 Checks if the holder exists in the devicegraph.
bool exists_in_probed () const
 Checks if the holder exists in the probed devicegraph.
bool exists_in_staging () const
 Checks if the holder exists in the staging devicegraph.
bool exists_in_system () const
 Checks if the holder exists in the system devicegraph.
const std::map< std::string, std::string > & get_userdata () const
 Return the userdata of the holder.
void set_userdata (const std::map< std::string, std::string > &userdata)
 Set the userdata of the holder.
Devicegraphget_devicegraph ()
 Return the devicegraph the holder belongs to.
const Devicegraphget_devicegraph () const
 Return the devicegraph the holder belongs to.
Impl & get_impl ()
const Impl & get_impl () const
virtual Holderclone () const =0
void save (xmlNode *node) const ST_DEPRECATED

Protected Member Functions

 Holder (Impl *impl)
void create (Devicegraph *devicegraph, const Device *source, const Device *target) ST_DEPRECATED
 Create a holder between source and target in the devicegraph.
void load (Devicegraph *devicegraph, const xmlNode *node) ST_DEPRECATED

Friends

std::ostream & operator<< (std::ostream &out, const Holder &holder)

Detailed Description

An abstract base class for storage holders.

Storage holders are edges in the devicegraph.

See also
Devicegraph

Member Function Documentation

◆ copy_to_devicegraph()

Holder * storage::Holder::copy_to_devicegraph ( Devicegraph * devicegraph) const

Copies the holder to the devicegraph.

Does not copy devices. The purpose of the function is to restore parts of the probed devicegraph in the staging devicegraph that were previously deleted.

Source and target devices must already exist in devicegraph. Holder must not exist in devicegraph.

See also
Device::copy_to_devicegraph()
Exceptions
Exception

◆ create()

void storage::Holder::create ( Devicegraph * devicegraph,
const Device * source,
const Device * target )
protected

Create a holder between source and target in the devicegraph.

Duplicate holders of the same type are not allowed.

The created holder is owned by the devicegraph.

Exceptions
HolderAlreadyExists

◆ get_devicegraph()

const Devicegraph * storage::Holder::get_devicegraph ( ) const

Return the devicegraph the holder belongs to.

◆ get_source()

const Device * storage::Holder::get_source ( ) const

Get the source device of the holder.

◆ get_source_sid()

sid_t storage::Holder::get_source_sid ( ) const

Return the storage id (sid) of the source of the holder.

See also
sid_t

◆ get_target()

const Device * storage::Holder::get_target ( ) const

Get the target device of the holder.

◆ get_target_sid()

sid_t storage::Holder::get_target_sid ( ) const

Return the storage id (sid) of the target of the holder.

See also
sid_t

◆ set_source()

void storage::Holder::set_source ( const Device * source)

Set the source device of the holder.

Experimental.

The new source must not be the old source.

So far it is undefined whether this function adjusts the devices connected to the holder. E.g. setting a disk as source for a partition table adjusts the device names of the partitions but not the topology. This may change in the future.

Exceptions
Exception

◆ set_target()

void storage::Holder::set_target ( const Device * target)

Set the target device of the holder.

The new target must not be the old target.

See also
set_source(const Device*)
Exceptions
Exception

The documentation for this class was generated from the following file:
  • /home/abuild/rpmbuild/BUILD/libstorage-ng-4.5.260-build/libstorage-ng-4.5.260/storage/Holders/Holder.h