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

Disk Class Reference

#include <Disk.h>

Inheritance diagram for Disk:

Container List of all members.

Public Member Functions

 Disk (Storage *const s, const string &Name, unsigned long long Size)
 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
unsigned numPartitions () const
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)
int removePartition (unsigned nr)
int changePartitionId (unsigned nr, unsigned id)
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)
void getCommitActions (std::list< storage::commitAction * > &l) const
int getToCommit (storage::CommitStage stage, std::list< Container * > &col, std::list< Volume * > &vol)
int commitChanges (storage::CommitStage stage)
int commitChanges (storage::CommitStage stage, Volume *vol)
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

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
bool detectGeometry ()
bool detectPartitions ()
bool getSysfsInfo (const string &SysFsDir)
int checkSystemError (const string &cmd_line, const SystemCmd &cmd)
int execCheckFailed (const string &cmd_line)
bool checkPartedOutput (const SystemCmd &cmd)
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 std::list< string > &ps, const std::list< Partition * > &pl)
bool getPartedValues (Partition *p)
virtual void print (std::ostream &s) const
virtual ContainergetCopy () const
void getGeometry (const string &line, unsigned long &c, unsigned &h, unsigned &s)
void redetectGeometry ()
int doCreate (Volume *v)
int doRemove (Volume *v)
int doResize (Volume *v)
int doSetType (Volume *v)
int doCreateLabel ()
void logData (const string &Dir)
bool haveBsdPart (const std::list< Partition * > &pl) const
void setLabelData (const string &)
Diskoperator= (const Disk &rhs)

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 detected_label
string system_stderr
unsigned max_primary
bool ext_possible
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
std::ostream & operator<< (std::ostream &, const Disk &)

Classes

struct  label_info
struct  PartitionCPI
struct  PartitionPI

Member Typedef Documentation

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

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

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

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

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

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

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

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

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


Constructor & Destructor Documentation

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

Disk::Disk const Disk rhs  ) 
 

Disk::~Disk  )  [virtual]
 

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


Member Function Documentation

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

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

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

int Disk::changePartitionId unsigned  nr,
unsigned  id
 

bool Disk::checkPartedOutput const SystemCmd cmd  )  [protected]
 

bool Disk::checkPartedValid const ProcPart pp,
const std::list< string > &  ps,
const std::list< Partition * > &  pl
[protected]
 

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

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

Reimplemented from Container.

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

Reimplemented from Container.

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

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

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

unsigned long Disk::cylinders  )  const [inline]
 

unsigned long long Disk::cylinderToKb unsigned  long  )  const
 

unsigned long Disk::cylSizeB  )  const [inline]
 

string Disk::defaultLabel  )  [static, protected]
 

int Disk::destroyPartitionTable const string &  new_label  ) 
 

bool Disk::detectGeometry  )  [protected]
 

bool Disk::detectPartitions  )  [protected]
 

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

Reimplemented from Container.

int Disk::doCreateLabel  )  [protected]
 

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

Reimplemented from Container.

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

Reimplemented from Container.

int Disk::doSetType Volume v  )  [protected]
 

bool Disk::equalContent const Disk rhs  )  const
 

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

int Disk::forgetChangePartitionId unsigned  nr  ) 
 

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

Reimplemented from Container.

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

Reimplemented from 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::getPartedValues 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]
 

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

Reimplemented from Container.

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

bool Disk::hasExtended  )  const
 

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

unsigned Disk::heads  )  const [inline]
 

unsigned long Disk::kbToCylinder unsigned long  long  )  const
 

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

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

Reimplemented from Container.

void Disk::logDifference const Disk d  )  const
 

unsigned long Disk::majorNr  )  const [inline]
 

unsigned Disk::maxLogical  )  const [inline]
 

unsigned Disk::maxPrimary  )  const [inline]
 

unsigned long Disk::minorNr  )  const [inline]
 

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

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

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

unsigned long Disk::numMinor  )  const [inline]
 

unsigned Disk::numPartitions  )  const
 

Disk & Disk::operator= const Disk rhs  )  [protected]
 

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

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

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

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

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

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

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

Reimplemented from Container.

void Disk::redetectGeometry  )  [protected]
 

int Disk::removePartition unsigned  nr  ) 
 

int Disk::removeVolume Volume v  )  [virtual]
 

Reimplemented from Container.

int Disk::resizePartition Partition p,
unsigned long  newCyl
 

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

Reimplemented from Container.

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

unsigned Disk::sectors  )  const [inline]
 

string Disk::setDiskLabelText bool  doing = true  )  const
 

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

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

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

Reimplemented from Container.


Friends And Related Function Documentation

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

friend class Storage [friend]
 

Reimplemented from Container.


Member Data Documentation

unsigned long Disk::byte_cyl [protected]
 

unsigned long Disk::cyl [protected]
 

string Disk::detected_label [protected]
 

bool Disk::ext_possible [protected]
 

unsigned Disk::head [protected]
 

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

Reimplemented from Container.

string 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 },
        { "aix", false, 0, 0 },
        { "", false, 0, 0 }
    }

unsigned Disk::max_logical [protected]
 

unsigned Disk::max_primary [protected]
 

unsigned long Disk::mjr [protected]
 

unsigned long Disk::mnr [protected]
 

unsigned long Disk::new_cyl [protected]
 

unsigned Disk::new_head [protected]
 

unsigned Disk::new_sector [protected]
 

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

unsigned long Disk::range [protected]
 

unsigned Disk::sector [protected]
 

unsigned long long Disk::size_k [protected]
 

string Disk::system_stderr [protected]
 


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