[yast-commit] r41365 - in /branches/SuSE-SLE-10-SP1-Branch/storage: libstorage/src/MdCo.cc package/yast2-storage.changes storage/src/modules/Storage.ycp
Author: fehr Date: Thu Oct 11 13:16:42 2007 New Revision: 41365 URL: http://svn.opensuse.org/viewcvs/yast?rev=41365&view=rev Log: - overwrite newly created md devices as partitions (#266538) - handle EVMS over md correctly in GetUsedEvmsDisks (#266538) Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp Modified: branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc?rev=41365&r1=41364&r2=41365&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc (original) +++ branches/SuSE-SLE-10-SP1-Branch/storage/libstorage/src/MdCo.cc Thu Oct 11 13:16:42 2007 @@ -592,6 +592,21 @@ getStorage()->waitForDevice( m->device() ); getMdData( m->nr() ); updateEntry( m ); + bool used_as_pv = m->getUsedByType()==UB_EVMS || + m->getUsedByType()==UB_LVM; + y2milestone( "zeroNew:%d used_as_pv:%d", + getStorage()->getZeroNewPartitions(), used_as_pv ); + if( used_as_pv || getStorage()->getZeroNewPartitions() ) + { + string cmd; + SystemCmd c; + cmd = "dd if=/dev/zero of=" + m->device() + " bs=1k count=200"; + c.execute( cmd ); + cmd = "dd if=/dev/zero of=" + m->device() + + " seek=" + decString(m->sizeK()-10) + + " bs=1k count=10"; + c.execute( cmd ); + } } } else Modified: branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes?rev=41365&r1=41364&r2=41365&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-SLE-10-SP1-Branch/storage/package/yast2-storage.changes Thu Oct 11 13:16:42 2007 @@ -5,6 +5,8 @@ - fix performance hog with large number of disks and swap areas (#267262) - fix bug in member function equalContent (#245734) - correctly compute maximal allowable cylinder (#273286) +- overwrite newly created md devices as partitions (#266538) +- handle EVMS over md correctly in GetUsedEvmsDisks (#266538) ------------------------------------------------------------------- Mon Oct 8 10:49:37 CEST 2007 - fehr@suse.de Modified: branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp?rev=41365&r1=41364&r2=41365&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp (original) +++ branches/SuSE-SLE-10-SP1-Branch/storage/storage/src/modules/Storage.ycp Thu Oct 11 13:16:42 2007 @@ -5127,7 +5127,21 @@ ``(p["used_by_type"]:`UB_NONE==`UB_LVM && p["used_by"]:""==namel)))>0) )) { - rdisk = (list<string>)union( rdisk, [ disk ] ); + list<string> dl = [ disk ]; + if( disk=="/dev/md" ) + { + list<map> tl = []; + tl = filter( map p, data["partitions"]:[], + ``((p["used_by_type"]:`UB_NONE==`UB_EVMS && + p["used_by"]:""==name)|| + (p["used_by_type"]:`UB_NONE==`UB_LVM && + p["used_by"]:""==namel))); + dl = maplist( map p, tl, ``(p["device"]:"")); + dl = (list<string>)sort( dl ); + dl = (list<string>)toset( dl ); + y2milestone( "GetEvmsRealDisk dl %1", dl ); + } + rdisk = (list<string>)union( rdisk, dl ); } }); if( size(rdisk)==0 && !p["evms_native"]:false ) @@ -5157,12 +5171,16 @@ list<string> dl = GetEvmsRealDisk( tg, p ); foreach( string d, dl, ``{ + y2milestone( "GetUsedEvmsDisks d %1", d ); if( search( d, "/dev/md" ) == 0 ) { list<string> ndl = []; foreach( string dd, map pp, tg, ``{ - if( pp["used_by"]:"" == substring(d,5) ) + map pu = find( map p, pp["partitions"]:[], + ``(p["used_by"]:""==substring(d,5)) ); + y2milestone( "GetUsedEvmsDisks disk:%1 used:%2", dd, pu ); + if( pu!=nil && size(pu)>0 ) { ndl = add( ndl, dd ); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
fehr@svn.opensuse.org