[yast-commit] r50665 - in /trunk/storage: package/yast2-storage.changes storage/src/include/do_proposal_flexible.ycp
Author: jsrain Date: Thu Sep 4 14:32:10 2008 New Revision: 50665 URL: http://svn.opensuse.org/viewcvs/yast?rev=50665&view=rev Log: use limit for LVM volume group when creating new proposal (fate #303594) Modified: trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/include/do_proposal_flexible.ycp Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=50665&r1=50664&r2=50665&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Thu Sep 4 14:32:10 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 Sep 3 12:18:59 CEST 2008 - visnov@suse.cz - use unified installation progress (fate #303860) Modified: trunk/storage/storage/src/include/do_proposal_flexible.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/do_proposal_flexible.ycp?rev=50665&r1=50664&r2=50665&view=diff ============================================================================== --- trunk/storage/storage/src/include/do_proposal_flexible.ycp (original) +++ trunk/storage/storage/src/include/do_proposal_flexible.ycp Thu Sep 4 14:32:10 2008 @@ -303,9 +303,22 @@ 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 ); } } @@ -429,9 +442,22 @@ (!g["extended"]:false && size(gap["free_pnr"]:[])>0))) { string key = g["extended"]:false ? "ext_pnr" : "free_pnr"; + // 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, g["cylinders"]:0 ]); - g["cylinders"] = 0; + [ 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
participants (1)
-
jsrain@svn.opensuse.org