[pve-devel] [PATCH 39/48] lvm: add volume_rename
Alexandre Derumier
aderumier at odiso.com
Tue Jan 29 17:14:21 CET 2013
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/Storage/LVMPlugin.pm | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/PVE/Storage/LVMPlugin.pm b/PVE/Storage/LVMPlugin.pm
index f480fe9..fd0d339 100644
--- a/PVE/Storage/LVMPlugin.pm
+++ b/PVE/Storage/LVMPlugin.pm
@@ -484,4 +484,17 @@ sub volume_clone {
}
+sub volume_rename {
+ my ($class, $scfg, $storeid, $volname, $vmiddest, $type) = @_;
+
+ my $vg = $scfg->{vgname};
+
+ my $targetvolname = $class->find_free_volname($storeid, $scfg, $vmiddest, undef, $type);
+
+ my $cmd = ['/sbin/lvrename', $vg, $volname, $targetvolname];
+ run_command($cmd, errmsg => "lvrename '$vg/$volname' error");
+
+ return $targetvolname;
+}
+
1;
--
1.7.10.4
More information about the pve-devel
mailing list