mapping: pci: check the mdev configuration on the device too

but that lives int he 'global' part of the mapping config, not in a
specific mapping. To check that, add it to the $configured_props from
there.

this requires all call sites to be adapted otherwise the check will
always fail for devices that are capable of mediated devices

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-by: Christoph Heiss <c.heiss@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Christoph Heiss <c.heiss@proxmox.com>
This commit is contained in:
Dominik Csapak 2025-03-11 14:20:39 +01:00 committed by Thomas Lamprecht
parent ea022f01c3
commit 57cd454c42

View File

@ -131,7 +131,7 @@ sub options {
# checks if the given config is valid for the current node
sub assert_valid {
my ($name, $mapping) = @_;
my ($name, $mapping, $cluster_mapping_cfg) = @_;
my @paths = split(';', $mapping->{path} // '');
@ -161,6 +161,12 @@ sub assert_valid {
my $configured_props = { $mapping->%{qw(id iommugroup subsystem-id)} };
# check mdev from globabl mapping config, if that is given
if (defined($cluster_mapping_cfg)) {
$expected_props->{mdev} = $info->{mdev} ? 1 : 0;
$configured_props->{mdev} = $cluster_mapping_cfg->{mdev} ? 1 : 0;
}
for my $prop (sort keys $expected_props->%*) {
next if $prop eq 'iommugroup' && $idx > 0; # check iommu only on the first device