#include <Disk.h>

Public Types | |
| typedef DerefIterator < PartCPIterator, const Partition > | ConstPartIter |
| typedef IterPair< ConstPartIter > | ConstPartPair |
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 | 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 | setSlave (bool val=true) |
| void | setNumMinor (unsigned long val) |
| 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 |
| bool | detect (ProcPart &ppart) |
| void | triggerUdevUpdate () |
| 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 Container &rhs) const |
| void | logDifference (const Container &d) const |
| Disk & | operator= (const Disk &rhs) |
| bool | FakeDisk () const |
| ConstPartPair | partPair (bool(*CheckPart)(const Partition &)=NULL) const |
| ConstPartIter | partBegin (bool(*CheckPart)(const Partition &)=NULL) const |
| ConstPartIter | partEnd (bool(*CheckPart)(const Partition &)=NULL) const |
Static Public Member Functions | |
| static storage::CType | 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, unsigned > | getDiskPartition (const string &dev) |
| static unsigned long long | maxSizeLabelK (const string &label) |
Protected Types | |
| typedef CastIterator< VIter, Partition * > | PartInter |
| typedef CastIterator< CVIter, const Partition * > | PartCInter |
| typedef CheckFnc< const Partition > | CheckFncPartition |
| 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 IterPair< PartIter > | PartPair |
Protected Member Functions | |
| PartPair | partPair (bool(*CheckPart)(const Partition &)=NULL) |
| PartIter | partBegin (bool(*CheckPart)(const Partition &)=NULL) |
| PartIter | partEnd (bool(*CheckPart)(const Partition &)=NULL) |
| Disk (Storage *const s, const string &File) | |
| 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 Partition * | getPartitionAfter (const Partition *p) |
| virtual void | print (std::ostream &s) const |
| virtual Container * | getCopy () 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 () |
| void | enlargeGpt () |
| 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 bool | bootSpecial (const Partition &d) |
| static string | defaultLabel (unsigned long long size_k) |
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 |
| bool | iscsi |
| bool | dmp_slave |
| bool | gpt_enlarge |
| unsigned | max_logical |
| unsigned long | byte_cyl |
| 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 | DmPartCo |
| std::ostream & | operator<< (std::ostream &, const Disk &) |
Classes | |
| struct | label_info |
| struct | PartitionCPI |
| struct | PartitionPI |
typedef CastIterator<VIter, Partition *> storage::Disk::PartInter [protected] |
typedef CastIterator<CVIter, const Partition *> storage::Disk::PartCInter [protected] |
typedef CheckFnc<const Partition> storage::Disk::CheckFncPartition [protected] |
typedef CheckerIterator< CheckFncPartition, PartitionPI<CheckFncPartition>::type, PartInter, Partition > storage::Disk::PartPIterator [protected] |
typedef CheckerIterator< CheckFncPartition, PartitionCPI<CheckFncPartition>::type, PartCInter, const Partition > storage::Disk::PartCPIterator [protected] |
typedef DerefIterator<PartPIterator,Partition> storage::Disk::PartIter [protected] |
typedef IterPair<PartIter> storage::Disk::PartPair [protected] |
| typedef DerefIterator<PartCPIterator,const Partition> storage::Disk::ConstPartIter |
| Disk::Disk | ( | Storage *const | s, | |
| const string & | Name, | |||
| unsigned long long | Size | |||
| ) |
References storage::Container::dev, dmp_slave, gpt_enlarge, init_disk, iscsi, logfile_name, storage::Container::nm, storage::Container::size_k, storage::undevDevice(), and y2debug.
Referenced by getCopy().
| Disk::Disk | ( | Storage *const | s, | |
| const string & | Name, | |||
| unsigned | num, | |||
| unsigned long long | Size, | |||
| ProcPart & | ppart | |||
| ) |
References storage::Container::addToList(), byte_cyl, cyl, storage::decString(), storage::Volume::device(), dmp_slave, storage::ProcPart::getSize(), gpt_enlarge, head, init_disk, iscsi, logfile_name, new_cyl, new_head, new_sector, storage::PRIMARY, storage::Container::ronly, sector, storage::Volume::setSize(), storage::Container::size_k, and y2milestone.
| Disk::Disk | ( | const Disk & | rhs | ) |
| Disk::~Disk | ( | ) | [virtual] |
References storage::Container::dev, and y2debug.
| Disk::Disk | ( | Storage *const | s, | |
| const string & | File | |||
| ) | [protected] |
References storage::Container::addToList(), byte_cyl, cyl, storage::Container::dev, dmp_slave, ext_possible, storage::extractNthWord(), FakeDisk(), gpt_enlarge, head, init_disk, iscsi, label, max_logical, max_primary, storage::Container::mjr, storage::Container::mnr, storage::Container::nm, range, storage::Container::ronly, storage::searchFile(), sector, storage::Container::size_k, udev_id, udev_path, and y2debug.
| unsigned long storage::Disk::cylinders | ( | ) | const [inline] |
References cyl.
Referenced by changePartitionArea(), createChecks(), doCreate(), storage::Dasd::doFdasd(), getInfo(), resizePartition(), storage::Dasd::scanFdasdLine(), and scanPartedLine().
| unsigned long storage::Disk::numMinor | ( | ) | const [inline] |
References range.
| unsigned long storage::Disk::cylSizeB | ( | ) | const [inline] |
| unsigned storage::Disk::maxPrimary | ( | ) | const [inline] |
| unsigned storage::Disk::maxLogical | ( | ) | const [inline] |
| const string& storage::Disk::labelName | ( | ) | const [inline] |
| const string& storage::Disk::udevPath | ( | ) | const [inline] |
| const std::list<string>& storage::Disk::udevId | ( | ) | const [inline] |
| void storage::Disk::setSlave | ( | bool | val = true |
) | [inline] |
| void storage::Disk::setNumMinor | ( | unsigned long | val | ) | [inline] |
| void Disk::addMpAlias | ( | const string & | dev | ) |
References storage::Container::device(), mp_alias, and y2mil.
| void storage::Disk::clearMpAlias | ( | ) | [inline] |
References mp_alias.
| const std::list<string>& storage::Disk::mpAlias | ( | ) | const [inline] |
References mp_alias.
| const string& storage::Disk::sysfsDir | ( | ) | const [inline] |
| unsigned Disk::numPartitions | ( | ) | const |
References notDeleted(), and partPair().
Referenced by storage::DmPartCo::init(), and storage::DmPartCo::numPartitions().
| bool storage::Disk::isDasd | ( | ) | const [inline] |
| bool Disk::isLogical | ( | unsigned | nr | ) | const |
References ext_possible, max_primary, and y2milestone.
| bool Disk::detect | ( | ProcPart & | ppart | ) |
| static storage::CType storage::Disk::staticType | ( | ) | [inline, static] |
| void Disk::triggerUdevUpdate | ( | ) |
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::end(), and partPair().
| bool Disk::needP | ( | const string & | dev | ) | [static] |
References storage::lengthof(), and p_disks.
Referenced by storage::Storage::getContVolInfo(), getPartName(), and storage::Volume::setNameDev().
| void Disk::setUdevData | ( | const string & | path, | |
| const string & | id | |||
| ) |
| virtual int storage::Disk::createPartition | ( | storage::PartitionType | type, | |
| long unsigned | start, | |||
| long unsigned | len, | |||
| string & | device, | |||
| bool | checkRelaxed = false | |||
| ) | [virtual] |
Reimplemented in storage::Dasd.
Referenced by storage::DmPartCo::createPartition(), and createPartition().
| int storage::Disk::createPartition | ( | long unsigned | len, | |
| string & | device, | |||
| bool | checkRelaxed = false | |||
| ) |
| int Disk::createPartition | ( | storage::PartitionType | type, | |
| string & | device | |||
| ) |
References availablePartNumber(), storage::IterPair< Iter >::begin(), createPartition(), storage::DISK_CREATE_PARTITION_NO_SPACE, storage::DISK_PARTITION_NO_FREE_NUMBER, storage::IterPair< Iter >::empty(), storage::EXTENDED, getUnusedSpace(), isExtended(), storage::LOGICAL, partPair(), storage::PRIMARY, storage::PTYPE_ANY, regions_sort_size(), and y2milestone.
| int Disk::removePartition | ( | unsigned | nr | ) | [virtual] |
Reimplemented in storage::Dasd.
References storage::IterPair< Iter >::begin(), changeNumbers(), storage::DISK_CHANGE_READONLY, storage::DISK_PARTITION_NOT_FOUND, storage::DISK_REMOVE_PARTITION_CREATE_NOT_FOUND, storage::DISK_REMOVE_USED_BY, storage::IterPair< Iter >::end(), storage::EXTENDED, storage::Container::getStorage(), storage::Storage::logCo(), max_primary, notDeleted(), partPair(), storage::Container::readonly(), storage::Container::removeFromList(), storage::UB_NONE, volume_ptr_sort_nr(), and y2milestone.
Referenced by storage::Storage::removePartition(), storage::DmPartCo::removePartition(), storage::Dasd::removePartition(), storage::DmPartCo::removeVolume(), and removeVolume().
| int Disk::changePartitionId | ( | unsigned | nr, | |
| unsigned | id | |||
| ) | [virtual] |
Reimplemented in storage::Dasd.
References storage::IterPair< Iter >::begin(), storage::DISK_CHANGE_READONLY, storage::DISK_PARTITION_NOT_FOUND, storage::IterPair< Iter >::end(), notDeleted(), partPair(), storage::Container::readonly(), and y2milestone.
Referenced by storage::Storage::changePartitionId(), and storage::DmPartCo::changePartitionId().
| virtual int storage::Disk::initializeDisk | ( | bool | ) | [inline, virtual] |
Reimplemented in storage::Dasd.
References storage::DISK_INIT_NOT_POSSIBLE.
Referenced by needDasdfmt().
| bool storage::Disk::initializeDisk | ( | ) | const [inline] |
References init_disk.
| void storage::Disk::resetInitDisk | ( | ) | [inline] |
| int Disk::forgetChangePartitionId | ( | unsigned | nr | ) |
References storage::IterPair< Iter >::begin(), storage::DISK_CHANGE_READONLY, storage::DISK_PARTITION_NOT_FOUND, storage::IterPair< Iter >::end(), notDeleted(), partPair(), storage::Container::readonly(), and y2milestone.
Referenced by storage::Storage::forgetChangePartitionId(), and storage::DmPartCo::forgetChangePartitionId().
| int Disk::changePartitionArea | ( | unsigned | nr, | |
| unsigned long | start, | |||
| unsigned long | size, | |||
| bool | checkRelaxed = false | |||
| ) |
References storage::IterPair< Iter >::begin(), cylinders(), cylinderToKb(), storage::DISK_CHANGE_READONLY, storage::DISK_PARTITION_EXCEEDS_DISK, storage::DISK_PARTITION_LOGICAL_OUTSIDE_EXT, storage::DISK_PARTITION_NOT_FOUND, storage::DISK_PARTITION_OVERLAPS_EXISTING, storage::DISK_PARTITION_ZERO_SIZE, storage::Region::end(), storage::IterPair< Iter >::end(), isExtended(), storage::LOGICAL, max_primary, notDeleted(), notDeletedLog(), partPair(), storage::Container::readonly(), y2milestone, and y2war.
Referenced by storage::DmPartCo::changePartitionArea(), and storage::Storage::updatePartitionArea().
| int Disk::nextFreePartition | ( | storage::PartitionType | type, | |
| unsigned & | nr, | |||
| string & | device | |||
| ) |
References availablePartNumber(), storage::Volume::device(), storage::DISK_PARTITION_NO_FREE_NUMBER, storage::Volume::nr(), and y2milestone.
Referenced by storage::DmPartCo::nextFreePartition().
| int Disk::destroyPartitionTable | ( | const string & | new_label | ) |
References storage::Container::device(), storage::DISK_DESTROY_TABLE_INVALID_LABEL, dmp_slave, storage::Storage::getRecursiveRemoval(), storage::Container::getStorage(), storage::Container::getUsedBy(), storage::Container::getUsedByType(), label, max_primary, storage::Storage::removeUsing(), storage::Storage::removeVolume(), storage::Container::ronly, storage::Container::setDeleted(), setLabelData(), storage::Storage::setRecursiveRemoval(), storage::UB_NONE, storage::Container::vols, and y2milestone.
Referenced by storage::DmPartCo::destroyPartitionTable(), and storage::Dasd::initializeDisk().
| unsigned Disk::availablePartNumber | ( | storage::PartitionType | type = storage::PRIMARY |
) |
References storage::IterPair< Iter >::begin(), storage::IterPair< Iter >::empty(), storage::IterPair< Iter >::end(), ext_possible, storage::EXTENDED, hasExtended(), label, storage::LOGICAL, max_logical, max_primary, storage::Container::name(), notDeleted(), partPair(), range, y2mil, and y2milestone.
Referenced by createPartition(), and nextFreePartition().
| virtual void storage::Disk::getCommitActions | ( | std::list< storage::commitAction * > & | l | ) | const [virtual] |
| virtual int storage::Disk::getToCommit | ( | storage::CommitStage | stage, | |
| std::list< Container * > & | col, | |||
| std::list< Volume * > & | vol | |||
| ) | [virtual] |
| int Disk::commitChanges | ( | storage::CommitStage | stage | ) | [virtual] |
Reimplemented from storage::Container.
Reimplemented in storage::Dasd.
References storage::DECREASE, storage::Container::deleted(), storage::DISK_COMMIT_NOTHING_TODO, doCreateLabel(), storage::Container::name(), and y2milestone.
Referenced by storage::Dasd::commitChanges().
| int Disk::commitChanges | ( | storage::CommitStage | stage, | |
| Volume * | vol | |||
| ) | [virtual] |
Reimplemented from storage::Container.
References storage::Container::commitChanges(), storage::DISK_SET_TYPE_INVALID_VOLUME, doSetType(), storage::INCREASE, storage::Container::name(), storage::Partition::toChangeId(), and y2milestone.
| int Disk::resizePartition | ( | Partition * | p, | |
| unsigned long | newCyl | |||
| ) | [virtual] |
Reimplemented in storage::Dasd.
References storage::IterPair< Iter >::begin(), storage::Volume::canResize(), storage::Partition::changeRegion(), storage::Volume::created(), storage::Partition::cylEnd(), cylinders(), cylinderToKb(), storage::Partition::cylSize(), storage::Partition::cylStart(), storage::DISK_CHANGE_READONLY, storage::DISK_RESIZE_NO_SPACE, storage::IterPair< Iter >::empty(), storage::IterPair< Iter >::end(), storage::Container::end(), storage::EXTENDED, isExtended(), storage::LOGICAL, notDeleted(), partPair(), storage::PRIMARY, storage::Container::readonly(), storage::Partition::setResizedSize(), storage::Partition::type(), y2mil, and y2milestone.
Referenced by storage::Storage::resizePartition(), storage::DmPartCo::resizePartition(), and resizeVolume().
| int Disk::resizeVolume | ( | Volume * | v, | |
| unsigned long long | newSize | |||
| ) | [virtual] |
Reimplemented from storage::Container.
References cylinderToKb(), storage::DISK_CHANGE_READONLY, storage::DISK_CHECK_RESIZE_INVALID_VOLUME, kbToCylinder(), storage::Container::readonly(), resizePartition(), and y2milestone.
Referenced by storage::DmPartCo::resizeVolume().
| int Disk::removeVolume | ( | Volume * | v | ) | [virtual] |
| void storage::Disk::getUnusedSpace | ( | std::list< Region > & | free, | |
| bool | all = true, |
|||
| bool | logical = false | |||
| ) |
Referenced by createPartition().
| bool Disk::hasExtended | ( | ) | const |
| string Disk::setDiskLabelText | ( | bool | doing = true |
) | const |
References storage::_(), storage::Container::dev, label, and storage::sformat().
Referenced by doCreateLabel().
| unsigned long long Disk::cylinderToKb | ( | unsigned long | cylinder | ) | const |
| unsigned long Disk::kbToCylinder | ( | unsigned long long | kb | ) | const |
References byte_cyl, and y2milestone.
Referenced by storage::DmPartCo::kbToCylinder(), and resizeVolume().
| string Disk::getPartName | ( | unsigned | nr | ) | const |
References storage::Container::dev.
Referenced by doRemove(), storage::Storage::getContVolInfo(), and storage::Partition::removeText().
| void Disk::getInfo | ( | storage::DiskInfo & | info | ) | const |
References storage::DiskInfo::cyl, cylinders(), cylSizeB(), storage::DiskInfo::cylSizeB, storage::DiskInfo::disklabel, heads(), storage::DiskInfo::heads, info, init_disk, storage::DiskInfo::initDisk, iscsi, storage::DiskInfo::iscsi, labelName(), maxLogical(), storage::DiskInfo::maxLogical, maxPrimary(), storage::DiskInfo::maxPrimary, storage::mergeString(), sectors(), storage::DiskInfo::sectors, storage::Container::sizeK(), storage::DiskInfo::sizeK, udev_id, udev_path, storage::DiskInfo::udevId, and storage::DiskInfo::udevPath.
Referenced by storage::DmPartCo::getInfo().
| bool Disk::equalContent | ( | const Container & | rhs | ) | const [virtual] |
Reimplemented from storage::Container.
References storage::IterPair< Iter >::begin(), cyl, dmp_slave, storage::IterPair< Iter >::end(), storage::Container::equalContent(), ext_possible, gpt_enlarge, head, init_disk, iscsi, label, max_logical, max_primary, storage::Container::mjr, storage::Container::mnr, partPair(), range, sector, storage::Container::size_k, and sysfs_dir.
| void Disk::logDifference | ( | const Container & | d | ) | const [virtual] |
Reimplemented from storage::Container.
References storage::IterPair< Iter >::begin(), cyl, storage::decString(), storage::IterPair< Iter >::end(), ext_possible, storage::Container::getDiffString(), head, init_disk, iscsi, label, max_logical, max_primary, storage::Container::mjr, storage::Container::mnr, partPair(), range, sector, storage::Container::size_k, sysfs_dir, y2mil, and y2milestone.
References byte_cyl, cyl, detected_label, dmp_slave, ext_possible, gpt_enlarge, head, init_disk, iscsi, label, logfile_name, max_logical, max_primary, mp_alias, new_cyl, new_head, new_sector, storage::Container::nm, range, sector, sysfs_dir, udev_id, udev_path, and y2debug.
| string Disk::getPartName | ( | const string & | disk, | |
| unsigned | nr | |||
| ) | [static] |
References storage::decString(), and needP().
| string Disk::getPartName | ( | const string & | disk, | |
| const string & | nr | |||
| ) | [static] |
| pair< string, unsigned > Disk::getDiskPartition | ( | const string & | dev | ) | [static] |
References storage::Regex::match(), and y2mil.
Referenced by storage::Storage::getContVolInfo(), and storage::Storage::getMountBy().
| unsigned long long Disk::maxSizeLabelK | ( | const string & | label | ) | [static] |
References labels, storage::Disk::label_info::max_size_k, storage::Disk::label_info::name, storage::Container::name(), and y2milestone.
Referenced by storage::Storage::maxSizeLabelK().
| PartPair storage::Disk::partPair | ( | bool(*)(const Partition &) | CheckPart = NULL |
) | [inline, protected] |
References partBegin(), and partEnd().
Referenced by availablePartNumber(), changePartitionArea(), changePartitionId(), createChecks(), createPartition(), Disk(), doCreate(), storage::Dasd::doFdasd(), doRemove(), doResize(), equalContent(), storage::Storage::evmsActivateDevices(), forgetChangePartitionId(), storage::DmPartCo::getPartition(), getPartitionAfter(), storage::DmPartCo::getVolumes(), storage::DmPartCo::handleWholeDevice(), hasExtended(), storage::Dasd::initializeDisk(), logData(), logDifference(), numPartitions(), removePartition(), storage::Dasd::removePartition(), resizePartition(), setUdevData(), triggerUdevUpdate(), and storage::DmPartCo::validPartition().
| ConstPartPair storage::Disk::partPair | ( | bool(*)(const Partition &) | CheckPart = NULL |
) | const [inline] |
References partBegin(), and partEnd().
| ConstPartIter storage::Disk::partBegin | ( | bool(*)(const Partition &) | CheckPart = NULL |
) | const [inline] |
References storage::Container::begin(), and storage::Container::end().
| ConstPartIter storage::Disk::partEnd | ( | bool(*)(const Partition &) | CheckPart = NULL |
) | const [inline] |
References storage::Container::begin(), and storage::Container::end().
| bool Disk::detectGeometry | ( | ) | [protected, virtual] |
Reimplemented in storage::Dasd.
References byte_cyl, cyl, storage::Container::device(), head, sector, and y2milestone.
Referenced by detect(), and storage::Dasd::detectGeometry().
| bool Disk::detectPartitions | ( | ProcPart & | ppart | ) | [protected, virtual] |
Reimplemented in storage::Dasd.
References storage::_(), byte_cyl, checkPartedOutput(), checkSystemError(), cyl, defaultLabel(), detected_label, storage::Container::dev, storage::Container::device(), storage::extractNthWord(), getGeometry(), gpt_enlarge, head, label, new_cyl, new_head, new_sector, PARTEDCMD, storage::Container::ronly, sector, setLabelData(), storage::sformat(), storage::Container::size_k, system_stderr, storage::Container::vols, y2milestone, and y2war.
Referenced by detect().
| bool Disk::getSysfsInfo | ( | const string & | SysFsDir | ) | [protected] |
References iscsi, storage::Container::mjr, storage::Container::mnr, range, sysfs_dir, y2mil, and y2milestone.
| int Disk::checkSystemError | ( | const string & | cmd_line, | |
| const SystemCmd & | cmd | |||
| ) | [protected] |
| int Disk::execCheckFailed | ( | const string & | cmd_line | ) | [protected] |
Referenced by doCreate(), doCreateLabel(), storage::Dasd::doDasdfmt(), storage::Dasd::doFdasd(), doRemove(), doResize(), and doSetType().
| int Disk::execCheckFailed | ( | SystemCmd & | cmd, | |
| const string & | cmd_line | |||
| ) | [protected] |
References storage::_(), storage::Storage::addInfoPopupText(), storage::Container::addToList(), checkPartedValid(), cylinderToKb(), storage::Container::dev, storage::Volume::device(), dmp_slave, storage::EXTENDED, storage::extractNthWord(), storage::SystemCmd::getLine(), storage::ProcPart::getSize(), storage::Container::getStorage(), storage::Container::nm, storage::SystemCmd::numLines(), range, storage::Container::ronly, scanPartedLine(), storage::Volume::setSize(), storage::sformat(), storage::Partition::type(), storage::Container::type(), and y2mil.
Referenced by detectPartitions().
| bool Disk::scanPartedLine | ( | const string & | Line, | |
| unsigned & | nr, | |||
| unsigned long & | start, | |||
| unsigned long & | csize, | |||
| storage::PartitionType & | type, | |||
| unsigned & | id, | |||
| bool & | boot | |||
| ) | [protected] |
References cylinders(), ext_possible, storage::EXTENDED, storage::Partition::ID_APPLE_HFS, storage::Partition::ID_APPLE_OTHER, storage::Partition::ID_APPLE_UFS, storage::Partition::ID_DOS, storage::Partition::ID_EXTENDED, storage::Partition::ID_GPT_BOOT, storage::Partition::ID_GPT_MSFTRES, storage::Partition::ID_GPT_SERVICE, storage::Partition::ID_LINUX, storage::Partition::ID_LVM, storage::Partition::ID_NTFS, storage::Partition::ID_RAID, storage::Partition::ID_SWAP, label, storage::LOGICAL, storage::PRIMARY, storage::tolower(), y2debug, y2mil, and y2milestone.
Referenced by checkPartedOutput(), and getPartedValues().
| bool storage::Disk::checkPartedValid | ( | const ProcPart & | pp, | |
| const string & | diskname, | |||
| std::list< Partition * > & | pl, | |||
| unsigned long & | rng | |||
| ) | [protected] |
Referenced by storage::Dasd::checkFdasdOutput(), and checkPartedOutput().
| bool Disk::getPartedValues | ( | Partition * | p | ) | [protected] |
References storage::Partition::changeRegion(), cylinderToKb(), storage::Volume::device(), storage::Container::device(), dmp_slave, storage::EXTENDED, storage::ProcPart::getSize(), storage::Container::getStorage(), storage::Volume::nr(), PARTEDCMD, scanPartedLine(), storage::Volume::setSize(), storage::Volume::sizeK(), storage::Partition::type(), y2error, and y2milestone.
Referenced by doCreate(), and doResize().
| bool Disk::getPartedSectors | ( | const Partition * | p, | |
| unsigned long long & | start, | |||
| unsigned long long & | end | |||
| ) | [protected] |
References storage::Partition::cylEnd(), storage::Partition::cylStart(), storage::Container::device(), storage::Container::getStorage(), new_head, new_sector, storage::Volume::nr(), PARTEDCMD, and y2milestone.
Referenced by doResize().
| virtual void storage::Disk::print | ( | std::ostream & | s | ) | const [inline, protected, virtual] |
| virtual Container* storage::Disk::getCopy | ( | ) | const [inline, protected, virtual] |
| void Disk::getGeometry | ( | const string & | line, | |
| unsigned long & | c, | |||
| unsigned & | h, | |||
| unsigned & | s | |||
| ) | [protected] |
References storage::extractNthWord(), storage::Container::sizeK(), storage::splitString(), y2mil, and y2milestone.
Referenced by detectPartitions(), and redetectGeometry().
| void Disk::redetectGeometry | ( | ) | [protected, virtual] |
Reimplemented in storage::Dasd.
References storage::Container::device(), getGeometry(), new_cyl, new_head, new_sector, PARTEDCMD, and y2milestone.
Referenced by doCreateLabel(), and doRemove().
| int Disk::createChecks | ( | storage::PartitionType & | type, | |
| unsigned long | start, | |||
| unsigned long | len, | |||
| bool | checkRelaxed | |||
| ) | [protected] |
References storage::IterPair< Iter >::begin(), cylinders(), storage::DISK_CHANGE_READONLY, storage::DISK_CREATE_PARTITION_EXT_IMPOSSIBLE, storage::DISK_CREATE_PARTITION_EXT_ONLY_ONCE, storage::DISK_CREATE_PARTITION_LOGICAL_NO_EXT, storage::DISK_PARTITION_EXCEEDS_DISK, storage::DISK_PARTITION_LOGICAL_OUTSIDE_EXT, storage::DISK_PARTITION_OVERLAPS_EXISTING, storage::DISK_PARTITION_ZERO_SIZE, storage::IterPair< Iter >::empty(), storage::IterPair< Iter >::end(), storage::Region::end(), ext_possible, storage::EXTENDED, isExtended(), storage::LOGICAL, notDeleted(), notDeletedLog(), partPair(), storage::PRIMARY, storage::PTYPE_ANY, storage::Container::readonly(), y2milestone, and y2war.
| void Disk::removePresentPartitions | ( | ) | [protected] |
| void Disk::removeFromMemory | ( | ) | [protected] |
References storage::Container::vols, and y2mil.
Referenced by doCreateLabel(), and storage::Dasd::doDasdfmt().
| void Disk::enlargeGpt | ( | ) | [protected] |
References storage::Container::device(), gpt_enlarge, PARTEDBIN, and y2mil.
Referenced by doCreate().
| static bool storage::Disk::notDeleted | ( | const Partition & | d | ) | [inline, static, protected] |
References storage::Volume::deleted().
Referenced by availablePartNumber(), changePartitionArea(), changePartitionId(), createChecks(), storage::Dasd::doFdasd(), forgetChangePartitionId(), getPartitionAfter(), storage::Storage::getPartitionInfo(), numPartitions(), removePartition(), storage::Dasd::removePartition(), and resizePartition().
| static bool storage::Disk::bootSpecial | ( | const Partition & | d | ) | [inline, static, protected] |
References storage::Volume::deleted(), and storage::Partition::id().
Referenced by storage::Storage::evmsActivateDevices().
| int Disk::doCreate | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
Reimplemented in storage::Dasd.
References storage::IterPair< Iter >::begin(), storage::Partition::createText(), cylinders(), storage::Partition::cylSize(), storage::Partition::cylStart(), storage::decString(), detected_label, storage::Volume::device(), storage::Container::device(), storage::DISK_CREATE_PARTITION_INVALID_TYPE, storage::DISK_CREATE_PARTITION_INVALID_VOLUME, storage::DISK_CREATE_PARTITION_PARTED_FAILED, storage::DISK_PARTITION_NOT_FOUND, dmp_slave, doCreateLabel(), doSetType(), storage::IterPair< Iter >::empty(), storage::IterPair< Iter >::end(), storage::Container::end(), enlargeGpt(), execCheckFailed(), storage::SystemCmd::execute(), existingLog(), existingNotLog(), storage::EXTENDED, storage::Volume::getFormat(), getPartedValues(), storage::Container::getStorage(), storage::Volume::getUsedByType(), gpt_enlarge, head, storage::Partition::id(), storage::Partition::ID_APPLE_HFS, storage::Partition::ID_DOS, storage::Partition::ID_DOS16, storage::Partition::ID_GPT_BOOT, storage::Partition::ID_LINUX, storage::Partition::ID_SWAP, storage::Storage::instsys(), isExtended(), label, storage::IterPair< Iter >::length(), storage::LOGICAL, logicalCreated(), storage::Volume::name(), storage::Container::name(), new_cyl, new_head, new_sector, storage::Volume::nr(), PARTEDCMD, partPair(), storage::PRIMARY, sector, storage::Volume::setCreated(), storage::Storage::showInfoCb(), storage::Container::silent, storage::Volume::sizeK(), system_stderr, storage::Partition::type(), storage::UB_EVMS, storage::UB_LVM, storage::Volume::updateFsData(), storage::Storage::waitForDevice(), y2mil, and y2milestone.
Referenced by storage::DmPartCo::doCreate().
| int Disk::doRemove | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
Reimplemented in storage::Dasd.
References storage::Volume::created(), storage::Container::device(), storage::DISK_REMOVE_PARTITION_INVALID_VOLUME, storage::DISK_REMOVE_PARTITION_LIST_ERASE, storage::DISK_REMOVE_PARTITION_PARTED_FAILED, dmp_slave, storage::IterPair< Iter >::empty(), execCheckFailed(), getPartName(), storage::Container::getStorage(), storage::Volume::name(), storage::Container::name(), notCreatedPrimary(), storage::Partition::OrigNr(), PARTEDCMD, partPair(), storage::Volume::prepareRemove(), redetectGeometry(), storage::Storage::removeDmMapsTo(), storage::Container::removeFromList(), storage::Partition::removeText(), storage::Storage::showInfoCb(), storage::Container::silent, system_stderr, storage::Storage::waitForDevice(), and y2milestone.
Referenced by storage::DmPartCo::doRemove(), and removePresentPartitions().
| int Disk::doResize | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented from storage::Container.
Reimplemented in storage::Dasd.
References storage::IterPair< Iter >::begin(), byte_cyl, storage::Volume::device(), storage::Container::device(), storage::DISK_PARTITION_NOT_FOUND, storage::DISK_RESIZE_PARTITION_INVALID_VOLUME, storage::DISK_RESIZE_PARTITION_PARTED_FAILED, dmp_slave, storage::IterPair< Iter >::empty(), execCheckFailed(), storage::FSNONE, storage::Volume::getFs(), getPartedSectors(), getPartedValues(), getPartitionAfter(), storage::Container::getStorage(), storage::HFS, storage::HFSPLUS, isExtended(), storage::Volume::isMounted(), storage::LOGICAL, storage::Volume::mount(), storage::Volume::name(), storage::Container::name(), storage::Volume::needExtend(), storage::Volume::needShrink(), storage::Volume::nr(), PARTEDCMD, partPair(), storage::Volume::resizeFs(), storage::Partition::resizeText(), storage::Storage::showInfoCb(), storage::Container::silent, storage::Container::sizeK(), storage::Volume::sizeK(), system_stderr, storage::Partition::type(), storage::Volume::umount(), storage::VFAT, storage::Storage::waitForDevice(), y2mil, and y2milestone.
Referenced by storage::DmPartCo::doResize().
| int Disk::doSetType | ( | Volume * | v | ) | [protected, virtual] |
Reimplemented in storage::Dasd.
References storage::Container::device(), storage::DISK_SET_TYPE_INVALID_VOLUME, storage::DISK_SET_TYPE_PARTED_FAILED, dmp_slave, execCheckFailed(), storage::Container::getStorage(), storage::Partition::ID_GPT_BOOT, storage::Partition::ID_LVM, storage::Partition::ID_RAID, storage::Partition::ID_SWAP, label, storage::Volume::name(), storage::Container::name(), PARTEDCMD, storage::Storage::showInfoCb(), storage::Container::silent, system_stderr, storage::Storage::waitForDevice(), and y2milestone.
Referenced by commitChanges(), doCreate(), and storage::DmPartCo::doSetType().
| int Disk::doCreateLabel | ( | ) | [protected, virtual] |
Reimplemented in storage::Dasd.
References storage::Container::device(), storage::DISK_SET_LABEL_PARTED_FAILED, dmp_slave, execCheckFailed(), storage::Container::getStorage(), gpt_enlarge, label, PARTEDCMD, redetectGeometry(), storage::Storage::removeDmMapsTo(), removeFromMemory(), removePresentPartitions(), storage::Container::setDeleted(), setDiskLabelText(), storage::Storage::showInfoCb(), storage::Container::silent, system_stderr, storage::Storage::waitForDevice(), and y2milestone.
Referenced by commitChanges(), doCreate(), and storage::DmPartCo::doCreateLabel().
| void Disk::logData | ( | const string & | Dir | ) | [protected, virtual] |
Reimplemented from storage::Container.
References storage::IterPair< Iter >::begin(), cyl, storage::Container::dev, storage::IterPair< Iter >::end(), ext_possible, storage::Container::getStorage(), storage::Storage::handleLogFile(), head, label, logfile_name, max_logical, max_primary, storage::Container::mjr, storage::Container::mnr, mp_alias, partPair(), range, storage::Container::ronly, sector, storage::Container::size_k, udev_id, and udev_path.
| bool storage::Disk::haveBsdPart | ( | const std::list< Partition * > & | pl | ) | const [protected] |
| void Disk::setLabelData | ( | const string & | disklabel | ) | [protected] |
References ext_possible, storage::Disk::label_info::extended, label, labels, max_logical, max_primary, storage::Disk::label_info::name, storage::Container::name(), range, y2error, and y2milestone.
Referenced by destroyPartitionTable(), detectPartitions(), and storage::Dasd::detectPartitions().
| string Disk::defaultLabel | ( | unsigned long long | size_k | ) | [static, protected] |
References storage::Storage::arch(), storage::Storage::isPPCMac(), storage::Storage::isPPCPegasos(), TB, and y2milestone.
Referenced by storage::Storage::defaultDiskLabel(), storage::Storage::defaultDiskLabelSize(), and detectPartitions().
friend class Storage [friend] |
friend class DmPartCo [friend] |
| std::ostream& operator<< | ( | std::ostream & | s, | |
| const Disk & | d | |||
| ) | [friend] |
Disk::label_info Disk::labels [static, protected] |
Initial value:
{
{ "msdos", true, 4, 63, 2*TB },
{ "gpt", false, 128, 0, 16*PB },
{ "bsd", false, 8, 0, 2*TB },
{ "sun", false, 8, 0, 2*TB },
{ "mac", false, 64, 0, 2*TB },
{ "dasd", false, 3, 0, 2*TB },
{ "aix", false, 0, 0, 2*TB },
{ "amiga", false, 63, 0, 2*TB },
{ "", false, 0, 0, 0 }
}
Referenced by maxSizeLabelK(), and setLabelData().
string Disk::p_disks = { "cciss/", "ida/", "ataraid/", "etherd/", "rd/" } [static, protected] |
Referenced by needP().
unsigned long storage::Disk::cyl [protected] |
unsigned storage::Disk::head [protected] |
unsigned storage::Disk::sector [protected] |
unsigned long storage::Disk::new_cyl [protected] |
Referenced by detectPartitions(), storage::Dasd::detectPartitions(), Disk(), doCreate(), operator=(), and redetectGeometry().
unsigned storage::Disk::new_head [protected] |
unsigned storage::Disk::new_sector [protected] |
string storage::Disk::label [protected] |
Referenced by availablePartNumber(), destroyPartitionTable(), detectPartitions(), storage::Dasd::detectPartitions(), Disk(), doCreate(), doCreateLabel(), doSetType(), equalContent(), labelName(), logData(), logDifference(), storage::operator<<(), operator=(), scanPartedLine(), setDiskLabelText(), and setLabelData().
string storage::Disk::udev_path [protected] |
Referenced by Disk(), getInfo(), logData(), storage::operator<<(), operator=(), setUdevData(), and udevPath().
std::list<string> storage::Disk::udev_id [protected] |
Referenced by Disk(), getInfo(), logData(), storage::operator<<(), operator=(), setUdevData(), and udevId().
std::list<string> storage::Disk::mp_alias [protected] |
Referenced by addMpAlias(), clearMpAlias(), logData(), mpAlias(), storage::operator<<(), and operator=().
string storage::Disk::detected_label [protected] |
Referenced by detectPartitions(), storage::Dasd::detectPartitions(), doCreate(), storage::operator<<(), and operator=().
string storage::Disk::system_stderr [protected] |
string storage::Disk::logfile_name [protected] |
Referenced by Disk(), logData(), and operator=().
string storage::Disk::sysfs_dir [protected] |
Referenced by equalContent(), getSysfsInfo(), logDifference(), storage::operator<<(), operator=(), and sysfsDir().
unsigned storage::Disk::max_primary [protected] |
bool storage::Disk::ext_possible [protected] |
bool storage::Disk::init_disk [protected] |
bool storage::Disk::iscsi [protected] |
Referenced by Disk(), equalContent(), getInfo(), getSysfsInfo(), logDifference(), storage::operator<<(), and operator=().
bool storage::Disk::dmp_slave [protected] |
bool storage::Disk::gpt_enlarge [protected] |
Referenced by detectPartitions(), Disk(), doCreate(), doCreateLabel(), enlargeGpt(), equalContent(), storage::operator<<(), and operator=().
unsigned storage::Disk::max_logical [protected] |
Referenced by availablePartNumber(), Disk(), equalContent(), logData(), logDifference(), maxLogical(), storage::operator<<(), operator=(), and setLabelData().
unsigned long storage::Disk::byte_cyl [protected] |
unsigned long storage::Disk::range [protected] |
storage::DiskInfo storage::Disk::info [mutable, protected] |
1.5.5