[pve-devel] [PATCH 37/48] rbd : add volume_rename
Alexandre Derumier
aderumier at odiso.com
Tue Jan 29 17:14:19 CET 2013
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/Storage/RBDPlugin.pm | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index f331bbc..d7305b2 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -425,7 +425,16 @@ sub volume_clone {
return "$volname/$volnamedst";
}
+sub volume_rename {
+ my ($class, $scfg, $storeid, $volname, $vmiddest, $type) = @_;
+ my $targetvolname = $class->find_free_volname($storeid, $scfg, $vmiddest, undef, $type);
+
+ my $cmd = &$rbd_cmd($scfg, $storeid, 'rename', $volname, $targetvolname);
+ run_command($cmd, errmsg => "rbd rename $volname' error", errfunc => sub {});
+
+ return $targetvolname;
+}
1;
--
1.7.10.4
More information about the pve-devel
mailing list