mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Make NetConfig owned
Convert str to String and remove the associated lifetime. Fixes #298 Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
675e46355c
commit
0688bec298
@@ -576,7 +576,7 @@ impl DeviceManager {
|
||||
// Add virtio-net if required
|
||||
if let Some(net_list_cfg) = &vm_info.vm_cfg.net {
|
||||
for net_cfg in net_list_cfg.iter() {
|
||||
let virtio_net_device = if let Some(tap_if_name) = net_cfg.tap {
|
||||
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))
|
||||
.map_err(DeviceManagerError::CreateVirtioNet)?
|
||||
|
||||
Reference in New Issue
Block a user