mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
net_util: Add multiple queue support for tap
Add support to allow VMMs to open the same tap device many times, it will create multiple file descriptors meanwhile. Signed-off-by: Cathy Zhang <cathy.zhang@intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
cf7e0cdf95
commit
4ab88a8173
@@ -991,7 +991,7 @@ impl DeviceManager {
|
||||
if let Some(net_list_cfg) = &vm_info.vm_cfg.lock().unwrap().net {
|
||||
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)?;
|
||||
let tap = Tap::open_named(tap_if_name, 1).map_err(DeviceManagerError::OpenTap)?;
|
||||
Arc::new(Mutex::new(
|
||||
vm_virtio::Net::new_with_tap(tap, Some(net_cfg.mac), net_cfg.iommu)
|
||||
.map_err(DeviceManagerError::CreateVirtioNet)?,
|
||||
|
||||
Reference in New Issue
Block a user