storage::Disk Class Reference

#include <Disk.h>

Inheritance diagram for storage::Disk:

storage::Container storage::Dasd List of all members.

Public Member Functions

 Disk (Storage *const s, const string &Name, unsigned long long Size)
 Disk (Storage *const s, const string &Name, unsigned num, unsigned long long Size, ProcPart &ppart)
 Disk (const Disk &rhs)
virtual ~Disk ()
unsigned long cylinders () const
unsigned heads () const
unsigned sectors () const
unsigned long long sizeK () const
unsigned long minorNr () const
unsigned long majorNr () const
unsigned long numMinor () const
unsigned long cylSizeB () const
unsigned maxPrimary () const
unsigned maxLogical () const
const string & labelName () const
const string & udevPath () const
const std::list< string > & udevId () const
void addMpAlias (const string &dev)
void clearMpAlias ()
const std::list< string > & mpAlias () const
const string & sysfsDir () const
unsigned numPartitions () const
bool isDasd () const
bool isLogical (unsigned nr) const
void setUdevData (const string &path, const string &id)
virtual int createPartition (storage::PartitionType type, long unsigned start, long unsigned len, string &device, bool checkRelaxed=false)
int createPartition (long unsigned len, string &device, bool checkRelaxed=false)
int createPartition (storage::PartitionType type, string &device)
virtual int removePartition (unsigned nr)
virtual int changePartitionId (unsigned nr, unsigned id)
virtual int initializeDisk (bool)
bool initializeDisk () const
void resetInitDisk ()
int forgetChangePartitionId (unsigned nr)
int changePartitionArea (unsigned nr, unsigned long start, unsigned long size, bool checkRelaxed=false)
int nextFreePartition (storage::PartitionType type, unsigned &nr, string &device)
int destroyPartitionTable (const string &new_label)
unsigned availablePartNumber (storage::PartitionType type=storage::PRIMARY)
virtual void getCommitActions (std::list< storage::commitAction * > &l) const
virtual int getToCommit (storage::CommitStage stage, std::list< Container * > &col, std::list< Volume * > &vol)
virtual int commitChanges (storage::CommitStage stage)
int commitChanges (storage::CommitStage stage, Volume *vol)
virtual int resizePartition (Partition *p, unsigned long newCyl)
int resizeVolume (Volume *v, unsigned long long newSize)
int removeVolume (Volume *v)
void getUnusedSpace (std::list< Region > &free, bool all=true, bool logical=false)
bool hasExtended () const
string setDiskLabelText (bool doing=true) const
unsigned long long cylinderToKb (unsigned long) const
unsigned long kbToCylinder (unsigned long long) const
string getPartName (unsigned nr) const
void getInfo (storage::DiskInfo &info) const
bool equalContent (const Disk &rhs) const
void logDifference (const Disk &d) const
Diskoperator= (const Disk &rhs)
bool FakeDisk () const

Static Public Member Functions

static storage::CType const staticType ()
static bool needP (const string &dev)
static string getPartName (const string &disk, unsigned nr)
static string getPartName (const string &disk, const string &nr)
static std::pair< string,
long > 
getDiskPartition (const string &dev)

Protected Types

typedef CastIterator< VIter,
Partition * > 
PartInter
typedef CastIterator< CVIter,
const Partition * > 
PartCInter
typedef CheckFnc< const PartitionCheckFncPartition
typedef CheckerIterator< CheckFncPartition,
PartitionPI< CheckFncPartition
>::type, PartInter, Partition
PartPIterator
typedef CheckerIterator< CheckFncPartition,
PartitionCPI< CheckFncPartition
>::type, PartCInter, const
Partition
PartCPIterator
typedef DerefIterator< PartPIterator,
Partition
PartIter
typedef DerefIterator< PartCPIterator,
const Partition
ConstPartIter
typedef IterPair< PartIterPartPair
typedef IterPair< ConstPartIterConstPartPair

Protected Member Functions

PartPair partPair (bool(*CheckPart)(const Partition &)=NULL)
PartIter partBegin (bool(*CheckPart)(const Partition &)=NULL)
PartIter partEnd (bool(*CheckPart)(const Partition &)=NULL)
ConstPartPair partPair (bool(*CheckPart)(const Partition &)=NULL) const
ConstPartIter partBegin (bool(*CheckPart)(const Partition &)=NULL) const
ConstPartIter partEnd (bool(*CheckPart)(const Partition &)=NULL) const
 Disk (Storage *const s, const string &File)
unsigned long long capacityInKb () const
virtual bool detectGeometry ()
virtual bool detectPartitions (ProcPart &ppart)
bool getSysfsInfo (const string &SysFsDir)
int checkSystemError (const string &cmd_line, const SystemCmd &cmd)
int execCheckFailed (const string &cmd_line)
int execCheckFailed (SystemCmd &cmd, const string &cmd_line)
bool checkPartedOutput (const SystemCmd &cmd, ProcPart &ppart)
bool scanPartedLine (const string &Line, unsigned &nr, unsigned long &start, unsigned long &csize, storage::PartitionType &type, unsigned &id, bool &boot)
bool checkPartedValid (const ProcPart &pp, const string &diskname, std::list< Partition * > &pl, unsigned long &rng)
bool getPartedValues (Partition *p)
bool getPartedSectors (const Partition *p, unsigned long long &start, unsigned long long &end)
const PartitiongetPartitionAfter (const Partition *p)
virtual void print (std::ostream &s) const
virtual ContainergetCopy () const
void getGeometry (const string &line, unsigned long &c, unsigned &h, unsigned &s)
virtual void redetectGeometry ()
void changeNumbers (const PartIter &b, const PartIter &e, unsigned start, int incr)
int createChecks (storage::PartitionType &type, unsigned long start, unsigned long len, bool checkRelaxed)
void removePresentPartitions ()
void removeFromMemory ()
virtual int doCreate (Volume *v)
virtual int doRemove (Volume *v)
virtual int doResize (Volume *v)
virtual int doSetType (Volume *v)
virtual int doCreateLabel ()
void logData (const string &Dir)
bool haveBsdPart (const std::list< Partition * > &pl) const
void setLabelData (const string &)

Static Protected Member Functions

static bool notDeleted (const Partition &d)
static string defaultLabel ()

Protected Attributes

unsigned long cyl
unsigned head
unsigned sector
unsigned long new_cyl
unsigned new_head
unsigned new_sector
string label
string udev_path
std::list< string > udev_id
std::list< string > mp_alias
string detected_label
string system_stderr
string logfile_name
string sysfs_dir
unsigned max_primary
bool ext_possible
bool init_disk
unsigned max_logical
unsigned long byte_cyl
unsigned long long size_k
unsigned long mnr
unsigned long mjr
unsigned long range
storage::DiskInfo info

Static Protected Attributes

static label_info labels []
static string p_disks [] = { "cciss/", "ida/", "ataraid/", "etherd/", "rd/" }

Friends

class Storage
class Dasd
std::ostream & operator<< (std::ostream &, const Disk &)

Classes

struct  label_info
struct  PartitionCPI
struct  PartitionPI

Member Typedef Documentation

typedef CheckFnc<const Partition> storage::Disk::CheckFncPartition [protected]
 

typedef DerefIterator<PartCPIterator,const Partition> storage::Disk::ConstPartIter [protected]
 

typedef IterPair<ConstPartIter> storage::Disk::ConstPartPair [protected]
 

typedef CastIterator<CVIter, const Partition *> storage::Disk::PartCInter [protected]
 

typedef CheckerIterator< CheckFncPartition, PartitionCPI<CheckFncPartition>::type, PartCInter, const Partition > storage::Disk::PartCPIterator [protected]
 

typedef CastIterator<VIter, Partition *> storage::Disk::PartInter [protected]
 

typedef DerefIterator<PartPIterator,Partition> storage::Disk::PartIter [protected]
 

typedef IterPair<PartIter> storage::Disk::PartPair [protected]
 

typedef CheckerIterator< CheckFncPartition, PartitionPI<CheckFncPartition>::type, PartInter, Partition > storage::Disk::PartPIterator [protected]
 


Constructor & Destructor Documentation

Disk::Disk Storage *const   s,
const string &  Name,
unsigned long long  Size
 

Disk::Disk Storage *const   s,
const string &  Name,
unsigned  num,
unsigned long long  Size,
ProcPart ppart
 

Disk::Disk const Disk rhs  ) 
 

Disk::~Disk  )  [virtual]
 

Disk::Disk Storage *const   s,
const string &  File
[protected]
 


Member Function Documentation

void Disk::addMpAlias const string &  dev  ) 
 

unsigned Disk::availablePartNumber storage::PartitionType  type = storage::PRIMARY  ) 
 

unsigned long long storage::Disk::capacityInKb  )  const [inline, protected]
 

void Disk::changeNumbers const PartIter b,
const PartIter e,
unsigned  start,
int  incr
[protected]
 

int Disk::changePartitionArea unsigned  nr,
unsigned long  start,
unsigned long  size,
bool  checkRelaxed = false
 

int Disk::changePartitionId unsigned  nr,
unsigned  id
[virtual]
 

Reimplemented in storage::Dasd.

bool Disk::checkPartedOutput const SystemCmd cmd,
ProcPart ppart
[protected]
 

bool storage::Disk::checkPartedValid const ProcPart pp,
const string &  diskname,
std::list< Partition * > &  pl,
unsigned long &  rng
[protected]
 

int Disk::checkSystemError const string &  cmd_line,
const SystemCmd cmd
[protected]
 

void storage::Disk::clearMpAlias  )  [inline]
 

int Disk::commitChanges storage::CommitStage  stage,
Volume vol
[virtual]
 

Reimplemented from storage::Container.

int Disk::commitChanges storage::CommitStage  stage  )  [virtual]
 

Reimplemented from storage::Container.

Reimplemented in storage::Dasd.

int Disk::createChecks storage::PartitionType type,
unsigned long  start,
unsigned long  len,
bool  checkRelaxed
[protected]
 

int Disk::createPartition storage::PartitionType  type,
string &  device
 

int storage::Disk::createPartition long unsigned  len,
string &  device,
bool  checkRelaxed = false
 

virtual int storage::Disk::createPartition storage::PartitionType  type,
long unsigned  start,
long unsigned  len,
string &  device,
bool  checkRelaxed = false
[virtual]
 

Reimplemented in storage::Dasd.

unsigned long storage::Disk::cylinders  )  const [inline]
 

unsigned long long Disk::cylinderToKb unsigned  long  )  const
 

unsigned long storage::Disk::cylSizeB  )  const [inline]
 

string Disk::defaultLabel  )  [static, protected]
 

int Disk::destroyPartitionTable const string &  new_label  ) 
 

bool Disk::detectGeometry  )  [protected, virtual]
 

Reimplemented in storage::Dasd.

bool Disk::detectPartitions ProcPart ppart  )  [protected, virtual]
 

Reimplemented in storage::Dasd.

int Disk::doCreate Volume v  )  [protected, virtual]
 

Reimplemented from storage::Container.

Reimplemented in storage::Dasd.

int Disk::doCreateLabel  )  [protected, virtual]
 

Reimplemented in storage::Dasd.

int Disk::doRemove Volume v  )  [protected, virtual]
 

Reimplemented from storage::Container.

Reimplemented in storage::Dasd.

int Disk::doResize Volume v  )  [protected, virtual]
 

Reimplemented from storage::Container.

Reimplemented in storage::Dasd.

int Disk::doSetType Volume v  )  [protected, virtual]
 

Reimplemented in storage::Dasd.

bool Disk::equalContent const Disk rhs  )  const
 

int Disk::execCheckFailed SystemCmd cmd,
const string &  cmd_line
[protected]
 

int Disk::execCheckFailed const string &  cmd_line  )  [protected]
 

bool storage::Disk::FakeDisk  )  const [inline]
 

int Disk::forgetChangePartitionId unsigned  nr  ) 
 

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

Reimplemented from storage::Container.

Reimplemented in storage::Dasd.

virtual Container* storage::Disk::getCopy  )  const [inline, protected, virtual]
 

Reimplemented from storage::Container.

pair< string, long > Disk::getDiskPartition const string &  dev  )  [static]
 

void Disk::getGeometry const string &  line,
unsigned long &  c,
unsigned &  h,
unsigned &  s
[protected]
 

void Disk::getInfo storage::DiskInfo info  )  const
 

bool Disk::getPartedSectors const Partition p,
unsigned long long &  start,
unsigned long long &  end
[protected]
 

bool Disk::getPartedValues Partition p  )  [protected]
 

const Partition * Disk::getPartitionAfter const Partition p  )  [protected]
 

string Disk::getPartName const string &  disk,
const string &  nr
[static]
 

string Disk::getPartName const string &  disk,
unsigned  nr
[static]
 

string Disk::getPartName unsigned  nr  )  const
 

bool Disk::getSysfsInfo const string &  SysFsDir  )  [protected]
 

virtual int storage::Disk::getToCommit storage::CommitStage  stage,
std::list< Container * > &  col,
std::list< Volume * > &  vol
[virtual]
 

Reimplemented from storage::Container.

Reimplemented in storage::Dasd.

void storage::Disk::getUnusedSpace std::list< Region > &  free,
bool  all = true,
bool  logical = false
 

bool Disk::hasExtended  )  const
 

bool storage::Disk::haveBsdPart const std::list< Partition * > &  pl  )  const [protected]
 

unsigned storage::Disk::heads  )  const [inline]
 

bool storage::Disk::initializeDisk  )  const [inline]
 

virtual int storage::Disk::initializeDisk bool   )  [inline, virtual]
 

Reimplemented in storage::Dasd.

bool storage::Disk::isDasd  )  const [inline]
 

bool Disk::isLogical unsigned  nr  )  const
 

unsigned long Disk::kbToCylinder unsigned long  long  )  const
 

const string& storage::Disk::labelName  )  const [inline]
 

void Disk::logData const string &  Dir  )  [protected, virtual]
 

Reimplemented from storage::Container.

void Disk::logDifference const Disk d  )  const
 

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

unsigned storage::Disk::maxLogical  )  const [inline]
 

unsigned storage::Disk::maxPrimary  )  const [inline]
 

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

const std::list<string>& storage::Disk::mpAlias  )  const [inline]
 

bool Disk::needP const string &  dev  )  [static]
 

int Disk::nextFreePartition storage::PartitionType  type,
unsigned &  nr,
string &  device
 

static bool storage::Disk::notDeleted const Partition d  )  [inline, static, protected]
 

unsigned long storage::Disk::numMinor  )  const [inline]
 

unsigned Disk::numPartitions  )  const
 

Disk & Disk::operator= const Disk rhs  ) 
 

ConstPartIter storage::Disk::partBegin bool(*)(const Partition &)  CheckPart = NULL  )  const [inline, protected]
 

PartIter storage::Disk::partBegin bool(*)(const Partition &)  CheckPart = NULL  )  [inline, protected]
 

ConstPartIter storage::Disk::partEnd bool(*)(const Partition &)  CheckPart = NULL  )  const [inline, protected]
 

PartIter storage::Disk::partEnd bool(*)(const Partition &)  CheckPart = NULL  )  [inline, protected]
 

ConstPartPair storage::Disk::partPair bool(*)(const Partition &)  CheckPart = NULL  )  const [inline, protected]
 

PartPair storage::Disk::partPair bool(*)(const Partition &)  CheckPart = NULL  )  [inline, protected]
 

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

Reimplemented from storage::Container.

Reimplemented in storage::Dasd.

void Disk::redetectGeometry  )  [protected, virtual]
 

Reimplemented in storage::Dasd.

void Disk::removeFromMemory  )  [protected]
 

int Disk::removePartition unsigned  nr  )  [virtual]
 

Reimplemented in storage::Dasd.

void Disk::removePresentPartitions  )  [protected]
 

int Disk::removeVolume Volume v  )  [virtual]
 

Reimplemented from storage::Container.

void storage::Disk::resetInitDisk  )  [inline]
 

int Disk::resizePartition Partition p,
unsigned long  newCyl
[virtual]
 

Reimplemented in storage::Dasd.

int Disk::resizeVolume Volume v,
unsigned long long  newSize
[virtual]
 

Reimplemented from storage::Container.

bool Disk::scanPartedLine const string &  Line,
unsigned &  nr,
unsigned long &  start,
unsigned long &  csize,
storage::PartitionType type,
unsigned &  id,
bool &  boot
[protected]
 

unsigned storage::Disk::sectors  )  const [inline]
 

string Disk::setDiskLabelText bool  doing = true  )  const
 

void Disk::setLabelData const string &   )  [protected]
 

void Disk::setUdevData const string &  path,
const string &  id
 

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

static storage::CType const storage::Disk::staticType  )  [inline, static]
 

Reimplemented from storage::Container.

const string& storage::Disk::sysfsDir  )  const [inline]
 

const std::list<string>& storage::Disk::udevId  )  const [inline]
 

const string& storage::Disk::udevPath  )  const [inline]
 


Friends And Related Function Documentation

friend class Dasd [friend]
 

std::ostream& operator<< std::ostream &  s,
const Disk d
[friend]
 

friend class Storage [friend]
 

Reimplemented from storage::Container.

Reimplemented in storage::Dasd.


Member Data Documentation

unsigned long storage::Disk::byte_cyl [protected]
 

unsigned long storage::Disk::cyl [protected]
 

string storage::Disk::detected_label [protected]
 

bool storage::Disk::ext_possible [protected]
 

unsigned storage::Disk::head [protected]
 

storage::DiskInfo storage::Disk::info [mutable, protected]
 

Reimplemented from storage::Container.

bool storage::Disk::init_disk [protected]
 

string storage::Disk::label [protected]
 

Disk::label_info Disk::labels [static, protected]
 

Initial value:

 {
        { "msdos", true, 4, 63 },
        { "gpt", false, 63, 0 },
        { "bsd", false, 8, 0 },
        { "sun", false, 8, 0 },
        { "mac", false, 64, 0 },
        { "dasd", false, 3, 0 },
        { "aix", false, 0, 0 },
        { "", false, 0, 0 }
    }

string storage::Disk::logfile_name [protected]
 

unsigned storage::Disk::max_logical [protected]
 

unsigned storage::Disk::max_primary [protected]
 

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

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

std::list<string> storage::Disk::mp_alias [protected]
 

unsigned long storage::Disk::new_cyl [protected]
 

unsigned storage::Disk::new_head [protected]
 

unsigned storage::Disk::new_sector [protected]
 

string Disk::p_disks = { "cciss/", "ida/", "ataraid/", "etherd/", "rd/" } [static, protected]
 

unsigned long storage::Disk::range [protected]
 

unsigned storage::Disk::sector [protected]
 

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

string storage::Disk::sysfs_dir [protected]
 

string storage::Disk::system_stderr [protected]
 

std::list<string> storage::Disk::udev_id [protected]
 

string storage::Disk::udev_path [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