mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-08 22:05:20 +00:00
vmm: device_manager: Create a virtio-net device from TAP fd
If a TAP fd is supplied then create an virtio-net device using that TAP fd. Fixes: #2052 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
72e5ed3372
commit
7f9cdf1183
@ -1809,6 +1809,18 @@ impl DeviceManager {
|
||||
)
|
||||
.map_err(DeviceManagerError::CreateVirtioNet)?,
|
||||
))
|
||||
} else if let Some(fd) = net_cfg.fd {
|
||||
Arc::new(Mutex::new(
|
||||
virtio_devices::Net::from_tap_fd(
|
||||
id.clone(),
|
||||
fd,
|
||||
Some(net_cfg.mac),
|
||||
net_cfg.iommu,
|
||||
net_cfg.queue_size,
|
||||
self.seccomp_action.clone(),
|
||||
)
|
||||
.map_err(DeviceManagerError::CreateVirtioNet)?,
|
||||
))
|
||||
} else {
|
||||
Arc::new(Mutex::new(
|
||||
virtio_devices::Net::new(
|
||||
|
Loading…
Reference in New Issue
Block a user