From f4cc2c4afe950d79d0e19ab4456071df5e4758a8 Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Thu, 13 Sep 2018 20:36:40 +0200 Subject: [PATCH] Fix #1913: get_vm_disk_number: clone plugindata to avoid side effects Accessing a non-existing 'format' key in plugindata (e.g., in LvmThinPlugin), created it by autovivication, thus breaking the fallback to the default value 'raw' upon any following access. Signed-off-by: Stoiko Ivanov --- PVE/Storage/Plugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/Storage/Plugin.pm b/PVE/Storage/Plugin.pm index da91bdc..aefc7f8 100644 --- a/PVE/Storage/Plugin.pm +++ b/PVE/Storage/Plugin.pm @@ -529,7 +529,7 @@ my $get_vm_disk_number = sub { my ($disk_name, $scfg, $vmid, $suffix) = @_; my $type = $scfg->{type}; - my $def = $defaultData->{plugindata}->{$type}; + my $def = { %{$defaultData->{plugindata}->{$type}} }; my $valid_formats = $def->{format}[0]; my $disk_regex = qr/(vm|base)-$vmid-disk-(\d+)$suffix/;