Skip to content

Commit 3a0b3ad

Browse files
committed
Introduces a separate KVM error variant of HyperlightError.
Fixes a common build error which occurs when the version of vmm-sys-util crate does not match between mshv/kvm. VmmSysError variant is now solely used for our signal registration, and is not used by mshv nor kvm code. Signed-off-by: Ludvig Liljenberg <[email protected]>
1 parent 9ad8569 commit 3a0b3ad

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

Cargo.lock

Lines changed: 17 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/hyperlight_host/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ tracing-log = "0.2.0"
4040
tracing-core = "0.1.34"
4141
hyperlight-common = { workspace = true, default-features = true, features = [ "std" ] }
4242
hyperlight-guest-tracing = { workspace = true, default-features = true, optional = true }
43-
vmm-sys-util = "0.14.0"
43+
vmm-sys-util = "0.15.0"
4444
crossbeam-channel = "0.5.15"
4545
thiserror = "2.0.12"
4646
chrono = { version = "0.4", optional = true }

src/hyperlight_host/src/error.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ pub enum HyperlightError {
138138
#[error("Conversion of str data to json failed")]
139139
JsonConversionFailure(#[from] serde_json::Error),
140140

141+
/// KVM Error Occurred
142+
#[error("KVM Error {0:?}")]
143+
#[cfg(kvm)]
144+
KVMError(#[from] kvm_ioctls::Error),
145+
141146
/// An attempt to get a lock from a Mutex failed.
142147
#[error("Unable to lock resource")]
143148
LockAttemptFailed(String),

src/hyperlight_host/src/hypervisor/hyperv_linux.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -794,9 +794,7 @@ impl Hypervisor for HypervLinuxDriver {
794794
.load(Ordering::Relaxed)
795795
|| debug_interrupt
796796
{
797-
Err(MshvError::Errno(vmm_sys_util::errno::Error::new(
798-
libc::EINTR,
799-
)))
797+
Err(MshvError::from(libc::EINTR))
800798
} else {
801799
#[cfg(feature = "trace_guest")]
802800
if self.trace_info.guest_start_epoch.is_none() {

0 commit comments

Comments
 (0)