From 4d4f734eea9654f02ec5d37e181ba556c7619c64 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Wed, 21 Nov 2012 18:11:32 +0100 Subject: [PATCH] nexenta: retrieve parent of a clone Signed-off-by: Alexandre Derumier --- PVE/Storage/NexentaPlugin.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm index a5b6fe2..386656f 100644 --- a/PVE/Storage/NexentaPlugin.pm +++ b/PVE/Storage/NexentaPlugin.pm @@ -45,6 +45,13 @@ sub nexenta_get_zvol_size { return nexenta_request($scfg, 'get_child_prop', 'zvol', $zvol, 'size_bytes'); } +sub nexenta_get_zvol_props { + my ($scfg, $zvol) = @_; + + my $props = nexenta_request($scfg, 'get_child_props', 'zvol', $zvol, ''); + return $props; +} + sub nexenta_list_lun_mapping_entries { my ($scfg, $zvol) = @_; @@ -106,9 +113,12 @@ sub nexenta_list_zvol { $owner = $2; } + my $props = nexenta_get_zvol_props($scfg, $zvol); + $list->{$pool}->{$image} = { name => $image, - size => nexenta_get_zvol_size($scfg, $zvol), + size => $props->{size_bytes}, + parent => $props->{origin}, format => 'raw', vmid => $owner };