hypervisor: mshv: Add VmFd to MshvVcpu struct

This would be required later to implement few additional operations on
top of it.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
This commit is contained in:
Jinank Jain 2023-10-19 13:16:54 +00:00 committed by Bo Chen
parent a69d8c63b3
commit 96bc282759

View File

@ -338,6 +338,8 @@ pub struct MshvVcpu {
cpuid: Vec<CpuIdEntry>,
msrs: Vec<MsrEntry>,
vm_ops: Option<Arc<dyn vm::VmOps>>,
#[cfg(feature = "sev_snp")]
vm_fd: Arc<VmFd>,
}
/// Implementation of Vcpu trait for Microsoft Hypervisor
@ -1435,6 +1437,8 @@ impl vm::Vm for MshvVm {
cpuid: Vec::new(),
msrs: self.msrs.clone(),
vm_ops,
#[cfg(feature = "sev_snp")]
vm_fd: self.fd.clone(),
};
Ok(Arc::new(vcpu))
}