libstorage-ng
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
storage::LvmPv Class Reference
Inheritance diagram for storage::LvmPv:
[legend]
Collaboration diagram for storage::LvmPv:
[legend]

Public Member Functions

bool has_blk_device () const
 Check whether the physical volume has a block device. More...
 
BlkDeviceget_blk_device ()
 Return the block device this physical volume is using. More...
 
const BlkDeviceget_blk_device () const
 Return the block device this physical volume is using. More...
 
unsigned long long get_usable_size () const
 Get the size of the PV usable for extents in bytes. More...
 
bool has_lvm_vg () const
 Check whether the physical volume is part of a volume group.
 
LvmVgget_lvm_vg ()
 Return the volume group the physical volume is used in. More...
 
const LvmVgget_lvm_vg () const
 Return the volume group the physical volume is used in. More...
 
Impl & get_impl ()
 
const Impl & get_impl () const
 
virtual LvmPvclone () const override
 
- Public Member Functions inherited from storage::Device
sid_t get_sid () const
 Return the storage id (sid) of the device. More...
 
bool operator== (const Device &rhs) const
 
bool operator!= (const Device &rhs) const
 
Devicecopy_to_devicegraph (Devicegraph *devicegraph) const
 Copies the device to the devicegraph. More...
 
bool exists_in_devicegraph (const Devicegraph *devicegraph) const
 Checks if the device exists in the devicegraph.
 
bool exists_in_probed () const
 Checks if the device exists in the probed devicegraph.
 
bool exists_in_staging () const
 Checks if the device exists in the staging devicegraph.
 
bool exists_in_system () const
 Checks if the device exists in the system devicegraph.
 
std::string get_displayname () const
 
ResizeInfo detect_resize_info () const
 Detect the resize info of the device. More...
 
bool has_children () const
 
size_t num_children () const
 
bool has_parents () const
 
size_t num_parents () const
 
std::vector< Device * > get_children ()
 
std::vector< const Device * > get_children () const
 
std::vector< Device * > get_children (View view)
 Get all children of the device.
 
std::vector< const Device * > get_children (View view) const
 Get all children of the device. More...
 
std::vector< Device * > get_parents ()
 
std::vector< const Device * > get_parents () const
 
std::vector< Device * > get_parents (View view)
 Get all parents of the device.
 
std::vector< const Device * > get_parents (View view) const
 Get all parents of the device. More...
 
std::vector< Device * > get_siblings (bool itself)
 
std::vector< const Device * > get_siblings (bool itself) const
 
std::vector< Device * > get_descendants (bool itself)
 
std::vector< const Device * > get_descendants (bool itself) const
 
std::vector< Device * > get_descendants (bool itself, View view)
 
std::vector< const Device * > get_descendants (bool itself, View view) const
 
std::vector< Device * > get_ancestors (bool itself)
 
std::vector< const Device * > get_ancestors (bool itself) const
 
std::vector< Device * > get_leaves (bool itself)
 
std::vector< const Device * > get_leaves (bool itself) const
 
std::vector< Device * > get_roots (bool itself)
 
std::vector< const Device * > get_roots (bool itself) const
 
std::vector< Holder * > get_in_holders ()
 
std::vector< const Holder * > get_in_holders () const
 
std::vector< Holder * > get_out_holders ()
 
std::vector< const Holder * > get_out_holders () const
 
void remove_descendants () ST_DEPRECATED
 
void remove_descendants (View view)
 Remove all descendants of the device. More...
 
const std::map< std::string, std::string > & get_userdata () const
 Return the userdata of the device.
 
void set_userdata (const std::map< std::string, std::string > &userdata)
 Set the userdata of the device.
 
std::string get_name_sort_key () const
 Get a sort-key based on the device name. More...
 
Devicegraphget_devicegraph ()
 Return the devicegraph the device belongs to.
 
const Devicegraphget_devicegraph () const
 Return the devicegraph the device belongs to. More...
 
Impl & get_impl ()
 
const Impl & get_impl () const
 
void save (xmlNode *node) const ST_DEPRECATED
 

Static Public Member Functions

static LvmPvcreate (Devicegraph *devicegraph)
 Create a device of type LvmPv. More...
 
static LvmPvload (Devicegraph *devicegraph, const xmlNode *node)
 
static std::vector< LvmPv * > get_all (Devicegraph *devicegraph)
 Get all LvmPvs.
 
static std::vector< const LvmPv * > get_all (const Devicegraph *devicegraph)
 Get all LvmPvs. More...
 
- Static Public Member Functions inherited from storage::Device
static std::vector< Device * > get_all (Devicegraph *devicegraph)
 Get all Devices.
 
static std::vector< const Device * > get_all (const Devicegraph *devicegraph)
 Get all Devices. More...
 
static bool compare_by_sid (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by sid. More...
 
static bool compare_by_name (const Device *lhs, const Device *rhs)
 Compare (less than) two Devices by name. More...
 

Protected Member Functions

 LvmPv (Impl *impl)
 
- Protected Member Functions inherited from storage::Device
 Device (Impl *impl)
 
void create (Devicegraph *devicegraph)
 Create a device in the devicegraph. More...
 
void load (Devicegraph *devicegraph)
 

Member Function Documentation

◆ create()

static LvmPv* storage::LvmPv::create ( Devicegraph devicegraph)
static

Create a device of type LvmPv.

Usually this function is not called directly. Instead LvmVg::add_lvm_pv() is called.

See also
Device::create(Devicegraph*)

◆ get_all()

static std::vector<const LvmPv*> storage::LvmPv::get_all ( const Devicegraph devicegraph)
static

Get all LvmPvs.

◆ get_blk_device() [1/2]

BlkDevice* storage::LvmPv::get_blk_device ( )

Return the block device this physical volume is using.

Exceptions
Exception

◆ get_blk_device() [2/2]

const BlkDevice* storage::LvmPv::get_blk_device ( ) const

Return the block device this physical volume is using.

Exceptions
Exception

◆ get_lvm_vg() [1/2]

LvmVg* storage::LvmPv::get_lvm_vg ( )

Return the volume group the physical volume is used in.

Exceptions
Exception

◆ get_lvm_vg() [2/2]

const LvmVg* storage::LvmPv::get_lvm_vg ( ) const

Return the volume group the physical volume is used in.

Exceptions
Exception

◆ get_usable_size()

unsigned long long storage::LvmPv::get_usable_size ( ) const

Get the size of the PV usable for extents in bytes.

Can be 0 (if pe_start >= size of blk device).

Exceptions
Exception

◆ has_blk_device()

bool storage::LvmPv::has_blk_device ( ) const

Check whether the physical volume has a block device.

Normally this is the case, but LVM may report block devices as missing during probing.


The documentation for this class was generated from the following file: