storage::Volume Class Reference

#include <Volume.h>

Inheritance diagram for storage::Volume:

storage::Dm storage::Loop storage::Md storage::Partition storage::Evms storage::LvmLv List of all members.

Public Member Functions

 Volume (const Container &d, unsigned Pnr, unsigned long long SizeK)
 Volume (const Container &d, const string &PName, unsigned long long SizeK)
 Volume (const Container &d)
 Volume (const Volume &)
Volumeoperator= (const Volume &)
virtual ~Volume ()
const string & device () const
const string & mountDevice () const
const string & loopDevice () const
const ContainergetContainer () const
storage::CType cType () const
bool deleted () const
bool created () const
bool silent () const
virtual const std::list< string > udevId () const
virtual const string & udevPath () const
virtual string sysfsPath () const
void setDeleted (bool val=true)
void setCreated (bool val=true)
void setReadonly (bool val=true)
void setSilent (bool val=true)
bool ignoreFstab () const
void setIgnoreFstab (bool val=true)
void setFstabAdded (bool val=true)
bool fstabAdded () const
const storage::usedBygetUsedBy () const
storage::UsedByType getUsedByType () const
const string & usedByName () const
void setUsedBy (storage::UsedByType t, const string &name)
virtual int setFormat (bool format=true, storage::FsType fs=storage::REISERFS)
void formattingDone ()
bool getFormat () const
void rename (const string &newName)
int changeFstabOptions (const string &options)
int changeMountBy (storage::MountByType mby)
virtual int changeMount (const string &m)
bool loop () const
bool loopActive () const
bool needLosetup () const
const string & getUuid () const
const string & getLabel () const
int setLabel (const string &val)
bool needLabel () const
storage::EncryptType getEncryption () const
void setEncryption (storage::EncryptType val=storage::ENC_TWOFISH)
int setEncryption (bool val)
const string & getCryptPwd () const
int setCryptPwd (const string &val)
void clearCryptPwd ()
const string & getMount () const
bool needRemount () const
bool needShrink () const
bool needExtend () const
long long extendSize () const
storage::FsType getFs () const
void setFs (storage::FsType val)
void setUuid (const string &id)
void initLabel (const string &lbl)
storage::MountByType getMountBy () const
const string & getFstabOption () const
void setFstabOption (const string &val)
bool needFstabUpdate () const
const string & getMkfsOption () const
int setMkfsOption (const string &val)
const std::list< string > & altNames () const
unsigned nr () const
unsigned long long sizeK () const
unsigned long long origSizeK () const
const string & name () const
unsigned long minorNr () const
unsigned long majorNr () const
void setMajorMinor (unsigned long Major, unsigned long Minor)
void setSize (unsigned long long SizeK)
virtual void setResizedSize (unsigned long long SizeK)
virtual void forgetResize ()
virtual bool canUseDevice () const
bool operator== (const Volume &rhs) const
bool operator!= (const Volume &rhs) const
bool operator< (const Volume &rhs) const
bool operator<= (const Volume &rhs) const
bool operator>= (const Volume &rhs) const
bool operator> (const Volume &rhs) const
bool equalContent (const Volume &rhs) const
string logDifference (const Volume &c) const
int prepareRemove ()
int umount (const string &mp="")
int loUnsetup ()
int mount (const string &mp="")
int canResize (unsigned long long newSizeK) const
int doMount ()
int doFormat ()
int doLosetup ()
int doSetLabel ()
int doFstabUpdate ()
int resizeFs ()
void fstabUpdateDone ()
bool isMounted () const
virtual string removeText (bool doing=true) const
virtual string createText (bool doing=true) const
virtual string resizeText (bool doing=true) const
virtual string formatText (bool doing=true) const
virtual void getCommitActions (std::list< storage::commitAction * > &l) const
string mountText (bool doing=true) const
string labelText (bool doing=true) const
string losetupText (bool doing=true) const
string fstabUpdateText () const
string sizeString () const
string bootMount () const
bool optNoauto () const
bool inCrypto () const
virtual void print (std::ostream &s) const
int getFreeLoop ()
void getInfo (storage::VolumeInfo &info) const
void mergeFstabInfo (storage::VolumeInfo &tinfo, const FstabEntry &fste) const
void updateFsData ()
const string & fsTypeString () const

Static Public Member Functions

static bool loopInUse (Storage *sto, const string &loopdev)
static bool notDeleted (const Volume &d)
static bool isDeleted (const Volume &d)
static bool getMajorMinor (const string &device, unsigned long &Major, unsigned long &Minor)
static bool loopStringNum (const string &name, unsigned &num)
static storage::EncryptType toEncType (const string &val)
static storage::FsType toFsType (const string &val)
static storage::MountByType toMountByType (const string &val)
static const string & fsTypeString (const storage::FsType type)
static const string & encTypeString (const storage::EncryptType type)
static const string & mbyTypeString (const storage::MountByType type)

Static Public Attributes

static SkipDeleted SkipDel

Protected Member Functions

void init ()
void setNameDev ()
int checkDevice ()
int checkDevice (const string &device)
storage::MountByType defaultMountBy (const string &mp="")
bool allowedMountBy (storage::MountByType mby, const string &mp="")
void getFsData (SystemCmd &blkidData)
void getLoopData (SystemCmd &loopData)
void getMountData (const ProcMounts &mountData)
void getFstabData (EtcFstab &fstabData)
void getTestmodeData (const string &data)
string getMountByString (storage::MountByType mby, const string &dev, const string &uuid, const string &label) const
void setExtError (const SystemCmd &cmd, bool serr=true)
std::ostream & logVolume (std::ostream &file) const
string getLosetupCmd (storage::EncryptType e, const string &pwdfile) const
storage::EncryptType detectLoopEncryption ()
string getFilesysSysfsPath () const
void triggerUdevUpdate ()

Protected Attributes

const Container *const cont
bool numeric
bool create
bool del
bool format
bool silnt
bool fstab_added
storage::FsType fs
storage::FsType detected_fs
storage::MountByType mount_by
storage::MountByType orig_mount_by
string uuid
string label
string orig_label
string mp
string orig_mp
string fstab_opt
string orig_fstab_opt
string mkfs_opt
bool is_loop
bool is_mounted
bool ignore_fstab
bool loop_active
bool ronly
storage::EncryptType encryption
storage::EncryptType orig_encryption
string loop_dev
string fstab_loop_dev
string crypt_pwd
string nm
std::list< string > alt_names
unsigned num
unsigned long long size_k
unsigned long long orig_size_k
string dev
unsigned long mnr
unsigned long mjr
storage::usedBy uby
storage::VolumeInfo info

Static Protected Attributes

static string fs_names [storage::FSNONE+1]
static string mb_names [storage::MOUNTBY_PATH+1] = { "device", "uuid", "label", "id", "path" }
static string enc_names [storage::ENC_UNKNOWN+1]
static string empty_string
static std::list< string > empty_slist

Friends

class Storage
std::ostream & operator<< (std::ostream &s, const Volume &v)

Classes

struct  SkipDeleted

Constructor & Destructor Documentation

Volume::Volume const Container d,
unsigned  Pnr,
unsigned long long  SizeK
 

Volume::Volume const Container d,
const string &  PName,
unsigned long long  SizeK
 

Volume::Volume const Container d  ) 
 

Volume::Volume const Volume  ) 
 

Volume::~Volume  )  [virtual]
 


Member Function Documentation

bool Volume::allowedMountBy storage::MountByType  mby,
const string &  mp = ""
[protected]
 

const std::list<string>& storage::Volume::altNames  )  const [inline]
 

string Volume::bootMount  )  const
 

int Volume::canResize unsigned long long  newSizeK  )  const
 

bool Volume::canUseDevice  )  const [virtual]
 

Reimplemented in storage::Partition.

int Volume::changeFstabOptions const string &  options  ) 
 

int Volume::changeMount const string &  m  )  [virtual]
 

Reimplemented in storage::Partition.

int Volume::changeMountBy storage::MountByType  mby  ) 
 

int Volume::checkDevice const string &  device  )  [protected]
 

int Volume::checkDevice  )  [protected]
 

void storage::Volume::clearCryptPwd  )  [inline]
 

bool storage::Volume::created  )  const [inline]
 

string Volume::createText bool  doing = true  )  const [virtual]
 

Reimplemented in storage::Evms, storage::Loop, storage::LvmLv, storage::Md, and storage::Partition.

CType Volume::cType  )  const
 

storage::MountByType Volume::defaultMountBy const string &  mp = ""  )  [protected]
 

bool storage::Volume::deleted  )  const [inline]
 

EncryptType Volume::detectLoopEncryption  )  [protected]
 

const string& storage::Volume::device  )  const [inline]
 

int Volume::doFormat  ) 
 

int Volume::doFstabUpdate  ) 
 

int Volume::doLosetup  ) 
 

int Volume::doMount  ) 
 

int Volume::doSetLabel  ) 
 

static const string& storage::Volume::encTypeString const storage::EncryptType  type  )  [inline, static]
 

bool Volume::equalContent const Volume rhs  )  const
 

long long storage::Volume::extendSize  )  const [inline]
 

virtual void storage::Volume::forgetResize  )  [inline, virtual]
 

Reimplemented in storage::Partition.

string Volume::formatText bool  doing = true  )  const [virtual]
 

Reimplemented in storage::Dm, storage::Evms, storage::Loop, storage::LvmLv, storage::Md, and storage::Partition.

void storage::Volume::formattingDone  )  [inline]
 

bool storage::Volume::fstabAdded  )  const [inline]
 

void Volume::fstabUpdateDone  ) 
 

string Volume::fstabUpdateText  )  const
 

static const string& storage::Volume::fsTypeString const storage::FsType  type  )  [inline, static]
 

const string& storage::Volume::fsTypeString  )  const [inline]
 

virtual void storage::Volume::getCommitActions std::list< storage::commitAction * > &  l  )  const [virtual]
 

Reimplemented in storage::Partition.

const Container* storage::Volume::getContainer  )  const [inline]
 

const string& storage::Volume::getCryptPwd  )  const [inline]
 

storage::EncryptType storage::Volume::getEncryption  )  const [inline]
 

string Volume::getFilesysSysfsPath  )  const [protected]
 

bool storage::Volume::getFormat  )  const [inline]
 

int Volume::getFreeLoop  ) 
 

storage::FsType storage::Volume::getFs  )  const [inline]
 

void Volume::getFsData SystemCmd blkidData  )  [protected]
 

void Volume::getFstabData EtcFstab fstabData  )  [protected]
 

const string& storage::Volume::getFstabOption  )  const [inline]
 

void Volume::getInfo storage::VolumeInfo info  )  const
 

const string& storage::Volume::getLabel  )  const [inline]
 

void Volume::getLoopData SystemCmd loopData  )  [protected]
 

string Volume::getLosetupCmd storage::EncryptType  e,
const string &  pwdfile
const [protected]
 

bool Volume::getMajorMinor const string &  device,
unsigned long &  Major,
unsigned long &  Minor
[static]
 

const string& storage::Volume::getMkfsOption  )  const [inline]
 

const string& storage::Volume::getMount  )  const [inline]
 

storage::MountByType storage::Volume::getMountBy  )  const [inline]
 

string Volume::getMountByString storage::MountByType  mby,
const string &  dev,
const string &  uuid,
const string &  label
const [protected]
 

void Volume::getMountData const ProcMounts mountData  )  [protected]
 

void Volume::getTestmodeData const string &  data  )  [protected]
 

const storage::usedBy& storage::Volume::getUsedBy  )  const [inline]
 

storage::UsedByType storage::Volume::getUsedByType  )  const [inline]
 

const string& storage::Volume::getUuid  )  const [inline]
 

bool storage::Volume::ignoreFstab  )  const [inline]
 

bool storage::Volume::inCrypto  )  const [inline]
 

void Volume::init  )  [protected]
 

Reimplemented in storage::Dm, storage::Loop, and storage::Md.

void storage::Volume::initLabel const string &  lbl  )  [inline]
 

static bool storage::Volume::isDeleted const Volume d  )  [inline, static]
 

bool storage::Volume::isMounted  )  const [inline]
 

string Volume::labelText bool  doing = true  )  const
 

string Volume::logDifference const Volume c  )  const
 

std::ostream& storage::Volume::logVolume std::ostream &  file  )  const [protected]
 

bool storage::Volume::loop  )  const [inline]
 

bool storage::Volume::loopActive  )  const [inline]
 

const string& storage::Volume::loopDevice  )  const [inline]
 

bool Volume::loopInUse Storage sto,
const string &  loopdev
[static]
 

bool Volume::loopStringNum const string &  name,
unsigned &  num
[static]
 

string Volume::losetupText bool  doing = true  )  const
 

int Volume::loUnsetup  ) 
 

unsigned long storage::Volume::majorNr  )  const [inline]
 

static const string& storage::Volume::mbyTypeString const storage::MountByType  type  )  [inline, static]
 

void Volume::mergeFstabInfo storage::VolumeInfo tinfo,
const FstabEntry fste
const
 

unsigned long storage::Volume::minorNr  )  const [inline]
 

int Volume::mount const string &  mp = ""  ) 
 

const string& storage::Volume::mountDevice  )  const [inline]
 

string Volume::mountText bool  doing = true  )  const
 

const string& storage::Volume::name  )  const [inline]
 

bool storage::Volume::needExtend  )  const [inline]
 

bool storage::Volume::needFstabUpdate  )  const [inline]
 

bool storage::Volume::needLabel  )  const [inline]
 

bool Volume::needLosetup  )  const
 

bool Volume::needRemount  )  const
 

bool storage::Volume::needShrink  )  const [inline]
 

static bool storage::Volume::notDeleted const Volume d  )  [inline, static]
 

unsigned storage::Volume::nr  )  const [inline]
 

bool storage::Volume::operator!= const Volume rhs  )  const [inline]
 

bool Volume::operator< const Volume rhs  )  const
 

bool storage::Volume::operator<= const Volume rhs  )  const [inline]
 

Volume & Volume::operator= const Volume  ) 
 

bool Volume::operator== const Volume rhs  )  const
 

bool storage::Volume::operator> const Volume rhs  )  const [inline]
 

bool storage::Volume::operator>= const Volume rhs  )  const [inline]
 

bool Volume::optNoauto  )  const
 

unsigned long long storage::Volume::origSizeK  )  const [inline]
 

int Volume::prepareRemove  ) 
 

virtual void storage::Volume::print std::ostream &  s  )  const [inline, virtual]
 

Reimplemented in storage::Dm, storage::Evms, storage::Loop, storage::LvmLv, storage::Md, and storage::Partition.

string Volume::removeText bool  doing = true  )  const [virtual]
 

Reimplemented in storage::Dm, storage::Evms, storage::Loop, storage::LvmLv, storage::Md, and storage::Partition.

void Volume::rename const string &  newName  ) 
 

int Volume::resizeFs  ) 
 

string Volume::resizeText bool  doing = true  )  const [virtual]
 

Reimplemented in storage::Evms, storage::LvmLv, and storage::Partition.

void storage::Volume::setCreated bool  val = true  )  [inline]
 

int Volume::setCryptPwd const string &  val  ) 
 

void storage::Volume::setDeleted bool  val = true  )  [inline]
 

int Volume::setEncryption bool  val  ) 
 

void storage::Volume::setEncryption storage::EncryptType  val = storage::ENC_TWOFISH  )  [inline]
 

void Volume::setExtError const SystemCmd cmd,
bool  serr = true
[protected]
 

int Volume::setFormat bool  format = true,
storage::FsType  fs = storage::REISERFS
[virtual]
 

Reimplemented in storage::Partition.

void storage::Volume::setFs storage::FsType  val  )  [inline]
 

void storage::Volume::setFstabAdded bool  val = true  )  [inline]
 

void storage::Volume::setFstabOption const string &  val  )  [inline]
 

void storage::Volume::setIgnoreFstab bool  val = true  )  [inline]
 

int Volume::setLabel const string &  val  ) 
 

void storage::Volume::setMajorMinor unsigned long  Major,
unsigned long  Minor
[inline]
 

int storage::Volume::setMkfsOption const string &  val  )  [inline]
 

void Volume::setNameDev  )  [protected]
 

void storage::Volume::setReadonly bool  val = true  )  [inline]
 

virtual void storage::Volume::setResizedSize unsigned long long  SizeK  )  [inline, virtual]
 

Reimplemented in storage::Partition.

void storage::Volume::setSilent bool  val = true  )  [inline]
 

void storage::Volume::setSize unsigned long long  SizeK  )  [inline]
 

void storage::Volume::setUsedBy storage::UsedByType  t,
const string &  name
[inline]
 

void storage::Volume::setUuid const string &  id  )  [inline]
 

Reimplemented in storage::LvmLv.

bool storage::Volume::silent  )  const [inline]
 

unsigned long long storage::Volume::sizeK  )  const [inline]
 

string Volume::sizeString  )  const
 

string Volume::sysfsPath  )  const [virtual]
 

Reimplemented in storage::Dm, and storage::Partition.

EncryptType Volume::toEncType const string &  val  )  [static]
 

FsType Volume::toFsType const string &  val  )  [static]
 

MountByType Volume::toMountByType const string &  val  )  [static]
 

void Volume::triggerUdevUpdate  )  [protected]
 

virtual const std::list<string> storage::Volume::udevId  )  const [inline, virtual]
 

Reimplemented in storage::Partition.

virtual const string& storage::Volume::udevPath  )  const [inline, virtual]
 

Reimplemented in storage::Partition.

int Volume::umount const string &  mp = ""  ) 
 

void Volume::updateFsData  ) 
 

const string& storage::Volume::usedByName  )  const [inline]
 


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  s,
const Volume v
[friend]
 

friend class Storage [friend]
 


Member Data Documentation

std::list<string> storage::Volume::alt_names [protected]
 

const Container* const storage::Volume::cont [protected]
 

bool storage::Volume::create [protected]
 

string storage::Volume::crypt_pwd [protected]
 

bool storage::Volume::del [protected]
 

storage::FsType storage::Volume::detected_fs [protected]
 

string storage::Volume::dev [protected]
 

list< string > Volume::empty_slist [static, protected]
 

string Volume::empty_string [static, protected]
 

string Volume::enc_names [static, protected]
 

Initial value:

 { "none", "twofish256", "twofish",
                               "twofishSL92", "unknown" }

storage::EncryptType storage::Volume::encryption [protected]
 

bool storage::Volume::format [protected]
 

storage::FsType storage::Volume::fs [protected]
 

string Volume::fs_names [static, protected]
 

Initial value:

 { "unknown", "reiserfs", "ext2", "ext3", "vfat",
                              "xfs", "jfs", "hfs", "ntfs", "swap", "none" }

bool storage::Volume::fstab_added [protected]
 

string storage::Volume::fstab_loop_dev [protected]
 

string storage::Volume::fstab_opt [protected]
 

bool storage::Volume::ignore_fstab [protected]
 

storage::VolumeInfo storage::Volume::info [mutable, protected]
 

Reimplemented in storage::Dm, storage::Evms, storage::Loop, storage::LvmLv, storage::Md, and storage::Partition.

bool storage::Volume::is_loop [protected]
 

bool storage::Volume::is_mounted [protected]
 

string storage::Volume::label [protected]
 

bool storage::Volume::loop_active [protected]
 

string storage::Volume::loop_dev [protected]
 

string Volume::mb_names = { "device", "uuid", "label", "id", "path" } [static, protected]
 

unsigned long storage::Volume::mjr [protected]
 

string storage::Volume::mkfs_opt [protected]
 

unsigned long storage::Volume::mnr [protected]
 

storage::MountByType storage::Volume::mount_by [protected]
 

string storage::Volume::mp [protected]
 

string storage::Volume::nm [protected]
 

unsigned storage::Volume::num [protected]
 

bool storage::Volume::numeric [protected]
 

storage::EncryptType storage::Volume::orig_encryption [protected]
 

string storage::Volume::orig_fstab_opt [protected]
 

string storage::Volume::orig_label [protected]
 

storage::MountByType storage::Volume::orig_mount_by [protected]
 

string storage::Volume::orig_mp [protected]
 

unsigned long long storage::Volume::orig_size_k [protected]
 

bool storage::Volume::ronly [protected]
 

bool storage::Volume::silnt [protected]
 

unsigned long long storage::Volume::size_k [protected]
 

SkipDeleted storage::Volume::SkipDel [static]
 

storage::usedBy storage::Volume::uby [protected]
 

string storage::Volume::uuid [protected]
 


The documentation for this class was generated from the following files:
Generated on Thu Jul 6 00:40:25 2006 for yast2-storage by  doxygen 1.4.6