From 767132f72ae66bcebe030f6a5816997c37c9cf2f Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Thu, 27 Dec 2012 16:07:17 +0100 Subject: [PATCH] nexenta: has_feature Signed-off-by: Alexandre Derumier --- PVE/Storage/NexentaPlugin.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm index 386656f..9622548 100644 --- a/PVE/Storage/NexentaPlugin.pm +++ b/PVE/Storage/NexentaPlugin.pm @@ -380,4 +380,18 @@ sub volume_snapshot_delete { nexenta_request($scfg, 'destroy', 'snapshot', "$scfg->{pool}/$volname\@$snap", ''); } +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;