Author: aschnell Date: Mon Jan 18 18:11:31 2010 New Revision: 60440 URL: http://svn.opensuse.org/viewcvs/yast?rev=60440&view=rev Log: - added NFS4 support (fate #305171) Modified: trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/include/ep-nfs.ycp trunk/storage/storage/src/modules/FileSystems.ycp trunk/storage/storage/src/modules/Storage.ycp Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.cha... ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Mon Jan 18 18:11:31 2010 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon Jan 18 17:50:59 CET 2010 - aschnell@suse.de + +- added NFS4 support (fate #305171) + +------------------------------------------------------------------- Mon Jan 18 11:53:51 CET 2010 - aschnell@suse.de - show textual error messages during commit (bnc #546012) Modified: trunk/storage/storage/src/include/ep-nfs.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-nf... ============================================================================== --- trunk/storage/storage/src/include/ep-nfs.ycp (original) +++ trunk/storage/storage/src/include/ep-nfs.ycp Mon Jan 18 18:11:31 2010 @@ -113,9 +113,13 @@ target_map = Storage::GetTargetMap(); list<map> nfs_list = target_map["/dev/nfs", "partitions"]:[]; - integer sizeK = Storage::CheckNfsVolume (entry["device"]:"", entry["fstopt"]:""); + string device = entry["device"]:""; + string mount = entry["mount"]:""; + string opts = entry["fstopt"]:""; + boolean nfs4 = entry["vfstype"]:"nfs" == "nfs4"; - if ( sizeK <= 0) + integer sizeK = Storage::CheckNfsVolume(device, opts, nfs4); + if (sizeK <= 0) { //rollback only if user does not want to save (#450060) //the mount might fail later if the errors are not corrected, but the user has been warned @@ -130,7 +134,7 @@ //real size - Perl then wants to die in addNfsVolume call sizeK = 0; } - Storage::AddNfsVolume( entry["device"]:"", entry["fstopt"]:"", sizeK, entry["mount"]:""); + Storage::AddNfsVolume(device, opts, sizeK, mount, nfs4); } void EditShare( map <string, any> entry ) @@ -156,6 +160,7 @@ { m["fstopt"] = entry["fstopt"]:""; m["mount"] = entry["mount"]:""; + m["vfstype"] = entry["used_fs"]:`nfs == `nfs ? "nfs" : "nfs4"; } return m; }); @@ -210,8 +215,6 @@ //a hack - we don't have overviews for nfs dirs, so let's switch to the main panel ... CreateNfsMainPanel( user_data ); UI::ChangeWidget(`tree, `CurrentItem, `nfs ); - } - - } +} Modified: trunk/storage/storage/src/modules/FileSystems.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/FileS... ============================================================================== --- trunk/storage/storage/src/modules/FileSystems.ycp (original) +++ trunk/storage/storage/src/modules/FileSystems.ycp Mon Jan 18 18:11:31 2010 @@ -44,6 +44,7 @@ LibStorage::NTFS() : `ntfs, LibStorage::SWAP() : `swap, LibStorage::NFS() : `nfs, + LibStorage::NFS4() : `nfs4, LibStorage::FSNONE() : `none ] ]; @@ -959,14 +960,18 @@ } } - global define string GetName( symbol used_fs, string defaultv )``{ + + global string GetName( symbol used_fs, string defaultv ) + { map<symbol,any> fsmap = GetFsMap( used_fs); string ret = fsmap[`name]:""; if ( ret == "" && used_fs == `ntfs ) ret = "NTFS"; // obsolete? (included in RealFileSystems) - if ( ret == "" && used_fs == `nfs ) ret = "NFS"; + if ( ret == "" && used_fs == `nfs ) ret = "NFS"; + if ( ret == "" && used_fs == `nfs4 ) ret = "NFS4"; if ( ret == "" ) ret = defaultv; return ret; - } + } + global define integer GetFsid( symbol used_fs )``{ map<symbol,any> fsmap = GetFsMap( used_fs); Modified: trunk/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Stora... ============================================================================== --- trunk/storage/storage/src/modules/Storage.ycp (original) +++ trunk/storage/storage/src/modules/Storage.ycp Mon Jan 18 18:11:31 2010 @@ -2599,27 +2599,25 @@ return( ret==0 ); } -global boolean AddNfsVolume( string nfsdev, string opts, integer sz, string mp ) +global boolean AddNfsVolume( string nfsdev, string opts, integer sz, string mp, boolean nfs4 ) { - y2milestone( "AddNfsVolume dev:%1 opts:%2 size:%3 mp:%4", nfsdev, opts, - sz, mp ); + y2milestone("AddNfsVolume dev:%1 opts:%2 size:%3 mp:%4 nfs4:%5", nfsdev, opts, sz, mp, nfs4); integer ret = 0; string dummy = ""; - ret = LibStorage::StorageInterface::addNfsDevice( sint, nfsdev, opts, sz, mp ); + ret = LibStorage::StorageInterface::addNfsDevice(sint, nfsdev, opts, sz, mp, nfs4); if( ret<0 ) y2error( "AddNfsVolume sint ret:%1", ret ); UpdateTargetMapDisk( "/dev/nfs" ); return( ret==0 ); } -global integer CheckNfsVolume( string nfsdev, string opts ) +global integer CheckNfsVolume(string nfsdev, string opts, boolean nfs4) { - y2milestone( "CheckNfsVolume dev:%1 opts:%2", nfsdev, opts ); + y2milestone("CheckNfsVolume dev:%1 opts:%2 nfs4:%3", nfsdev, opts, nfs4); integer ret = 0; integer sz = 0; string dummy = ""; - ret = LibStorage::StorageInterface::checkNfsDevice( sint, nfsdev, opts, - sz ); + ret = LibStorage::StorageInterface::checkNfsDevice(sint, nfsdev, opts, nfs4, sz); if( ret<0 ) y2error( "CheckNfsVolume sint ret:%1", ret ); else @@ -2973,8 +2971,8 @@ } else if( ctype == `CT_NFS ) { - ret = Storage::AddNfsVolume( p["device"]:"", p["fstopt"]:"", - p["size_k"]:0, p["mount"]:"" ); + ret = Storage::AddNfsVolume( p["device"]:"", p["fstopt"]:"", p["size_k"]:0, + p["mount"]:"", p["used_fs"]:`nfs == `nfs4 ); } y2milestone( "CreateAny ret:%1", ret ); return( ret ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org