Author: fehr Date: Thu Feb 7 19:18:43 2008 New Revision: 44261 URL: http://svn.opensuse.org/viewcvs/yast?rev=44261&view=rev Log: add key sb_ver with version of raid superblock to md maps (#357897) Modified: trunk/storage/libstorage/src/Md.cc trunk/storage/libstorage/src/Md.h trunk/storage/libstorage/src/StorageInterface.h trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/include/raid_ui.ycp trunk/storage/storage/src/modules/Storage.ycp Modified: trunk/storage/libstorage/src/Md.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Md.cc?rev=44261&r1=44260&r2=44261&view=diff ============================================================================== --- trunk/storage/libstorage/src/Md.cc (original) +++ trunk/storage/libstorage/src/Md.cc Thu Feb 7 19:18:43 2008 @@ -44,15 +44,24 @@ setNameDev(); getMajorMinor( dev, mjr, mnr ); } - SystemCmd c( "mdadm -D " + device() + " | grep 'UUID : '" ); + SystemCmd c( "mdadm -D " + device() ); + c.select( "UUID : " ); string::size_type pos; - if( c.retcode()==0 && c.numLines()>0 ) + if( c.retcode()==0 && c.numLines(true)>0 ) { - md_uuid = *c.getLine(0); + md_uuid = *c.getLine(0,true); if( (pos=md_uuid.find( "UUID : " ))!=string::npos ) md_uuid.erase( 0, pos+7 ); md_uuid = extractNthWord( 0, md_uuid ); } + c.select( "Version : " ); + if( c.retcode()==0 && c.numLines(true)>0 ) + sb_ver = extractNthWord( 2, *c.getLine(0,true) ); + y2mil( "line:\"" << *c.getLine(0,true) << "\"" ); + y2mil( "sb_ver:\"" << sb_ver << "\"" ); + y2mil( "word0:\"" << extractNthWord( 0, *c.getLine(0,true)) << "\"" ); + y2mil( "word1:\"" << extractNthWord( 1, *c.getLine(0,true)) << "\"" ); + y2mil( "word2:\"" << extractNthWord( 2, *c.getLine(0,true)) << "\"" ); string tmp; string line = line1; if( (pos=line.find( ':' ))!=string::npos ) @@ -154,6 +163,7 @@ destrSb = false; md_parity = PAR_NONE; chunk = 0; + sb_ver = "01.00.00"; md_type = RAID_UNK; } @@ -564,6 +574,7 @@ info.nr = num; info.type = md_type; info.uuid = md_uuid; + info.sb_ver = sb_ver; info.chunk = chunk; info.parity = md_parity; info.devices.clear(); @@ -589,6 +600,8 @@ s << " Chunk:" << m.chunk; if( m.md_parity!=storage::PAR_NONE ) s << " Parity:" << m.ptName(); + if( !m.sb_ver.empty() ) + s << " SbVer:" << m.sb_ver; if( !m.md_uuid.empty() ) s << " MD UUID:" << m.md_uuid; if( m.destrSb ) @@ -605,8 +618,8 @@ { return( Volume::equalContent(rhs) && md_type==rhs.md_type && md_parity==rhs.md_parity && - chunk==rhs.chunk && md_uuid==rhs.md_uuid && destrSb==rhs.destrSb && - devs == rhs.devs && spare==rhs.spare ); + chunk==rhs.chunk && md_uuid==rhs.md_uuid && sb_ver==rhs.sb_ver && + destrSb==rhs.destrSb && devs == rhs.devs && spare==rhs.spare ); } void Md::logDifference( const Md& rhs ) const @@ -620,6 +633,8 @@ par_names[rhs.md_parity]; if( chunk!=rhs.chunk ) log += " Chunk:" + decString(chunk) + "-->" + decString(rhs.chunk); + if( sb_ver!=rhs.sb_ver ) + log += " SbVer:" + sb_ver + "-->" + rhs.sb_ver; if( md_uuid!=rhs.md_uuid ) log += " MD-UUID:" + md_uuid + "-->" + rhs.md_uuid; if( destrSb!=rhs.destrSb ) @@ -652,6 +667,7 @@ 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; Modified: trunk/storage/libstorage/src/Md.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Md.h?rev=44261&r1=44260&r2=44261&view=diff ============================================================================== --- trunk/storage/libstorage/src/Md.h (original) +++ trunk/storage/libstorage/src/Md.h Thu Feb 7 19:18:43 2008 @@ -68,6 +68,7 @@ storage::MdParity md_parity; unsigned long chunk; string md_uuid; + string sb_ver; bool destrSb; std::list<string> devs; std::list<string> spare; Modified: trunk/storage/libstorage/src/StorageInterface.h URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/StorageInterface.h?rev=44261&r1=44260&r2=44261&view=diff ============================================================================== --- trunk/storage/libstorage/src/StorageInterface.h (original) +++ trunk/storage/libstorage/src/StorageInterface.h Thu Feb 7 19:18:43 2008 @@ -335,6 +335,7 @@ unsigned type; unsigned parity; string uuid; + string sb_ver; unsigned long chunk; string devices; }; Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=44261&r1=44260&r2=44261&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Thu Feb 7 19:18:43 2008 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Feb 7 19:17:31 CET 2008 - fehr@suse.de + +- add key sb_ver with version of raid superblock to md maps (#357897) + +------------------------------------------------------------------- Tue Feb 5 14:43:10 CET 2008 - fehr@suse.de - force inode size of 128 to work around bnc#358483 Modified: trunk/storage/storage/src/include/raid_ui.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/raid_ui.ycp?rev=44261&r1=44260&r2=44261&view=diff ============================================================================== --- trunk/storage/storage/src/include/raid_ui.ycp (original) +++ trunk/storage/storage/src/include/raid_ui.ycp Thu Feb 7 19:18:43 2008 @@ -356,7 +356,8 @@ "type" : `sw_raid, "fsid" : Partitions::fsid_native, "size_k" : 0, // dummy - "create" : true, + "create" : true, + "sb_ver" : "01.00.00", "used_fs" : Partitions::DefaultFs() ]; map p = $[]; foreach( string device, (list<string>)at[i]:[], Modified: trunk/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=44261&r1=44260&r2=44261&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Storage.ycp (original) +++ trunk/storage/storage/src/modules/Storage.ycp Thu Feb 7 19:18:43 2008 @@ -1574,6 +1574,8 @@ { p["chunk_size"] = t; } + string d = LibStorage::MdInfo::swig_sb_ver_get(info); + p["sb_ver"] = d; list<string> ls = splitstring( LibStorage::MdInfo::swig_devices_get(info), " " ); p["devices"] = ls; c["partitions"] = add( c["partitions"]:[], p ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org