Author: aschnell
Date: Mon Jun 23 14:19:23 2008
New Revision: 48487
URL: http://svn.opensuse.org/viewcvs/yast?rev=48487&view=rev
Log:
- work on raid parity algorithm
Modified:
branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp
branches/tmp/aschnell/part-redesign/storage/src/include/raid_lib.ycp
branches/tmp/aschnell/part-redesign/storage/src/modules/Storage.ycp
branches/tmp/aschnell/part-redesign/storage/src/modules/StorageFields.ycp
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp?rev=48487&r1=48486&r2=48487&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid-dialogs.ycp Mon Jun 23 14:19:23 2008
@@ -12,9 +12,9 @@
{
y2milestone("MiniWorkflowStepRaidTypeDevices data:%1", data);
- symbol raid_type = `raid0;
+ symbol raid_type = data["raid_type"]:`raid0;
- list<string> devices = [];
+ list<string> devices = []; // TODO
list<symbol> fields = StorageSettings::FilterTable([ `device, `udev_path, `udev_id, `size ]);
@@ -93,22 +93,30 @@
{
y2milestone("MiniWorkflowStepRaidOptions data:%1", data);
- integer chunk_size = 4*1024;
+ symbol raid_type = data["raid_type"]:`raid0;
+ integer chunk_size = (data["chunk_size_k"]:4)*1024; // TODO
+ symbol parity_algorithm = data["parity_algorithm"]:`left_asymmetric;
list<term> chunk_sizes_list = maplist(integer i, Integer::RangeFrom(11, 22), {
return `item(`id(2 << i), Storage::ByteToHumanStringWithPrecision(2 << i, 2, true));
});
- term frames = `VStackFrames();
-
- frames = add(frames, `Frame("Bla",
- `HBox(
- `Left(`ComboBoxSelected(`id(`chunk_size), _("Chunk Size"), chunk_sizes_list, `id(chunk_size))),
- `HStretch())
- )
+ term options = `VBox(
+ `Left(`ComboBoxSelected(`id(`chunk_size), _("Chunk Size"), chunk_sizes_list,
+ `id(chunk_size)))
);
- term contents = `HVSquash(frames);
+ if (raid_type == `raid5)
+ options = add(options,
+ `Left(`ComboBoxSelected(`id(`parity_algorithm), `opt(`hstretch), _("Parity &Algorithm"),
+ [ `item(`id(`left_asymmetric), "left-asymmetric"),
+ `item(`id(`left_symmetric), "left-symmetric"),
+ `item(`id(`right_asymmetric), "right-asymmetric"),
+ `item(`id(`right_symmetric), "right-symmetric") ],
+ `id(parity_algorithm)))
+ );
+
+ term contents = `HVSquash(`Frame(_("RAID Options"), options));
MiniWorkflow::SetContents(Greasemonkey::Transform(contents), "help");
@@ -126,7 +134,11 @@
{
chunk_size = (integer) UI::QueryWidget(`id(`chunk_size), `Value);
+ if (UI::WidgetExists(`id(`parity_algorithm)))
+ parity_algorithm = (symbol) UI::QueryWidget(`id(`parity_algorithm), `Value);
+
data["chunk_size_k"] = chunk_size / 1024;
+ data["parity_algorithm"] = parity_algorithm;
}
y2milestone("MiniWorkflowStepRaidOptions data:%1 ret:%2", data, widget);
Modified: branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp?rev=48487&r1=48486&r2=48487&view=diff
==============================================================================
--- branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp (original)
+++ branches/tmp/aschnell/part-redesign/storage/src/include/ep-raid.ycp Mon Jun 23 14:19:23 2008
@@ -66,9 +66,10 @@
map