[pve-devel] [PATCH 16/20] sheepdog : add volume_clone
Alexandre Derumier
aderumier at odiso.com
Wed Dec 12 13:54:59 CET 2012
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 651b270..bc78e9e 100644
--- a/PVE/Storage/SheepdogPlugin.pm
+++ b/PVE/Storage/SheepdogPlugin.pm
@@ -339,4 +339,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