diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-03-22 10:17:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-03-22 10:17:25 +0000 |
commit | 7e252c87d61d61ee1fadf9ce6a494fe444f8c45c (patch) | |
tree | 991bb2081e0b4cec6534318e96166069aee0731d /perl-install/lvm.pm | |
parent | 87b0f66028e8e20eb09b56ab40fa29ae1c05e96e (diff) | |
download | drakx-backup-do-not-use-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.tar drakx-backup-do-not-use-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.tar.gz drakx-backup-do-not-use-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.tar.bz2 drakx-backup-do-not-use-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.tar.xz drakx-backup-do-not-use-7e252c87d61d61ee1fadf9ce6a494fe444f8c45c.zip |
ensure {lv_name} is set when calling check_mntpoint() from Create() (via check()) (bugzilla #14253)
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r-- | perl-install/lvm.pm | 7 |
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; } |