]> git.proxmox.com Git - pve-storage.git/commitdiff
don't (accidentally) modify PVE::Cluster::vmlist
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 7 Jan 2020 11:24:13 +0000 (12:24 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 8 Jan 2020 11:01:10 +0000 (12:01 +0100)
when listing volumes, otherwise an empty hash can be persisted into the
current worker's $vmlist, which could cause issues at various other API
endpoints.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/Storage/Plugin.pm

index e826d36131ede8eaad9b643b8cbf475f27b44f70..0c39cbd6d3f4de2f40a4a2994d910fbbf745fa8b 100644 (file)
@@ -958,8 +958,11 @@ sub list_volumes {
 
        foreach my $item (@$data) {
            if ($type eq 'images' || $type eq 'rootdir') {
-
-               my $vmtype = $vmlist->{ids}->{$item->{vmid}}->{type};
+               my $vminfo = $vmlist->{ids}->{$item->{vmid}};
+               my $vmtype;
+               if (defined($vminfo)) {
+                   $vmtype = $vminfo->{type};
+               }
                if (defined($vmtype) && $vmtype eq 'lxc') {
                    $item->{content} = 'rootdir';
                } else {