From a420842d0173e2a44cd371efdd722af2caa707e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 7 Jan 2020 12:24:13 +0100 Subject: [PATCH] don't (accidentally) modify PVE::Cluster::vmlist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- PVE/Storage/Plugin.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index e826d36..0c39cbd 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -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 {