[pve-devel] [PATCH 17/21] rbd : add volume_snapshot_delete

Alexandre Derumier aderumier at odiso.com
Thu Sep 6 10:28:07 CEST 2012


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

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 277d1e8..6d1d741 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -295,4 +295,14 @@ sub volume_snapshot_rollback {
     run_command($cmd, errmsg => "rbd snapshot $volname to $snap' error", errfunc => sub {});
 }
 
+sub volume_snapshot_delete {
+    my ($class, $scfg, $storeid, $volname, $snap, $running) = @_;
+
+    return 1 if $running;
+
+    my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'rm', '--snap', $snap, $volname);
+    run_command($cmd, errmsg => "rbd snapshot $volname' error", errfunc => sub {});
+    return undef;
+}
+
 1;
-- 
1.7.2.5




More information about the pve-devel mailing list