Author: jsrain Date: Thu Sep 4 15:58:36 2008 New Revision: 50693 URL: http://svn.opensuse.org/viewcvs/yast?rev=50693&view=rev Log: use limit for LVM volume group when creating new proposal (fate #303594) Modified: branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp Modified: branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes?rev=50693&r1=50692&r2=50693&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-SLE-10-SP3-Branch/storage/package/yast2-storage.changes Thu Sep 4 15:58:36 2008 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Thu Sep 4 14:30:58 CEST 2008 - jsrain@suse.cz + +- use limit for LVM volume group when creating new proposal + (fate #303594) + +------------------------------------------------------------------- Wed Apr 30 12:03:42 CEST 2008 - aschnell@suse.de - fixed seg. fault during evms activation (bnc #383646) Modified: branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp?rev=50693&r1=50692&r2=50693&view=diff ============================================================================== --- branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp (original) +++ branches/SuSE-SLE-10-SP3-Branch/storage/storage/src/include/do_proposal_flexible.ycp Thu Sep 4 15:58:36 2008 @@ -295,9 +295,23 @@ gap[key] = remove( gap[key]:[], 0 ); if( g["cylinders"]:0 > 1 ) { - g["added"] = add( g["added"]:[], - [ 0, gap[key,0]:0, g["cylinders"]:0 ] ); - g["cylinders"] = 0; + + integer vg_size = Storage::GetControlCfg()["vm_want"]:(15*1024); + // get only limited amount of the gap so that there is free + // space left (fate #303594) + y2milestone ("do_vm_disk_conf maximum volume group size from control file: %1", vg_size); + integer add_cylinders = g["cylinders"]:0; // whole partition as default + if (vg_size != nil && vg_size > 0) + { + integer cyl_size = g["size"]:0 / g["cylinders"]:0; + add_cylinders = (vg_size * 1024 * 1024) / cyl_size; + if (add_cylinders > g["cylinders"]:0) + add_cylinders = g["cylinders"]:0; + } + g["added"] = add( g["added"]:[], + [ 0, gap[key,0]:0, add_cylinders ] ); + y2milestone ("do_vm_disk_conf added new partition: %1", g); + g["cylinders"] = 0; // do not use the rest of the gap, if not set to zero, it is used, don't know why gap[key] = remove( gap[key]:[], 0 ); } } @@ -421,9 +435,22 @@ (!g["extended"]:false && size(gap["free_pnr"]:[])>0))) { string key = g["extended"]:false ? "ext_pnr" : "free_pnr"; - g["added"] = add( g["added"]:[], - [ 0, gap[key,0]:0, g["cylinders"]:0 ]); - g["cylinders"] = 0; + // get only limited amount of the gap so that there is free + // space left (fate #303594) + integer vg_size = Storage::GetControlCfg()["vm_want"]:(15*1024); + y2milestone ("do_vm_disk_conf maximum volume group size from control file: %1", vg_size); + integer add_cylinders = g["cylinders"]:0; // whole partition as default + if (vg_size != nil && vg_size > 0) + { + integer cyl_size = g["size"]:0 / g["cylinders"]:0; + add_cylinders = (vg_size * 1024 * 1024) / cyl_size; + if (add_cylinders > g["cylinders"]:0) + add_cylinders = g["cylinders"]:0; + } + g["added"] = add( g["added"]:[], + [ 0, gap[key,0]:0, add_cylinders ]); + y2milestone ("do_vm_disk_conf added new partition: %1", g); + g["cylinders"] = 0; // otherwise it get another chunk - don't know why :-( gap[key] = remove( gap[key]:[], 0 ); } return( g ); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org