[pve-devel] [PATCH 38/44] nexenta : has_feature : clone base
Alexandre Derumier
aderumier at odiso.com
Thu Feb 14 11:05:11 CET 2013
Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
PVE/Storage/NexentaPlugin.pm | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm
index 77b199d..ece0c13 100644
--- a/PVE/Storage/NexentaPlugin.pm
+++ b/PVE/Storage/NexentaPlugin.pm
@@ -462,12 +462,20 @@ sub volume_has_feature {
my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_;
my $features = {
- snapshot => { current => 1, snap => 1},
- clone => { snap => 1},
+ snapshot => { current => 1, snap => 1},
+ clone => { base => 1},
};
- my $snap = $snapname ? 'snap' : 'current';
- return 1 if $features->{$feature}->{$snap};
+ 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;
}
--
1.7.10.4
More information about the pve-devel
mailing list