mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-01 11:05:46 +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)?,
|
.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 {
|
} else {
|
||||||
Arc::new(Mutex::new(
|
Arc::new(Mutex::new(
|
||||||
virtio_devices::Net::new(
|
virtio_devices::Net::new(
|
||||||
|
Loading…
Reference in New Issue
Block a user