]> git.proxmox.com Git - qemu-server.git/commitdiff
cfg2cmd: sort PCI bridges when adding them for stabillity
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 9 Oct 2019 05:51:08 +0000 (07:51 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 9 Oct 2019 05:51:13 +0000 (07:51 +0200)
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 <t.lamprecht@proxmox.com>
PVE/QemuServer.pm

index 61d7d12f0798795f2e9098e24c23f10a3a71d9e0..ac9dfdead8bda95751714bbf587d55f049958ccf 100644 (file)
@@ -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;
        }