libstorage-ng
|
This class represents stray block devices. More...
#include <StrayBlkDevice.h>
Public Member Functions | |
Impl & | get_impl () |
const Impl & | get_impl () const |
virtual StrayBlkDevice * | clone () const override |
![]() | |
const std::string & | get_name () const |
void | set_name (const std::string &name) |
const Region & | get_region () const |
void | set_region (const Region ®ion) |
unsigned long long | get_size () const |
void | set_size (unsigned long long size) |
std::string | get_size_string () const |
bool | is_active () const |
const std::string & | get_sysfs_name () const |
const std::string & | get_sysfs_path () const |
const std::vector< std::string > & | get_udev_paths () const |
const std::vector< std::string > & | get_udev_ids () const |
bool | is_usable_as_blk_device () const |
Checks whether the blk device is in general usable as a blk device. More... | |
const std::string & | get_dm_table_name () const |
Return device-mapper table name (dm-table-name for short). More... | |
void | set_dm_table_name (const std::string &dm_table_name) |
BlkFilesystem * | create_blk_filesystem (FsType fs_type) |
Creates a block filesystem on the block device. More... | |
bool | has_blk_filesystem () const |
BlkFilesystem * | get_blk_filesystem () |
const BlkFilesystem * | get_blk_filesystem () const |
BlkFilesystem * | create_filesystem (FsType fs_type) ST_DEPRECATED |
Creates a block filesystem on the block device. More... | |
bool | has_filesystem () const ST_DEPRECATED |
BlkFilesystem * | get_filesystem () ST_DEPRECATED |
const BlkFilesystem * | get_filesystem () const ST_DEPRECATED |
Encryption * | create_encryption (const std::string &dm_name) |
Creates an encryption device on the blk device. More... | |
void | remove_encryption () |
Removes an encryption device on the blk device. More... | |
bool | has_encryption () const |
Encryption * | get_encryption () |
const Encryption * | get_encryption () const |
Impl & | get_impl () |
const Impl & | get_impl () const |
![]() | |
sid_t | get_sid () const |
bool | operator== (const Device &rhs) const |
bool | operator!= (const Device &rhs) const |
Device * | copy_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_parents () |
std::vector< const Device * > | get_parents () const |
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_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 () |
const std::map< std::string, std::string > & | get_userdata () const |
void | set_userdata (const std::map< std::string, std::string > &userdata) |
Devicegraph * | get_devicegraph () |
const Devicegraph * | get_devicegraph () const |
Impl & | get_impl () |
const Impl & | get_impl () const |
void | save (xmlNode *node) const |
Static Public Member Functions | |
static StrayBlkDevice * | create (Devicegraph *devicegraph, const std::string &name) |
static StrayBlkDevice * | create (Devicegraph *devicegraph, const std::string &name, const Region ®ion) |
static StrayBlkDevice * | create (Devicegraph *devicegraph, const std::string &name, unsigned long long size) |
static StrayBlkDevice * | load (Devicegraph *devicegraph, const xmlNode *node) |
static std::vector< StrayBlkDevice * > | get_all (Devicegraph *devicegraph) |
Get all StrayBlkDevices. | |
static std::vector< const StrayBlkDevice * > | get_all (const Devicegraph *devicegraph) |
Get all StrayBlkDevices. More... | |
static StrayBlkDevice * | find_by_name (Devicegraph *devicegraph, const std::string &name) |
Find a StrayBlkDevice by its name. More... | |
static const StrayBlkDevice * | find_by_name (const Devicegraph *devicegraph, const std::string &name) |
Find a StrayBlkDevice by its name. More... | |
![]() | |
static std::vector< BlkDevice * > | get_all (Devicegraph *devicegraph) |
Get all BlkDevices. | |
static std::vector< const BlkDevice * > | get_all (const Devicegraph *devicegraph) |
Get all BlkDevices. More... | |
static BlkDevice * | find_by_name (Devicegraph *devicegraph, const std::string &name) |
Find a block device by its name. More... | |
static const BlkDevice * | find_by_name (const Devicegraph *devicegraph, const std::string &name) |
Find a block device by its name. More... | |
static BlkDevice * | find_by_any_name (Devicegraph *devicegraph, const std::string &name) |
Find a block device by any name including any symbolic links in /dev. More... | |
static const BlkDevice * | find_by_any_name (const Devicegraph *devicegraph, const std::string &name) |
Find a block device by any name including any symbolic links in /dev. More... | |
static bool | compare_by_dm_table_name (const BlkDevice *lhs, const BlkDevice *rhs) |
Compare (less than) two BlkDevices by DM table name. | |
![]() | |
static std::vector< Device * > | get_all (Devicegraph *devicegraph) |
static std::vector< const Device * > | get_all (const Devicegraph *devicegraph) |
static bool | compare_by_sid (const Device *lhs, const Device *rhs) |
Compare (less than) two Devices by sid. | |
static bool | compare_by_name (const Device *lhs, const Device *rhs) |
Compare (less than) two Devices by name. More... | |
Protected Member Functions | |
StrayBlkDevice (Impl *impl) | |
![]() | |
BlkDevice (Impl *impl) | |
![]() | |
Device (Impl *impl) | |
void | create (Devicegraph *devicegraph) |
void | load (Devicegraph *devicegraph) |
This class represents stray block devices.
Stray block devices have no parent in the devicegraph and cannot be partitioned.
Normally only Disks and Dasds have no parents in the devicegraph but Disks and Dasds can be partitioned.
Currently only Xen Virtual Partitions are represented as stray block devices (e.g. /dev/xvda1). Note that partitionable devices in Xen are represented as Disks (e.g. /dev/xvda) and partitions on them as normal Partitions (e.g. also /dev/xvda1).
Note: If YaST supports filesystems directly on disks this class might be obsolete and be removed.
|
static |
Find a StrayBlkDevice by its name.
Only the name returned by get_name() is considered.
DeviceNotFound,DeviceHasWrongType |
|
static |
Find a StrayBlkDevice by its name.
Only the name returned by get_name() is considered.
DeviceNotFound,DeviceHasWrongType |
|
static |
Get all StrayBlkDevices.