Fix issue where "iommu" was configured for non-virtio network devices (#1702)

When setting the `model_type` of a network to something else than
`virtio`, the `iommu` parameter was still set for the device which isn't
allowed.

The if-statement for setting the parameter was looking at the default NIC
model type (in `@nic_model_type`) instead of final, configured value in `@model_type`.
This commit is contained in:
Arjen Verstoep
2023-01-19 15:29:55 +00:00
committed by GitHub
parent d4520bedb5
commit 98e674d270

View File

@@ -150,7 +150,7 @@ module VagrantPlugins
# FIXME: all options for network driver should be hash from Vagrantfile # FIXME: all options for network driver should be hash from Vagrantfile
driver_options = {} driver_options = {}
driver_options[:name] = @driver_name if @driver_name driver_options[:name] = @driver_name if @driver_name
driver_options[:iommu] = @driver_iommu ? "on" : "off" if @nic_model_type == 'virtio' driver_options[:iommu] = @driver_iommu ? "on" : "off" if @model_type == 'virtio'
driver_options[:queues] = @driver_queues if @driver_queues driver_options[:queues] = @driver_queues if @driver_queues
@udp_tunnel ||= {} @udp_tunnel ||= {}