Author: fehr Date: Mon Jan 11 16:29:42 2010 New Revision: 60317 URL: http://svn.opensuse.org/viewcvs/yast?rev=60317&view=rev Log: let libstorage determine affected devices when removing volumes (bnc #426907) Modified: trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/include/custom_part_check_generated.ycp trunk/storage/storage/src/include/ep-hd-lib.ycp trunk/storage/storage/src/include/ep-lib.ycp trunk/storage/storage/src/include/ep-lvm-lib.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.changes?rev=60317&r1=60316&r2=60317&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Mon Jan 11 16:29:42 2010 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Mon Jan 11 16:11:00 CET 2010 - fehr@suse.de + +- let libstorage determine affected devices when removing volumes + (bnc #426907) + +------------------------------------------------------------------- Fri Jan 08 14:37:40 CET 2010 - aschnell@suse.de - delay ntfs resize check until partitioning proposal (bnc #533568) Modified: trunk/storage/storage/src/include/custom_part_check_generated.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_check_generated.ycp?rev=60317&r1=60316&r2=60317&view=diff ============================================================================== --- trunk/storage/storage/src/include/custom_part_check_generated.ycp (original) +++ trunk/storage/storage/src/include/custom_part_check_generated.ycp Mon Jan 11 16:29:42 2010 @@ -745,7 +745,7 @@ } else if( used != `UB_NONE ) { - // popup text, Do not translate RAID. + // popup text Popup::Message(_(" The selected extended partition contains at least one partition that is in use. Remove the used volume before Modified: trunk/storage/storage/src/include/ep-hd-lib.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-hd-lib.ycp?rev=60317&r1=60316&r2=60317&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-hd-lib.ycp (original) +++ trunk/storage/storage/src/include/ep-hd-lib.ycp Mon Jan 11 16:29:42 2010 @@ -106,9 +106,8 @@ } else { - list<map> parts = target_map[device, "partitions"]:[]; //partition names - list<string> pnames = maplist(map part, parts, { return part["device"]:""; }); + list<string> pnames = Storage::GetAffectedDevices( device ); integer count = size(pnames); if(count == 0) Modified: trunk/storage/storage/src/include/ep-lib.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lib.ycp?rev=60317&r1=60316&r2=60317&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-lib.ycp (original) +++ trunk/storage/storage/src/include/ep-lib.ycp Mon Jan 11 16:29:42 2010 @@ -87,11 +87,7 @@ { case `UB_LVM: { - list <map> parts = tg[used_by_device, "partitions"]:[]; - list<string> volumes = prepend( - maplist(map part, parts, { return part["device"]:""; }), - used_by_device); - + list<string> volumes = Storage::GetAffectedDevices( device ); return ( ConfirmRecursiveDelete( device, volumes, _("Confirm Deleting Partition Used by LVM"), sformat(_("The selected partition is used by volume group \"%1\" @@ -103,7 +99,8 @@ } case `UB_MD: { - return ( ConfirmRecursiveDelete( device, [used_by_device], + list<string> volumes = Storage::GetAffectedDevices( device ); + return ( ConfirmRecursiveDelete( device, volumes, _("Confirm Deleting Partition Used by RAID"), sformat(_("The selected partition belongs to RAID \"%1\" To keep system in consistent state, the following Modified: trunk/storage/storage/src/include/ep-lvm-lib.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-lvm-lib.ycp?rev=60317&r1=60316&r2=60317&view=diff ============================================================================== --- trunk/storage/storage/src/include/ep-lvm-lib.ycp (original) +++ trunk/storage/storage/src/include/ep-lvm-lib.ycp Mon Jan 11 16:29:42 2010 @@ -136,11 +136,8 @@ } string vgname = substring(device, 5); - map<string,map> tg = Storage::GetTargetMap(); - //all LVs - list<map> parts = tg["/dev/" + vgname, "partitions"]:[]; //LV device names - list<string> log_volumes = maplist(map part, parts, { return part["device"]:""; }); + list<string> log_volumes = Storage::GetAffectedDevices( device ); //how many of those we have? integer count = size(log_volumes); Modified: trunk/storage/storage/src/modules/Storage.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=60317&r1=60316&r2=60317&view=diff ============================================================================== --- trunk/storage/storage/src/modules/Storage.ycp (original) +++ trunk/storage/storage/src/modules/Storage.ycp Mon Jan 11 16:29:42 2010 @@ -3287,6 +3287,14 @@ } +global list<string> GetAffectedDevices( string dev ) + { + list<string> r = []; + integer ret = LibStorage::StorageInterface::getRecursiveUsing(sint,dev,r); + y2milestone( "GetAffectedDevices dev:%1 ret:%2 r:%3", dev, ret, r ); + return( r ); + } + global void SetRecursiveRemoval( boolean val ) { y2milestone( "SetRecursiveRemoval val:%1", val ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org