[Fai-commit] r6337 - trunk/lib/setup-storage
Michael Tautschnig
mt at alioth.debian.org
Thu Apr 14 12:46:11 UTC 2011
Author: mt
Date: 2011-04-14 12:46:10 +0000 (Thu, 14 Apr 2011)
New Revision: 6337
Modified:
trunk/lib/setup-storage/Commands.pm
trunk/lib/setup-storage/Parser.pm
Log:
setup-storage/{Parser,Commands}.pm: Make on-disk LV order consistent with disk_config
* setup-storage/Parser.pm: Build an additional list of logical volumes to make
on-disk order of logical volumes consistent with disk_config.
* setup-storage/Commands.pm: Implement this order.
Modified: trunk/lib/setup-storage/Commands.pm
===================================================================
--- trunk/lib/setup-storage/Commands.pm 2011-04-14 12:39:25 UTC (rev 6336)
+++ trunk/lib/setup-storage/Commands.pm 2011-04-14 12:46:10 UTC (rev 6337)
@@ -509,7 +509,7 @@
my $vg = $1; # the actual volume group
# now create or resize the configured logical volumes
- foreach my $lv (keys %{ $FAI::configs{$config}{volumes} }) {
+ foreach my $lv (@{ $FAI::configs{$config}{ordered_lv_list} }) {
# reference to the size of the current logical volume
my $lv_size = (\%FAI::configs)->{$config}->{volumes}->{$lv}->{size};
# skip preserved partitions, but ensure that they exist
Modified: trunk/lib/setup-storage/Parser.pm
===================================================================
--- trunk/lib/setup-storage/Parser.pm 2011-04-14 12:39:25 UTC (rev 6336)
+++ trunk/lib/setup-storage/Parser.pm 2011-04-14 12:46:10 UTC (rev 6337)
@@ -732,6 +732,8 @@
# make sure, $2 has not been defined already
defined ($FAI::configs{$FAI::device}{volumes}{$2}{size}{range}) and
die "Logical volume $2 has been defined already.\n";
+ # add to ordered list
+ push @{ $FAI::configs{$FAI::device}{ordered_lv_list} }, $2;
# initialise the new hash
defined($FAI::configs{$FAI::device}{volumes}{$2}) or
$FAI::configs{$FAI::device}{volumes}{$2} = {};
@@ -781,6 +783,8 @@
$FAI::configs{$FAI::device}{volumes} = {};
# initialise the list of physical devices
$FAI::configs{$FAI::device}{devices} = ();
+ # initialise the ordered list of volumes
+ $FAI::configs{$FAI::device}{ordered_lv_list} = ();
# init device tree
$FAI::dev_children{$FAI::device} = ();
# the rule must not return undef
@@ -1064,6 +1068,12 @@
}
} elsif ($config =~ /^VG_(.+)$/) {
next if ($1 eq "--ANY--");
+ (scalar(keys %{ $FAI::configs{$config}{volumes} }) ==
+ scalar(@{ $FAI::configs{$config}{ordered_lv_list} })) or
+ &FAI::internal_error("Inconsistent LV lists - missing entries");
+ defined($FAI::configs{$config}{volumes}{$_}) or
+ &FAI::internal_error("Inconsistent LV lists - missing entries")
+ foreach (@{ $FAI::configs{$config}{ordered_lv_list} });
foreach my $p (keys %{ $FAI::configs{$config}{volumes} }) {
my $this_mp = $FAI::configs{$config}{volumes}{$p}{mountpoint};
next if ($this_mp eq "-");
More information about the Fai-commit
mailing list