[pve-devel] [PATCH 16/31] sheepdog : add volume_clone
Alexandre Derumier
aderumier at odiso.com
Tue Jan 22 12:36:14 CET 2013
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/Storage/SheepdogPlugin.pm | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/PVE/Storage/SheepdogPlugin.pm b/PVE/Storage/SheepdogPlugin.pm
index 132b72c..69918b9 100644
--- a/PVE/Storage/SheepdogPlugin.pm
+++ b/PVE/Storage/SheepdogPlugin.pm
@@ -353,4 +353,14 @@ sub volume_protect {
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