]> git.proxmox.com Git - pve-manager.git/commitdiff
order guest IDs numerically in exec_backup
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 22 Oct 2020 10:30:14 +0000 (12:30 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 22 Oct 2020 14:29:26 +0000 (16:29 +0200)
The assumption that they already are sorted is no longer valid,
because of the IDs for non-existent guests.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/VZDump.pm

index 83669a840a08a560f201bf1120ac536b5ad8a434..0dfee9a1552c2226fed5d06a789c2132634fde00 100644 (file)
@@ -1073,7 +1073,8 @@ sub exec_backup {
     }
 
     my $vmlist = PVE::Cluster::get_vmlist();
-    foreach my $vmid (@{$opts->{vmids}}) {
+    my $vmids = [ sort { $a <=> $b } @{$opts->{vmids}} ];
+    foreach my $vmid (@{$vmids}) {
        my $plugin;
        if (defined($vmlist->{ids}->{$vmid})) {
            my $guest_type = $vmlist->{ids}->{$vmid}->{type};