summaryrefslogtreecommitdiffstats
path: root/perl-install/lvm.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r--perl-install/lvm.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm
index 93c174daa..4499b9a1f 100644
--- a/perl-install/lvm.pm
+++ b/perl-install/lvm.pm
@@ -128,14 +128,19 @@ sub lv_delete {
@$list = grep { $_ != $lv } @$list;
}
-sub lv_create {
+sub suggest_lv_name {
my ($lvm, $lv) = @_;
my $list = $lvm->{primary}{normal} ||= [];
$lv->{lv_name} ||= 1 + max(map { if_($_->{device} =~ /(\d+)$/, $1) } @$list);
+}
+
+sub lv_create {
+ my ($lvm, $lv) = @_;
$lv->{device} = "$lvm->{VG_name}/$lv->{lv_name}";
lvm_cmd_or_die('lvcreate', '--size', int($lv->{size} / 2) . 'k', '-n', $lv->{lv_name}, $lvm->{VG_name});
$lv->{size} = get_lv_size($lv->{device}); #- the created size is smaller than asked size
set_isFormatted($lv, 0);
+ my $list = $lvm->{primary}{normal} ||= [];
push @$list, $lv;
}