Skip to content

Commit e3a5fcf

Browse files
praveen-pkCopilot
andauthored
virt_mshv: init vm after creation (#2059)
To configure custom VM features during VM creation, the create and initialize steps have been broken up in mshv-ioctls, starting with: 1afa433 mshv-ioctls: Don't initialize partition after creation So, any uses of v0.5.0 and newer versions of mshv-ioctls should explicitly initialize the vm after creation. --------- Signed-off-by: Praveen K Paladugu <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent bc0356c commit e3a5fcf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vmm_core/virt_mshv/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ impl virt::Hypervisor for LinuxMshv {
138138
break;
139139
}
140140

141+
vmfd.initialize()
142+
.map_err(|e| Error::CreateVMInitFailed(e.into()))?;
143+
141144
// Create virtual CPUs.
142145
let mut vps: Vec<MshvVpInner> = Vec::new();
143146
for vp in config.processor_topology.vps_arch() {
@@ -1076,6 +1079,8 @@ pub enum Error {
10761079
NotSupported,
10771080
#[error("create_vm failed")]
10781081
CreateVMFailed,
1082+
#[error("failed to initialize VM")]
1083+
CreateVMInitFailed(#[source] anyhow::Error),
10791084
#[error("failed to create VCPU")]
10801085
CreateVcpu(#[source] MshvError),
10811086
#[error("vtl2 not supported")]

0 commit comments

Comments
 (0)