vm-virtio: Add IOMMU support to virtio-net

Adding virtio feature VIRTIO_F_IOMMU_PLATFORM when explicitly asked by
the user. The need for this feature is to be able to attach the virtio
device to a virtual IOMMU.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-10-02 14:26:02 -07:00
committed by Samuel Ortiz
parent 9ebb1a55bc
commit 9fad680db1
2 changed files with 14 additions and 5 deletions

View File

@@ -612,10 +612,10 @@ impl DeviceManager {
for net_cfg in net_list_cfg.iter() {
let virtio_net_device = if let Some(ref tap_if_name) = net_cfg.tap {
let tap = Tap::open_named(tap_if_name).map_err(DeviceManagerError::OpenTap)?;
vm_virtio::Net::new_with_tap(tap, Some(&net_cfg.mac))
vm_virtio::Net::new_with_tap(tap, Some(&net_cfg.mac), false)
.map_err(DeviceManagerError::CreateVirtioNet)?
} else {
vm_virtio::Net::new(net_cfg.ip, net_cfg.mask, Some(&net_cfg.mac))
vm_virtio::Net::new(net_cfg.ip, net_cfg.mask, Some(&net_cfg.mac), false)
.map_err(DeviceManagerError::CreateVirtioNet)?
};