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:
Samuel Ortiz
2019-09-23 19:14:35 +02:00
committed by Rob Bradford
parent 675e46355c
commit 0688bec298
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -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)?