From 286a23fbd44e5f784b0276cad37e79f2561e88d5 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Thu, 3 Dec 2020 23:03:51 -0800 Subject: [PATCH] hypervisor: mshv: Add vmmops to MshvVm struct vmmops trait object is needed to get access some of the upper level vmm functionalities i.e guest memory access, IO read write etc. Co-Developed-by: Praveen Paladugu Signed-off-by: Praveen Paladugu Signed-off-by: Muminul Islam --- hypervisor/src/mshv/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hypervisor/src/mshv/mod.rs b/hypervisor/src/mshv/mod.rs index c5f2f5f1a..7d48f5679 100644 --- a/hypervisor/src/mshv/mod.rs +++ b/hypervisor/src/mshv/mod.rs @@ -112,6 +112,7 @@ impl hypervisor::Hypervisor for MshvHypervisor { fd: vm_fd, msrs, hv_state: hv_state_init(), + vmmops: None, })) } /// @@ -138,6 +139,7 @@ pub struct MshvVcpu { cpuid: CpuId, msrs: MsrEntries, hv_state: Arc>, // Mshv State + vmmops: Option>>, } /// Implementation of Vcpu trait for Microsoft Hypervisor @@ -339,6 +341,7 @@ pub struct MshvVm { msrs: MsrEntries, // Hypervisor State hv_state: Arc>, + vmmops: Option>>, } fn hv_state_init() -> Arc> { @@ -400,6 +403,7 @@ impl vm::Vm for MshvVm { cpuid: CpuId::new(1 as usize), msrs: self.msrs.clone(), hv_state: self.hv_state.clone(), + vmmops, }; Ok(Arc::new(vcpu)) }