From: Oguz Bektas Date: Wed, 23 Oct 2019 16:48:27 +0000 (+0200) Subject: iterate pending config changes sorted X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=c10951f722ffc248bb5962901a1b018828168227;p=pve-container.git iterate pending config changes sorted since we sort them while going through the delete hash, we can do it for the other loops for consistency. Signed-off-by: Oguz Bektas --- diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm index d624b0b..fc2f86a 100644 --- a/src/PVE/LXC/Config.pm +++ b/src/PVE/LXC/Config.pm @@ -930,7 +930,7 @@ sub update_pct_config { if !$storage_config->{content}->{rootdir}; }; - foreach my $opt (keys %$param) { # add/change + foreach my $opt (sort keys %$param) { # add/change $modified->{$opt} = 1; my $value = $param->{$opt}; if ($opt =~ m/^mp(\d+)$/ || $opt eq 'rootfs') { @@ -1121,7 +1121,7 @@ sub vmconfig_hotplug_pending { }; my $changes; - foreach my $opt (keys %{$conf->{pending}}) { # add/change + foreach my $opt (sort keys %{$conf->{pending}}) { # add/change next if $selection && !$selection->{$opt}; if ($LXC_FASTPLUG_OPTIONS->{$opt}) { $conf->{$opt} = delete $conf->{pending}->{$opt}; @@ -1197,7 +1197,7 @@ sub vmconfig_hotplug_pending { } } - foreach my $opt (keys %{$conf->{pending}}) { + foreach my $opt (sort keys %{$conf->{pending}}) { next if $opt eq 'delete'; # just to be sure next if $selection && !$selection->{$opt}; my $value = $conf->{pending}->{$opt}; @@ -1274,7 +1274,7 @@ sub vmconfig_apply_pending { } } - foreach my $opt (keys %{$conf->{pending}}) { # add/change + foreach my $opt (sort keys %{$conf->{pending}}) { # add/change next if $opt eq 'delete'; # just to be sure next if $selection && !$selection->{$opt}; eval {