vmm: Make DeviceConfig 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:31:41 +02:00
committed by Rob Bradford
parent 36137232f0
commit 5f8a62f3d0
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -451,14 +451,14 @@ impl ConsoleConfig {
}
#[derive(Debug)]
pub struct DeviceConfig<'a> {
pub path: &'a Path,
pub struct DeviceConfig {
pub path: PathBuf,
}
impl<'a> DeviceConfig<'a> {
pub fn parse(device: &'a str) -> Result<Self> {
impl DeviceConfig {
pub fn parse(device: &str) -> Result<Self> {
Ok(DeviceConfig {
path: Path::new(device),
path: PathBuf::from(device),
})
}
}
@@ -620,7 +620,7 @@ pub struct VmConfig<'a> {
pub pmem: Option<Vec<PmemConfig>>,
pub serial: ConsoleConfig,
pub console: ConsoleConfig,
pub devices: Option<Vec<DeviceConfig<'a>>>,
pub devices: Option<Vec<DeviceConfig>>,
pub vhost_user_net: Option<Vec<VhostUserNetConfig<'a>>>,
pub vhost_user_blk: Option<Vec<VhostUserBlkConfig<'a>>>,
pub vsock: Option<Vec<VsockConfig<'a>>>,