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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-10-09 07:51:08 +02:00
parent 4d316a63c7
commit 311e92935a

View 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;
}