Skip to content

Commit

Permalink
Ensure iommu XML is only set for virtio nics (vagrant-libvirt#1690)
Browse files Browse the repository at this point in the history
Skip setting iommu option on the drive unless it's for virtio model type
nics.

Fixes: vagrant-libvirt#1688
  • Loading branch information
electrofelix authored Dec 4, 2022
1 parent 5f324e9 commit e0b17b3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/vagrant-libvirt/action/create_network_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def call(env)
# FIXME: all options for network driver should be hash from Vagrantfile
driver_options = {}
driver_options[:name] = @driver_name if @driver_name
driver_options[:iommu] = @driver_iommu ? "on" : "off"
driver_options[:iommu] = @driver_iommu ? "on" : "off" if @nic_model_type == 'virtio'
driver_options[:queues] = @driver_queues if @driver_queues

@udp_tunnel ||= {}
Expand Down Expand Up @@ -271,10 +271,9 @@ def interface_xml(type, source_options, mac, device_name,

xml.mac(address: mac) if mac
xml.target(dev: target_dev_name(device_name, type, iface_number))
xml.alias(name: "net#{iface_number}")
xml.model(type: model_type.to_s)
xml.mtu(size: Integer(mtu)) if mtu
xml.driver(**driver_options)
xml.driver(**driver_options) if driver_options
xml.address(type: 'pci', bus: pci_bus, slot: pci_slot) if pci_bus and pci_slot
end
end.to_xml(
Expand Down

0 comments on commit e0b17b3

Please sign in to comment.