vmm: Make RngConfig owned

Convert Path to PathBuf 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:15:50 +02:00 committed by Rob Bradford
parent 0688bec298
commit 5323da031c

View File

@ -268,14 +268,14 @@ impl NetConfig {
}
}
pub struct RngConfig<'a> {
pub src: &'a Path,
pub struct RngConfig {
pub src: PathBuf,
}
impl<'a> RngConfig<'a> {
pub fn parse(rng: &'a str) -> Result<Self> {
impl RngConfig {
pub fn parse(rng: &str) -> Result<Self> {
Ok(RngConfig {
src: Path::new(rng),
src: PathBuf::from(rng),
})
}
}
@ -615,7 +615,7 @@ pub struct VmConfig<'a> {
pub cmdline: CmdlineConfig,
pub disks: Option<Vec<DiskConfig>>,
pub net: Option<Vec<NetConfig>>,
pub rng: RngConfig<'a>,
pub rng: RngConfig,
pub fs: Option<Vec<FsConfig<'a>>>,
pub pmem: Option<Vec<PmemConfig<'a>>>,
pub serial: ConsoleConfig<'a>,