From 1a259abc18239ce264db19a193f759bd63372555 Mon Sep 17 00:00:00 2001 From: Alexandre Derumier Date: Tue, 5 Feb 2013 12:56:00 +0100 Subject: [PATCH] nexenta : nexenta_list_zvol : parse base volumes Signed-off-by: Alexandre Derumier --- PVE/Storage.pm | 2 -- PVE/Storage/NexentaPlugin.pm | 11 ++++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 99aa1f0..36d4cb3 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -523,7 +523,6 @@ sub vdisk_free { my ($vtype, $name, $vmid, undef, undef, $isBase) = $plugin->parse_volname($volname); - if ($isBase) { my $vollist = $plugin->list_images($storeid, $scfg); foreach my $info (@$vollist) { @@ -542,7 +541,6 @@ sub vdisk_free { } } } - my $cleanup_worker = $plugin->free_image($storeid, $scfg, $volname, $isBase); }); diff --git a/PVE/Storage/NexentaPlugin.pm b/PVE/Storage/NexentaPlugin.pm index 4a5f66d..b24a8e0 100644 --- a/PVE/Storage/NexentaPlugin.pm +++ b/PVE/Storage/NexentaPlugin.pm @@ -109,16 +109,21 @@ sub nexenta_list_zvol { my $pool = $values[0]; my $image = $values[1]; my $owner; - if ($image =~ m/^(vm-(\d+)-\S+)$/) { - $owner = $2; + + if ($image =~ m/^((vm|base)-(\d+)-\S+)$/) { + $owner = $3; } my $props = nexenta_get_zvol_props($scfg, $zvol); + my $parent = $props->{origin}; + if($parent && $parent =~ m/^$scfg->{pool}\/(\S+)$/){ + $parent = $1; + } $list->{$pool}->{$image} = { name => $image, size => $props->{size_bytes}, - parent => $props->{origin}, + parent => $parent, format => 'raw', vmid => $owner };