diff --git a/hypervisor/src/arch/aarch64/gic.rs b/hypervisor/src/arch/aarch64/gic.rs index 9e2b39bb1..33c10db49 100644 --- a/hypervisor/src/arch/aarch64/gic.rs +++ b/hypervisor/src/arch/aarch64/gic.rs @@ -17,13 +17,13 @@ use crate::{CpuState, HypervisorDeviceError, HypervisorVmError}; pub enum Error { /// Error while calling KVM ioctl for setting up the global interrupt controller. #[error("Failed creating GIC device: {0}")] - CreateGic(HypervisorVmError), + CreateGic(#[source] HypervisorVmError), /// Error while setting device attributes for the GIC. #[error("Failed setting device attributes for the GIC: {0}")] - SetDeviceAttribute(HypervisorDeviceError), + SetDeviceAttribute(#[source] HypervisorDeviceError), /// Error while getting device attributes for the GIC. #[error("Failed getting device attributes for the GIC: {0}")] - GetDeviceAttribute(HypervisorDeviceError), + GetDeviceAttribute(#[source] HypervisorDeviceError), } pub type Result = result::Result; diff --git a/hypervisor/src/arch/emulator/mod.rs b/hypervisor/src/arch/emulator/mod.rs index e62d5f636..a858346de 100644 --- a/hypervisor/src/arch/emulator/mod.rs +++ b/hypervisor/src/arch/emulator/mod.rs @@ -82,13 +82,13 @@ pub enum EmulationError { WrongNumberOperands(#[source] anyhow::Error), #[error("Instruction Exception: {0}")] - InstructionException(Exception), + InstructionException(#[source] Exception), #[error("Instruction fetching error: {0}")] InstructionFetchingError(#[source] anyhow::Error), #[error("Platform emulation error: {0}")] - PlatformEmulationError(PlatformError), + PlatformEmulationError(#[source] PlatformError), #[error(transparent)] EmulationError(#[from] anyhow::Error), diff --git a/hypervisor/src/arch/riscv64/aia.rs b/hypervisor/src/arch/riscv64/aia.rs index bf8181553..cf0a68f6e 100644 --- a/hypervisor/src/arch/riscv64/aia.rs +++ b/hypervisor/src/arch/riscv64/aia.rs @@ -14,13 +14,13 @@ use crate::{AiaState, HypervisorDeviceError, HypervisorVmError}; pub enum Error { /// Error while calling KVM ioctl for setting up the global interrupt controller. #[error("Failed creating AIA device: {0}")] - CreateAia(HypervisorVmError), + CreateAia(#[source] HypervisorVmError), /// Error while setting device attributes for the AIA. #[error("Failed setting device attributes for the AIA: {0}")] - SetDeviceAttribute(HypervisorDeviceError), + SetDeviceAttribute(#[source] HypervisorDeviceError), /// Error while getting device attributes for the AIA. #[error("Failed getting device attributes for the AIA: {0}")] - GetDeviceAttribute(HypervisorDeviceError), + GetDeviceAttribute(#[source] HypervisorDeviceError), } pub type Result = result::Result; diff --git a/hypervisor/src/hypervisor.rs b/hypervisor/src/hypervisor.rs index 001140a3b..6797ace99 100644 --- a/hypervisor/src/hypervisor.rs +++ b/hypervisor/src/hypervisor.rs @@ -67,22 +67,22 @@ pub enum HypervisorError { /// /// Checking extensions failed /// - #[error("Checking extensions:{0}")] + #[error("Checking extensions: {0}")] CheckExtensions(#[source] anyhow::Error), /// /// Failed to retrieve TDX capabilities /// - #[error("Failed to retrieve TDX capabilities:{0}")] + #[error("Failed to retrieve TDX capabilities: {0}")] TdxCapabilities(#[source] anyhow::Error), /// /// Failed to set partition property /// - #[error("Failed to set partition property:{0}")] + #[error("Failed to set partition property: {0}")] SetPartitionProperty(#[source] anyhow::Error), /// /// Running on an unsupported CPU /// - #[error("Unsupported CPU:{0}")] + #[error("Unsupported CPU: {0}")] UnsupportedCpu(#[source] anyhow::Error), /// /// Launching a VM with unsupported VM Type