Author: aschnell Date: Fri Oct 24 13:14:41 2008 New Revision: 52513 URL: http://svn.opensuse.org/viewcvs/yast?rev=52513&view=rev Log: - fixed raid detection (bnc #438644) Modified: trunk/storage/libstorage/src/Md.cc trunk/storage/package/yast2-storage.changes Modified: trunk/storage/libstorage/src/Md.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Md.cc?rev=52513&r1=52512&r2=52513&view=diff ============================================================================== --- trunk/storage/libstorage/src/Md.cc (original) +++ trunk/storage/libstorage/src/Md.cc Fri Oct 24 13:14:41 2008 @@ -18,9 +18,8 @@ using namespace storage; using namespace std; -Md::Md( const MdCo& d, unsigned PNr, MdType Type, +Md::Md( const MdCo& d, unsigned PNr, MdType Type, const list<string>& devices ) : Volume( d, PNr, 0 ) - { y2debug( "constructed md %s on container %s", dev.c_str(), cont->name().c_str() ); @@ -36,8 +35,7 @@ Md::Md( const MdCo& d, const string& line1, const string& line2 ) : Volume( d, 0, 0 ) { - y2milestone( "constructed md lines1:\"%s\" line2:\"%s\"", line1.c_str(), - line2.c_str() ); + y2mil("constructed md line1:\"" << line1 << "\" line2:\"" << line2 << "\""); if( d.type() != MD ) y2error( "constructed md with wrong container" ); init(); @@ -72,13 +70,13 @@ string line = line1; if( (pos=line.find( ':' ))!=string::npos ) line.erase( 0, pos+1 ); - if( (pos=line.find_first_not_of( app_ws ))!=string::npos && pos!=0 ) - line.erase( 0, pos ); + boost::trim_left(line, locale::classic()); if( (pos=line.find_first_of( app_ws ))!=string::npos ) { if (line.substr(0, pos) == "active") line.erase(0, pos); } + boost::trim_left(line, locale::classic()); if( (pos=line.find_first_of( app_ws ))!=string::npos ) { tmp = line.substr( 0, pos ); @@ -87,17 +85,16 @@ setReadonly(); y2warning( "readonly or inactive md device %d", nr() ); line.erase( 0, pos ); + boost::trim_left(line, locale::classic()); } } - if( (pos=line.find_first_not_of( app_ws ))!=string::npos && pos!=0 ) - line.erase( 0, pos ); + boost::trim_left(line, locale::classic()); if( (pos=line.find_first_of( app_ws ))!=string::npos ) { if( line.substr( 0, pos ).find( "active" )!=string::npos ) line.erase( 0, pos ); } - if( (pos=line.find_first_not_of( app_ws ))!=string::npos && pos!=0 ) - line.erase( 0, pos ); + boost::trim_left(line, locale::classic()); tmp = extractNthWord( 0, line ); md_type = toMdType( tmp ); if( md_type == RAID_UNK ) @@ -178,11 +175,11 @@ md_type = RAID_UNK; } -void +void Md::getDevs( list<string>& devices, bool all, bool spares ) const - { + { if( !all ) - devices = spares ? spare : devs ; + devices = spares ? spare : devs; else { devices = devs; @@ -235,7 +232,7 @@ return( ret ); } -int +int Md::checkDevices() { unsigned nmin = 2; @@ -293,9 +290,9 @@ setSize(size_k); } -void -Md::addSpareDevice( const string& dev ) - { +void +Md::addSpareDevice( const string& dev ) + { string d = normalizeDevice(dev); if( find( spare.begin(), spare.end(), d )!=spare.end() || find( devs.begin(), devs.end(), d )!=devs.end() ) @@ -482,17 +479,17 @@ // %3$s is replaced by file system type (e.g. reiserfs) // %4$s is replaced by mount point (e.g. /usr) txt = sformat( _("Format software RAID %1$s (%2$s) for %4$s with %3$s"), - d.c_str(), sizeString().c_str(), + d.c_str(), sizeString().c_str(), fsTypeString().c_str(), mp.c_str() ); } else { - // displayed text before action, %1$s is replaced by device name e.g. /dev/md0 + // displayed text before action, %1$s is replaced by device name e.g. /dev/md0 // %2$s is replaced by size (e.g. 623.5 MB) // %3$s is replaced by file system type (e.g. reiserfs) // %4$s is replaced by mount point (e.g. /usr) txt = sformat( _("Format encrypted software RAID %1$s (%2$s) for %4$s with %3$s"), - d.c_str(), sizeString().c_str(), + d.c_str(), sizeString().c_str(), fsTypeString().c_str(), mp.c_str() ); } } @@ -502,7 +499,7 @@ // %2$s is replaced by size (e.g. 623.5 MB) // %3$s is replaced by file system type (e.g. reiserfs) txt = sformat( _("Format software RAID %1$s (%2$s) with %3$s"), - d.c_str(), sizeString().c_str(), + d.c_str(), sizeString().c_str(), fsTypeString().c_str() ); } } @@ -521,7 +518,7 @@ } MdParity -Md::toMdParity( const string& val ) +Md::toMdParity( const string& val ) { enum MdParity ret = RIGHT_SYMMETRIC; while( ret!=PAR_NONE && val!=par_names[ret] ) @@ -549,9 +546,9 @@ return( ret ); } -void Md::setPersonality( MdType val ) - { - md_type=val; +void Md::setPersonality( MdType val ) + { + md_type=val; computeSize(); } @@ -619,7 +616,7 @@ bool Md::equalContent( const Md& rhs ) const { return( Volume::equalContent(rhs) && - md_type==rhs.md_type && md_parity==rhs.md_parity && + md_type==rhs.md_type && md_parity==rhs.md_parity && chunk==rhs.chunk && md_uuid==rhs.md_uuid && sb_ver==rhs.sb_ver && destrSb==rhs.destrSb && devs == rhs.devs && spare==rhs.spare ); } @@ -628,10 +625,10 @@ { string log = Volume::logDifference( rhs ); if( md_type!=rhs.md_type ) - log += " Personality:" + md_names[md_type] + "-->" + + log += " Personality:" + md_names[md_type] + "-->" + md_names[rhs.md_type]; if( md_parity!=rhs.md_parity ) - log += " Parity:" + par_names[md_parity] + "-->" + + log += " Parity:" + par_names[md_parity] + "-->" + par_names[rhs.md_parity]; if( chunk!=rhs.chunk ) log += " Chunk:" + decString(chunk) + "-->" + decString(rhs.chunk); @@ -684,9 +681,9 @@ *this = rhs; } -string Md::md_names[] = { "unknown", "raid0", "raid1", "raid5", "raid6", +string Md::md_names[] = { "unknown", "raid0", "raid1", "raid5", "raid6", "raid10", "multipath" }; -string Md::par_names[] = { "none", "left-asymmetric", "left-symmetric", +string Md::par_names[] = { "none", "left-asymmetric", "left-symmetric", "right-asymmetric", "right-symmetric" }; unsigned Md::md_major = 0; Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=52513&r1=52512&r2=52513&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Fri Oct 24 13:14:41 2008 @@ -2,6 +2,7 @@ Fri Oct 24 11:50:14 CEST 2008 - aschnell@suse.de - encrypt crypt files per default (bnc #438047) +- fixed raid detection (bnc #438644) - 2.17.44 ------------------------------------------------------------------- @@ -72,7 +73,7 @@ - don't reset mount point (bnc #432954) - fixed creating encrypted logical volumes (bnc #433462) - include file system type in tables (bnc #428142) -- make EFI require GPT and make default disk label depend on EFI +- make EFI require GPT and make default disk label depend on EFI (bnc #433166) - 2.17.36 @@ -88,7 +89,7 @@ ------------------------------------------------------------------- Thu Oct 2 12:56:09 CEST 2008 - kmachalkova@suse.cz -- Partition resizing works again (bnc#419564) +- Partition resizing works again (bnc#419564) - 2.17.34 ------------------------------------------------------------------- @@ -98,7 +99,7 @@ - Propose reasonable mountpoints according to selected filesystem (bnc#425741) - Correctly save filesystem ID (bnc#425744) -- Few look&feel improvements +- Few look&feel improvements - 2.17.33 ------------------------------------------------------------------- @@ -157,7 +158,7 @@ - NFS shares are now accesible as read-write (FaTE#303326) - Double-click on NFS share works again -- Check if yast2-nfs-client is installed on creating NFS view +- Check if yast2-nfs-client is installed on creating NFS view ------------------------------------------------------------------- Thu Sep 4 14:30:58 CEST 2008 - jsrain@suse.cz @@ -532,7 +533,7 @@ - make sure NFS entries in fstab get zero passno field ------------------------------------------------------------------- -Tue Jan 15 15:41:36 CET 2008 - fehr@suse.de +Tue Jan 15 15:41:36 CET 2008 - fehr@suse.de - adapt size restrictions of disk label to parted (bnc#352484) - use gpt as default disk label for disks larger 2TB @@ -3778,7 +3779,7 @@ ------------------------------------------------------------------- Fri Sep 26 09:05:42 CEST 2003 - fehr@suse.de -- show disk selection instead of exptert dialog if part proposal +- show disk selection instead of expert dialog if part proposal is impossible ------------------------------------------------------------------- @@ -4331,7 +4332,7 @@ - do not add default windows mount points if users decides to create its own partition setup -- exptend check for mount points in CheckOkMount (#19147) +- extend check for mount points in CheckOkMount (#19147) - reset format flag if partition get part of MD or LVM (#19190) - version 2.6.32 -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org