[pve-devel] [PATCH 15/31] rbd: add volume_clone

Alexandre Derumier aderumier at odiso.com
Tue Jan 8 15:45:21 CET 2013


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Storage/RBDPlugin.pm |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 003585a..f247376 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -402,6 +402,18 @@ sub volume_protect {
     }
 }
 
+sub volume_clone {
+    my ($class, $scfg, $storeid, $volname, $snap, $vmid) = @_;
+
+    my $volnamedst = $class->find_free_volname($storeid, $scfg, $vmid);
+
+    my $cmd = &$rbd_cmd($scfg, $storeid, 'clone', $volname, '--snap', $snap, $volnamedst);
+    run_command($cmd, errmsg => "rbd clone $volname' error", errfunc => sub {});
+
+    return $volnamedst;
+}
+
+
 
 
 1;
-- 
1.7.10.4




More information about the pve-devel mailing list