mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-02 21:14:59 +00:00
pci: do not reserve pci-ids for mediated devices
else a user cannot use more than one mdev per card per host. We do not need to reserve them at all, since sysfs will error out on creation/reuse anyway Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
ce3fbcd456
commit
9c85548fa1
@ -5501,7 +5501,12 @@ sub vm_start_nolock {
|
||||
$pci_devices->{$i} = parse_hostpci($dev);
|
||||
}
|
||||
|
||||
my $pci_id_list = [ map { $_->{id} } map { $_->{pciid}->@* } values $pci_devices->%* ];
|
||||
# do not reserve pciid for mediated devices, sysfs will error out for duplicate assignment
|
||||
my $real_pci_devices = [ grep { !(defined($_->{mdev}) && scalar($_->{pciid}->@*) == 1) } values $pci_devices->%* ];
|
||||
|
||||
# map to a flat list of pci ids
|
||||
my $pci_id_list = [ map { $_->{id} } map { $_->{pciid}->@* } $real_pci_devices->@* ];
|
||||
|
||||
# reserve all PCI IDs before actually doing anything with them
|
||||
PVE::QemuServer::PCI::reserve_pci_usage($pci_id_list, $vmid, $start_timeout);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user