From 036890e5bea7987bbb3d6e900251b09eba70775d Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 23 Sep 2019 18:54:00 +0200 Subject: [PATCH] vmm: Make KernelConfig owned Convert Path to PathBuf and remove the associated lifetime. Fixes #298 Signed-off-by: Samuel Ortiz --- vmm/src/config.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 8f4ac0138..eabd877fd 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -172,14 +172,14 @@ impl MemoryConfig { } } -pub struct KernelConfig<'a> { - pub path: &'a Path, +pub struct KernelConfig { + pub path: PathBuf, } -impl<'a> KernelConfig<'a> { - pub fn parse(kernel: &'a str) -> Result { +impl KernelConfig { + pub fn parse(kernel: &str) -> Result { Ok(KernelConfig { - path: Path::new(kernel), + path: PathBuf::from(kernel), }) } } @@ -611,7 +611,7 @@ impl<'a> VhostUserBlkConfig<'a> { pub struct VmConfig<'a> { pub cpus: CpusConfig, pub memory: MemoryConfig, - pub kernel: KernelConfig<'a>, + pub kernel: KernelConfig, pub cmdline: CmdlineConfig, pub disks: Option>>, pub net: Option>>,