Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Volume Class Reference

#include <Volume.h>

Inheritance diagram for Volume:

Dm Loop Md Partition Evms 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
void setDeleted (bool val=true)
void setCreated (bool val=true)
void setReadonly (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
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)
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
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)
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 ()

Protected Attributes

const Container *const cont
bool numeric
bool create
bool del
bool format
bool silent
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_LABEL+1] = { "device", "uuid", "label" }
static string enc_names [storage::ENC_UNKNOWN+1]

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

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

string Volume::bootMount  )  const
 

int Volume::canResize unsigned long long  newSizeK  )  const
 

bool Volume::canUseDevice  )  const [virtual]
 

Reimplemented in Partition.

int Volume::changeFstabOptions const string &  options  ) 
 

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

Reimplemented in Partition.

int Volume::changeMountBy storage::MountByType  mby  ) 
 

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

int Volume::checkDevice  )  [protected]
 

void Volume::clearCryptPwd  )  [inline]
 

bool Volume::created  )  const [inline]
 

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

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

CType Volume::cType  )  const
 

bool Volume::deleted  )  const [inline]
 

EncryptType Volume::detectLoopEncryption  )  [protected]
 

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

int Volume::doFormat  ) 
 

int Volume::doFstabUpdate  ) 
 

int Volume::doLosetup  ) 
 

int Volume::doMount  ) 
 

int Volume::doSetLabel  ) 
 

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

bool Volume::equalContent const Volume rhs  )  const
 

long long Volume::extendSize  )  const [inline]
 

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

Reimplemented in Partition.

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

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

void Volume::formattingDone  )  [inline]
 

bool Volume::fstabAdded  )  const [inline]
 

void Volume::fstabUpdateDone  ) 
 

string Volume::fstabUpdateText  )  const
 

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

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

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

Reimplemented in Partition.

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

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

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

bool Volume::getFormat  )  const [inline]
 

int Volume::getFreeLoop  ) 
 

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

void Volume::getFsData SystemCmd blkidData  )  [protected]
 

void Volume::getFstabData EtcFstab fstabData  )  [protected]
 

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

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

const string& 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& Volume::getMkfsOption  )  const [inline]
 

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

storage::MountByType 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& Volume::getUsedBy  )  const [inline]
 

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

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

bool Volume::ignoreFstab  )  const [inline]
 

bool Volume::inCrypto  )  const [inline]
 

void Volume::init  )  [protected]
 

Reimplemented in Dm, Loop, and Md.

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

bool Volume::isMounted  )  const [inline]
 

string Volume::labelText bool  doing = true  )  const
 

string Volume::logDifference const Volume c  )  const
 

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

bool Volume::loop  )  const [inline]
 

bool Volume::loopActive  )  const [inline]
 

const string& 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 Volume::majorNr  )  const [inline]
 

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

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

unsigned long Volume::minorNr  )  const [inline]
 

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

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

string Volume::mountText bool  doing = true  )  const
 

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

bool Volume::needExtend  )  const [inline]
 

bool Volume::needFstabUpdate  )  const [inline]
 

bool Volume::needLabel  )  const [inline]
 

bool Volume::needLosetup  )  const [inline]
 

bool Volume::needRemount  )  const
 

bool Volume::needShrink  )  const [inline]
 

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

unsigned Volume::nr  )  const [inline]
 

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

bool Volume::operator< const Volume rhs  )  const
 

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

Volume & Volume::operator= const Volume  ) 
 

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

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

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

bool Volume::optNoauto  )  const
 

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

int Volume::prepareRemove  ) 
 

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

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

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

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

int Volume::resizeFs  ) 
 

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

Reimplemented in Evms, LvmLv, and Partition.

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

int Volume::setCryptPwd const string &  val  ) 
 

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

int Volume::setEncryption bool  val  ) 
 

void 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 Partition.

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

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

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

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

int Volume::setLabel const string &  val  ) 
 

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

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

void Volume::setNameDev  )  [protected]
 

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

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

Reimplemented in Partition.

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

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

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

string Volume::sizeString  )  const
 

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

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

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

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

const string& 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> Volume::alt_names [protected]
 

const Container* const Volume::cont [protected]
 

bool Volume::create [protected]
 

string Volume::crypt_pwd [protected]
 

bool Volume::del [protected]
 

storage::FsType Volume::detected_fs [protected]
 

string Volume::dev [protected]
 

string Volume::enc_names [static, protected]
 

Initial value:

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

storage::EncryptType Volume::encryption [protected]
 

bool Volume::format [protected]
 

storage::FsType Volume::fs [protected]
 

string Volume::fs_names [static, protected]
 

Initial value:

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

bool Volume::fstab_added [protected]
 

string Volume::fstab_loop_dev [protected]
 

string Volume::fstab_opt [protected]
 

bool Volume::ignore_fstab [protected]
 

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

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

bool Volume::is_loop [protected]
 

bool Volume::is_mounted [protected]
 

string Volume::label [protected]
 

bool Volume::loop_active [protected]
 

string Volume::loop_dev [protected]
 

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

unsigned long Volume::mjr [protected]
 

string Volume::mkfs_opt [protected]
 

unsigned long Volume::mnr [protected]
 

storage::MountByType Volume::mount_by [protected]
 

string Volume::mp [protected]
 

string Volume::nm [protected]
 

unsigned Volume::num [protected]
 

bool Volume::numeric [protected]
 

storage::EncryptType Volume::orig_encryption [protected]
 

string Volume::orig_fstab_opt [protected]
 

string Volume::orig_label [protected]
 

storage::MountByType Volume::orig_mount_by [protected]
 

string Volume::orig_mp [protected]
 

unsigned long long Volume::orig_size_k [protected]
 

bool Volume::ronly [protected]
 

bool Volume::silent [protected]
 

unsigned long long Volume::size_k [protected]
 

SkipDeleted Volume::SkipDel [static]
 

storage::usedBy Volume::uby [protected]
 

string Volume::uuid [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Sep 14 11:27:09 2005 for yast2-storage by  doxygen 1.4.4