On 4/3/25 11:40, Thomas Lamprecht wrote:
Am 11.03.25 um 14:20 schrieb Dominik Csapak:
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
But that's not true, or? As the check only happens if the $cluster_mapping_cfg
param is passed, which call-sites need to do first?
true, I think the commit message is outdated. I faintly remember changing
the semantic at some point but probably forgot to update the commit message.
# checks if the given config is valid for the current node
sub assert_valid {
- my ($name, $mapping) = @_;
+ my ($name, $mapping, $cluster_mapping_cfg) = @_;
^- new param here
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)) {
guarded witch check for defindness here
+ $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
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel