Skip to content

Commit 7220a78

Browse files
praveen-pkCopilot
andcommitted
Update vmm_core/virt_mshv/src/lib.rs
Co-authored-by: Copilot <[email protected]> Signed-off-by: Praveen K Paladugu <[email protected]>
1 parent 24e7737 commit 7220a78

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

vmm_core/virt_mshv/src/lib.rs

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

141-
match vmfd.initialize() {
142-
Ok(()) => {}
143-
Err(_) => {
144-
return Err(Error::CreateVMFailed);
145-
}
146-
}
141+
vmfd.initialize()
142+
.map_err(|e| Error::CreateVMInitFailed(e.into()))?;
147143

148144
// Create virtual CPUs.
149145
let mut vps: Vec<MshvVpInner> = Vec::new();
@@ -1083,6 +1079,8 @@ pub enum Error {
10831079
NotSupported,
10841080
#[error("create_vm failed")]
10851081
CreateVMFailed,
1082+
#[error("failed to initialize VM")]
1083+
CreateVMInitFailed(#[source] anyhow::Error),
10861084
#[error("failed to create VCPU")]
10871085
CreateVcpu(#[source] MshvError),
10881086
#[error("vtl2 not supported")]

0 commit comments

Comments
 (0)