From 774f21b9eec55e6e6aa0a151f4e693704d9e2228 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Thu, 27 Dec 2012 16:07:15 +0100 Subject: [PATCH] rbd : has_feature Signed-off-by: Alexandre Derumier --- PVE/Storage/RBDPlugin.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm index 60bd4e8..bbfae7c 100644 --- a/PVE/Storage/RBDPlugin.pm +++ b/PVE/Storage/RBDPlugin.pm @@ -352,4 +352,18 @@ sub volume_snapshot_delete { return undef; } +sub volume_has_feature { + my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_; + + my $features = { + snapshot => { current => 1, snap => 1}, + clone => { snap => 1}, + }; + + my $snap = $snapname ? 'snap' : 'current'; + return 1 if $features->{$feature}->{$snap}; + + return undef; +} + 1;