]> git.proxmox.com Git - pve-storage.git/commitdiff
nexenta : nexenta_list_zvol : parse base volumes
authorAlexandre Derumier <aderumier@odiso.com>
Tue, 5 Feb 2013 11:56:00 +0000 (12:56 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 14 Feb 2013 09:25:04 +0000 (10:25 +0100)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/Storage.pm
PVE/Storage/NexentaPlugin.pm

index 99aa1f0c24ceada2943cb9a047af2063a606f5b6..36d4cb3ef0636debea3fa5c402e32cbe094d0f7e 100755 (executable)
@@ -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);
     });
 
index 4a5f66d4c617999af66b8a396e9c0cf8dad38463..b24a8e09bd68848ea0e68e1930f595aa73e214ee 100644 (file)
@@ -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
        };