mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
committed by
Rob Bradford
parent
36137232f0
commit
5f8a62f3d0
+6
-6
@@ -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>>>,
|
||||
|
||||
Reference in New Issue
Block a user