mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Make VsockConfig owned
Convert Path to PathBuf and remove the associated lifetime. Now we can remove the VmConfig associated lifetime. Fixes #298 Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
committed by
Rob Bradford
parent
3dc7aff00e
commit
acc60b0ad5
@@ -426,7 +426,7 @@ impl Vcpu {
|
||||
pub struct VmInfo<'a> {
|
||||
pub memory: &'a Arc<RwLock<GuestMemoryMmap>>,
|
||||
pub vm_fd: &'a Arc<VmFd>,
|
||||
pub vm_cfg: &'a VmConfig<'a>,
|
||||
pub vm_cfg: &'a VmConfig,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq)]
|
||||
@@ -507,7 +507,7 @@ pub struct Vm<'a> {
|
||||
threads: Vec<thread::JoinHandle<()>>,
|
||||
devices: DeviceManager,
|
||||
cpuid: CpuId,
|
||||
config: &'a VmConfig<'a>,
|
||||
config: &'a VmConfig,
|
||||
epoll: EpollContext,
|
||||
on_tty: bool,
|
||||
creation_ts: std::time::Instant,
|
||||
@@ -533,7 +533,7 @@ fn get_host_cpu_phys_bits() -> u8 {
|
||||
}
|
||||
|
||||
impl<'a> Vm<'a> {
|
||||
pub fn new(kvm: &Kvm, config: &'a VmConfig<'a>) -> Result<Self> {
|
||||
pub fn new(kvm: &Kvm, config: &'a VmConfig) -> Result<Self> {
|
||||
let kernel = File::open(&config.kernel.path).map_err(Error::KernelFile)?;
|
||||
let fd = kvm.create_vm().map_err(Error::VmCreate)?;
|
||||
let fd = Arc::new(fd);
|
||||
|
||||
Reference in New Issue
Block a user