[yast-commit] r64116 - in /branches/SuSE-Code-11-SP2-Branch/storage: ./ libstorage/src/ package/ storage/src/modules/

Author: fehr Date: Thu May 26 16:08:44 2011 New Revision: 64116 URL: http://svn.opensuse.org/viewcvs/yast?rev=64116&view=rev Log: - remove unsupported state of btrfs - more btrfs related bugfixes - version 2.17.103 Modified: branches/SuSE-Code-11-SP2-Branch/storage/VERSION branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp Modified: branches/SuSE-Code-11-SP2-Branch/storage/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/VERSION (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/VERSION Thu May 26 16:08:44 2011 @@ -1 +1 @@ -2.17.102 +2.17.103 Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.cc Thu May 26 16:08:44 2011 @@ -536,6 +536,53 @@ return( txt ); } +Text Btrfs::formatText(bool doing) const + { + Text txt; + bool done = false; + if( devices.size()+dev_add.size()==1 ) + { + Volume const *v = NULL; + if( getStorage()->findVolume( devices.front(), v, true )) + { + y2mil( "found:" << *v ); + txt = v->formatText(doing); + done = true; + } + } + if( !done ) + { + list<string> tl = devices; + tl.insert( tl.end(), dev_add.begin(), dev_add.end() ); + string d = boost::join( tl, " " ); + if( doing ) + { + // displayed text during action, + // %1$s is replaced by size (e.g. 623.5 MB) + // %2$s is repleace by a list of names e.g /dev/sda1 /dev/sda2 + txt = sformat( _("Formatting Btrfs volume of size %1$s (used devices:%2$s)"), + sizeString().c_str(), d.c_str() ); + } + else + { + if( !mp.empty() ) + // displayed text before action, + // %1$s is replaced by size (e.g. 623.5 MB) + // %2$s is repleace by a list of names e.g /dev/sda1 /dev/sda2 + // %3$s is replaced by mount point (e.g. /usr) + txt = sformat( _("Format Btrfs volume of size %1$s for %3$s (used devices:%2$s)"), + sizeString().c_str(), d.c_str(), mp.c_str() ); + else + // displayed text before action, + // %1$s is replaced by size (e.g. 623.5 MB) + // %2$s is repleace by a list of names e.g /dev/sda1 /dev/sda2 + txt = sformat( _("Format Btrfs volume of size %1$s (used devices:%2$s)"), + sizeString().c_str(), d.c_str() ); + } + } + return( txt ); + } + void Btrfs::getCommitActions(list<commitAction>& l) const { Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Btrfs.h Thu May 26 16:08:44 2011 @@ -65,6 +65,7 @@ Text extendText(bool doing, const string& device) const; Text reduceText(bool doing, const string& device) const; Text removeText( bool doing ) const; + Text formatText( bool doing ) const; void countSubvolAddDel( unsigned& add, unsigned& rem ) const; list<string> getSubvolAddDel( bool ) const; Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/BtrfsCo.cc Thu May 26 16:08:44 2011 @@ -305,20 +305,28 @@ int BtrfsCo::commitChanges( CommitStage stage, Volume* vol ) { y2mil("name:" << name() << " stage:" << stage); - int ret = Container::commitChanges( stage, vol ); - if( ret==0 && stage==DECREASE ) + int ret = 0; + if( stage==DECREASE ) { Btrfs * b = dynamic_cast<Btrfs *>(vol); if( b!=NULL ) - ret = b->doReduce(); + { + if( Btrfs::needReduce(*b) ) + ret = b->doReduce(); + } else ret = BTRFS_COMMIT_INVALID_VOLUME; } - else if( ret==0 && stage==INCREASE ) + if( ret==0 ) + ret = Container::commitChanges( stage, vol ); + if( ret==0 && stage==INCREASE ) { Btrfs * b = dynamic_cast<Btrfs *>(vol); if( b!=NULL ) - ret = b->doExtend(); + { + if( Btrfs::needExtend(*b) ) + ret = b->doExtend(); + } else ret = BTRFS_COMMIT_INVALID_VOLUME; } Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Storage.cc Thu May 26 16:08:44 2011 @@ -3145,7 +3145,7 @@ { ret = STORAGE_CHANGE_READONLY; } - else if( findVolume( device, cont, vol, false ) ) + else if( findVolume( device, cont, vol, true ) ) { if( canRemove( *vol ) ) { Modified: branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/libstorage/src/Volume.cc Thu May 26 16:08:44 2011 @@ -1089,7 +1089,7 @@ int ret = -1; if( fs!=TMPFS ) { - int ret = cmd.execute( cmdline ); + ret = cmd.execute( cmdline ); if( ret != 0 && mountDevice()!=dev ) { cmdline = ((detected_fs != SWAP)?UMOUNTBIN " ":SWAPOFFBIN " ") + quote(dev); Modified: branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/package/yast2-storage.changes Thu May 26 16:08:44 2011 @@ -1,7 +1,10 @@ ------------------------------------------------------------------- -Thu May 26 13:59:15 CEST 2011 - fehr@suse.de +Thu May 26 16:07:46 CEST 2011 - fehr@suse.de - backport patch to support also parted 2.4 +- remove unsupported state of btrfs +- more btrfs related bugfixes +- version 2.17.103 ------------------------------------------------------------------- Tue May 24 11:24:24 CEST 2011 - fehr@suse.de Modified: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/FileSystems.ycp Thu May 26 16:08:44 2011 @@ -182,7 +182,7 @@ `lvm : true ]; - list<symbol> unsupportFs = [ `jfs, `btrfs ]; + list<symbol> unsupportFs = [ `jfs ]; global define list<map<symbol, any> > GetGeneralFstabOptions() Modified: branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/storag... ============================================================================== --- branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp (original) +++ branches/SuSE-Code-11-SP2-Branch/storage/storage/src/modules/Storage.ycp Thu May 26 16:08:44 2011 @@ -1803,11 +1803,16 @@ tg["/dev/btrfs","partitions"] = filter( map p, tg["/dev/btrfs","partitions"]:[], ``(size(p["devices"]:[])>1)); - y2milestone( "simple %1", simple ); + y2milestone( "HandleBtrfsSimpleVolumes simple %1", simple ); + list<string> keys = [ "subvol", "uuid", "format", "fstype", "inactive", "mount", "mountby", "used_fs" ]; foreach( map p, simple, { - tg = SetPartitionData( tg, p["device"]:"", "subvol", p["subvol"]:[] ); - tg = SetPartitionData( tg, p["device"]:"", "uuid", p["uuid"]:"" ); + y2milestone( "HandleBtrfsSimpleVolumes before %1", GetPartition( tg, p["device"]:"" ); + foreach( string k, keys, + { + tg = SetPartitionData( tg, p["device"]:"", k, p[k]:(any)"" ); + }); + y2milestone( "HandleBtrfsSimpleVolumes after %1", GetPartition( tg, p["device"]:"" ); }); } return( tg ); @@ -1876,7 +1881,7 @@ conts = getContainers(); map c = $[]; c = find( map c, conts, ``(c["device"]:""==dev) ); - map tg = StorageMap[targets_key]:$[]; + map<string,map> tg = StorageMap[targets_key]:$[]; //SCR::Write(.target.ycp, "/tmp/upd_disk_bef_"+sformat("%1",count), StorageMap[targets_key]:$[] ); if( c==nil ) { @@ -1890,6 +1895,8 @@ else { tg[dev] = getContainerInfo(c); + if( dev=="/dev/btrfs" ) + tg = HandleBtrfsSimpleVolumes( tg ); } StorageMap[targets_key] = tg; //SCR::Write(.target.ycp, "/tmp/upd_disk_aft_"+sformat("%1",count), StorageMap[targets_key]:$[] ); @@ -1902,6 +1909,8 @@ map<string,map> tg = StorageMap[targets_key]:$[]; //SCR::Write(.target.ycp, "/tmp/upd_dev_bef_"+sformat("%1",count), tg ); string cdev=""; + map mdev = GetPartition( tg, dev ); + y2milestone( "UpdateTargetMapDev mdev %1", mdev ); foreach( string key, map d, tg, ``{ if( size(cdev)==0 && @@ -1940,6 +1949,11 @@ } else y2error( "UpdateTargetMapDev key %1 not found in target", disk["device"]:"" ); + if( mdev["used_fs"]:`unknown == `btrfs ) + { + tg["/dev/btrfs"] = getContainerInfo(tg["/dev/btrfs"]:$[]); + tg = HandleBtrfsSimpleVolumes( tg ); + } StorageMap[targets_key] = tg; //SCR::Write(.target.ycp, "/tmp/upd_dev_aft_"+sformat("%1",count), StorageMap[targets_key]:$[] ); //count = count+1; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
fehr@svn2.opensuse.org