mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-05 20:36:20 +00:00
fix #1405: sort pci ids by functions
QemuServer::lspci() iterates over /sys/bus/pci/devices which doesn't guarantee any order which means functions sometimes ended up in the wrong order and it was never clear which one would get the additional options such as x-vga passed to them.
This commit is contained in:
parent
ba5acf88a1
commit
5ee3847149
@ -6304,6 +6304,12 @@ sub lspci {
|
||||
push @{$devices->{$id}}, $res;
|
||||
});
|
||||
|
||||
# Entries should be sorted by functions.
|
||||
foreach my $id (keys %$devices) {
|
||||
my $dev = $devices->{$id};
|
||||
$devices->{$id} = [ sort { $a->{function} <=> $b->{function} } @$dev ];
|
||||
}
|
||||
|
||||
return $devices;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user