summaryrefslogtreecommitdiffstats
path: root/perl-install/lvm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-19 14:57:17 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-19 14:57:17 +0000
commit11b0e9fe0e06fc002cbb4df903dba1541fb88019 (patch)
treea65d1d60a01c99cd11e8118706abeb36906fc748 /perl-install/lvm.pm
parent826763e26b59688ccbb0a5adc5a5e46a32fe532d (diff)
downloaddrakx-11b0e9fe0e06fc002cbb4df903dba1541fb88019.tar
drakx-11b0e9fe0e06fc002cbb4df903dba1541fb88019.tar.gz
drakx-11b0e9fe0e06fc002cbb4df903dba1541fb88019.tar.bz2
drakx-11b0e9fe0e06fc002cbb4df903dba1541fb88019.tar.xz
drakx-11b0e9fe0e06fc002cbb4df903dba1541fb88019.zip
create partition_table_initialize() and partition_table_clear_and_initialize()
which are wrappers around partition_table::initialize() but which also create a singleton VG automatically (so that it's easier for the user)
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r--perl-install/lvm.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm
index decdfb376..e08d382d2 100644
--- a/perl-install/lvm.pm
+++ b/perl-install/lvm.pm
@@ -204,4 +204,16 @@ sub add_to_VG {
lvm::update_size($lvm);
}
+sub create_singleton_vg {
+ my ($lvms, $part) = @_;
+
+ my %existing = map { $_->{VG_name} => 1 } @$lvms;
+ my $VG_name = find { !$existing{$_} } map { "VG$_" } 1 .. 100 or internal_error();
+
+ my $lvm = new lvm($VG_name);
+ push @$lvms, $lvm;
+
+ add_to_VG($part, $lvm);
+}
+
1;