diff --git a/vmm/src/config.rs b/vmm/src/config.rs index a8f523679..37aee2cae 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -281,16 +281,16 @@ impl RngConfig { } #[derive(Debug)] -pub struct FsConfig<'a> { - pub tag: &'a str, - pub sock: &'a Path, +pub struct FsConfig { + pub tag: String, + pub sock: PathBuf, pub num_queues: usize, pub queue_size: u16, pub cache_size: Option, } -impl<'a> FsConfig<'a> { - pub fn parse(fs: &'a str) -> Result { +impl FsConfig { + pub fn parse(fs: &str) -> Result { // Split the parameters based on the comma delimiter let params_list: Vec<&str> = fs.split(',').collect(); @@ -359,8 +359,8 @@ impl<'a> FsConfig<'a> { } Ok(FsConfig { - tag, - sock: Path::new(sock), + tag: tag.to_string(), + sock: PathBuf::from(sock), num_queues, queue_size, cache_size, @@ -616,7 +616,7 @@ pub struct VmConfig<'a> { pub disks: Option>, pub net: Option>, pub rng: RngConfig, - pub fs: Option>>, + pub fs: Option>, pub pmem: Option>>, pub serial: ConsoleConfig<'a>, pub console: ConsoleConfig<'a>, diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 65322dfbb..82e2c95d1 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -676,7 +676,7 @@ impl DeviceManager { let virtio_fs_device = vm_virtio::vhost_user::Fs::new( fs_sock, - fs_cfg.tag, + &fs_cfg.tag, fs_cfg.num_queues, fs_cfg.queue_size, cache,