From eb0021502a5164a588ff051f8a440ff5364ea76c Mon Sep 17 00:00:00 2001 From: Aaron Lauterer Date: Tue, 4 Aug 2020 11:46:38 +0200 Subject: [PATCH] backup: fix #2913 order jobs numerically by VMID At this point, the VMIDs are already numerically sorted by the PVE::VZDump::check_vmids method. Calling another sort on the array, especially without `{$a <=> $b}`, resulted in reordering the array alphabetically. Signed-off-by: Aaron Lauterer --- PVE/VZDump.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm index 82976aa4..66a20c8c 100644 --- a/PVE/VZDump.pm +++ b/PVE/VZDump.pm @@ -1048,7 +1048,7 @@ sub exec_backup { } my $vmlist = PVE::Cluster::get_vmlist(); - foreach my $vmid (sort @{$opts->{vmids}}) { + foreach my $vmid (@{$opts->{vmids}}) { my $guest_type = $vmlist->{ids}->{$vmid}->{type}; my $plugin = $vzdump_plugins->{$guest_type}; next if !$rpcenv->check($authuser, "/vms/$vmid", [ 'VM.Backup' ], $opts->{all});