[pve-devel] [PATCH 16/20] sheepdog: add volume_clone

Alexandre Derumier aderumier at odiso.com
Mon Dec 3 14:32:41 CET 2012


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

diff --git a/PVE/Storage/SheepdogPlugin.pm b/PVE/Storage/SheepdogPlugin.pm
index e9f2675..ffeb384 100644
--- a/PVE/Storage/SheepdogPlugin.pm
+++ b/PVE/Storage/SheepdogPlugin.pm
@@ -345,4 +345,15 @@ sub volume_unprotect {
     return undef;
 }
 
+sub volume_clone {
+    my ($class, $scfg, $storeid, $volname, $snap, $vmid) = @_;
+
+    my $volnamedst = $class->find_free_volname($storeid, $scfg, $vmid);
+
+    my $cmd = &$collie_cmd($scfg, 'vdi', 'clone', '-s', $snap, $volname, $volnamedst);
+    run_command($cmd, errmsg => "sheepdog clone $volname' error");
+
+    return $volnamedst;
+}
+
 1;
-- 
1.7.10.4




More information about the pve-devel mailing list