From: Thomas Lamprecht Date: Wed, 9 Oct 2019 05:51:08 +0000 (+0200) Subject: cfg2cmd: sort PCI bridges when adding them for stabillity X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=311e92935abb5c722be587bde5414125f47d04e7;p=qemu-server.git cfg2cmd: sort PCI bridges when adding them for stabillity In general it matters where a command line options is positioned inside a QEMU command, so we want to actually also check the order in the cfg2cmd test, to do so we need to avoid false positives like this added. Signed-off-by: Thomas Lamprecht --- diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 61d7d12f..ac9dfdea 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -4169,7 +4169,7 @@ sub config_to_command { $bridges->{3} = 1 if $scsihw =~ m/^virtio-scsi-single/; - while (my ($k, $v) = each %$bridges) { + for my $k (sort {$b cmp $a} keys %$bridges) { $pciaddr = print_pci_addr("pci.$k", undef, $arch, $machine_type); unshift @$devices, '-device', "pci-bridge,id=pci.$k,chassis_nr=$k$pciaddr" if $k > 0; }