From 9bb4abf6a65b8ed2ae39a6739e0bfa35fa876eee Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Thu, 14 Feb 2013 17:27:35 +0100 Subject: [PATCH] lvm : has_feature : copy Signed-off-by: Alexandre Derumier --- PVE/Storage/LVMPlugin.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PVE/Storage/LVMPlugin.pm b/PVE/Storage/LVMPlugin.pm index 25cd310..5c90d83 100644 --- a/PVE/Storage/LVMPlugin.pm +++ b/PVE/Storage/LVMPlugin.pm @@ -453,6 +453,21 @@ sub volume_snapshot_delete { sub volume_has_feature { my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_; + my $features = { + copy => { base => 1, current => 1}, + }; + + my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) = + $class->parse_volname($volname); + + my $key = undef; + if($snapname){ + $key = $snapname + }else{ + $key = $isBase ? 'base' : 'current'; + } + return 1 if $features->{$feature}->{$key}; + return undef; }