mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: hypervisor: streamline error Display::fmt()
The changes were mostly automatically applied using the Python script mentioned in the first commit of this series. Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Rob Bradford
parent
1b91aa8ef3
commit
72c8178335
@@ -16,13 +16,13 @@ use crate::{CpuState, HypervisorDeviceError, HypervisorVmError};
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
/// Error while calling KVM ioctl for setting up the global interrupt controller.
|
||||
#[error("Failed creating GIC device: {0}")]
|
||||
#[error("Failed creating GIC device")]
|
||||
CreateGic(#[source] HypervisorVmError),
|
||||
/// Error while setting device attributes for the GIC.
|
||||
#[error("Failed setting device attributes for the GIC: {0}")]
|
||||
#[error("Failed setting device attributes for the GIC")]
|
||||
SetDeviceAttribute(#[source] HypervisorDeviceError),
|
||||
/// Error while getting device attributes for the GIC.
|
||||
#[error("Failed getting device attributes for the GIC: {0}")]
|
||||
#[error("Failed getting device attributes for the GIC")]
|
||||
GetDeviceAttribute(#[source] HypervisorDeviceError),
|
||||
}
|
||||
pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
@@ -36,58 +36,58 @@ impl<T: Debug> Display for Exception<T> {
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum PlatformError {
|
||||
#[error("Invalid address: {0}")]
|
||||
#[error("Invalid address")]
|
||||
InvalidAddress(#[source] anyhow::Error),
|
||||
|
||||
#[error("Invalid register: {0}")]
|
||||
#[error("Invalid register")]
|
||||
InvalidRegister(#[source] anyhow::Error),
|
||||
|
||||
#[error("Invalid state: {0}")]
|
||||
#[error("Invalid state")]
|
||||
InvalidState(#[source] anyhow::Error),
|
||||
|
||||
#[error("Memory read failure: {0}")]
|
||||
#[error("Memory read failure")]
|
||||
MemoryReadFailure(#[source] anyhow::Error),
|
||||
|
||||
#[error("Memory write failure: {0}")]
|
||||
#[error("Memory write failure")]
|
||||
MemoryWriteFailure(#[source] anyhow::Error),
|
||||
|
||||
#[error("Get CPU state failure: {0}")]
|
||||
#[error("Get CPU state failure")]
|
||||
GetCpuStateFailure(#[source] anyhow::Error),
|
||||
|
||||
#[error("Set CPU state failure: {0}")]
|
||||
#[error("Set CPU state failure")]
|
||||
SetCpuStateFailure(#[source] anyhow::Error),
|
||||
|
||||
#[error("Translate virtual address: {0}")]
|
||||
#[error("Translate virtual address")]
|
||||
TranslateVirtualAddress(#[source] anyhow::Error),
|
||||
|
||||
#[error("Unsupported CPU Mode: {0}")]
|
||||
#[error("Unsupported CPU Mode")]
|
||||
UnsupportedCpuMode(#[source] anyhow::Error),
|
||||
|
||||
#[error("Invalid instruction operand: {0}")]
|
||||
#[error("Invalid instruction operand")]
|
||||
InvalidOperand(#[source] anyhow::Error),
|
||||
}
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum EmulationError<T: Debug> {
|
||||
#[error("Unsupported instruction: {0}")]
|
||||
#[error("Unsupported instruction")]
|
||||
UnsupportedInstruction(#[source] anyhow::Error),
|
||||
|
||||
#[error("Unsupported memory size: {0}")]
|
||||
#[error("Unsupported memory size")]
|
||||
UnsupportedMemorySize(#[source] anyhow::Error),
|
||||
|
||||
#[error("Invalid operand: {0}")]
|
||||
#[error("Invalid operand")]
|
||||
InvalidOperand(#[source] anyhow::Error),
|
||||
|
||||
#[error("Wrong number of operands: {0}")]
|
||||
#[error("Wrong number of operands")]
|
||||
WrongNumberOperands(#[source] anyhow::Error),
|
||||
|
||||
#[error("Instruction Exception: {0}")]
|
||||
#[error("Instruction Exception")]
|
||||
InstructionException(#[source] Exception<T>),
|
||||
|
||||
#[error("Instruction fetching error: {0}")]
|
||||
#[error("Instruction fetching error")]
|
||||
InstructionFetchingError(#[source] anyhow::Error),
|
||||
|
||||
#[error("Platform emulation error: {0}")]
|
||||
#[error("Platform emulation error")]
|
||||
PlatformEmulationError(#[source] PlatformError),
|
||||
|
||||
#[error(transparent)]
|
||||
|
||||
@@ -13,13 +13,13 @@ use crate::{AiaState, HypervisorDeviceError, HypervisorVmError};
|
||||
#[derive(Debug, Error)]
|
||||
pub enum Error {
|
||||
/// Error while calling KVM ioctl for setting up the global interrupt controller.
|
||||
#[error("Failed creating AIA device: {0}")]
|
||||
#[error("Failed creating AIA device")]
|
||||
CreateAia(#[source] HypervisorVmError),
|
||||
/// Error while setting device attributes for the AIA.
|
||||
#[error("Failed setting device attributes for the AIA: {0}")]
|
||||
#[error("Failed setting device attributes for the AIA")]
|
||||
SetDeviceAttribute(#[source] HypervisorDeviceError),
|
||||
/// Error while getting device attributes for the AIA.
|
||||
#[error("Failed getting device attributes for the AIA: {0}")]
|
||||
#[error("Failed getting device attributes for the AIA")]
|
||||
GetDeviceAttribute(#[source] HypervisorDeviceError),
|
||||
}
|
||||
pub type Result<T> = result::Result<T, Error>;
|
||||
|
||||
@@ -43,171 +43,171 @@ pub enum HypervisorCpuError {
|
||||
///
|
||||
/// Setting standard registers error
|
||||
///
|
||||
#[error("Failed to set standard register: {0}")]
|
||||
#[error("Failed to set standard register")]
|
||||
SetStandardRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting standard registers error
|
||||
///
|
||||
#[error("Failed to get standard registers: {0}")]
|
||||
#[error("Failed to get standard registers")]
|
||||
GetStandardRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting special register error
|
||||
///
|
||||
#[error("Failed to set special registers: {0}")]
|
||||
#[error("Failed to set special registers")]
|
||||
SetSpecialRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting standard register error
|
||||
///
|
||||
#[error("Failed to get special registers: {0}")]
|
||||
#[error("Failed to get special registers")]
|
||||
GetSpecialRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting floating point registers error
|
||||
///
|
||||
#[error("Failed to set floating point registers: {0}")]
|
||||
#[error("Failed to set floating point registers")]
|
||||
SetFloatingPointRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting floating point register error
|
||||
///
|
||||
#[error("Failed to get floating points registers: {0}")]
|
||||
#[error("Failed to get floating points registers")]
|
||||
GetFloatingPointRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting Cpuid error
|
||||
///
|
||||
#[error("Failed to set Cpuid: {0}")]
|
||||
#[error("Failed to set Cpuid")]
|
||||
SetCpuid(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting Cpuid error
|
||||
///
|
||||
#[error("Failed to get Cpuid: {0}")]
|
||||
#[error("Failed to get Cpuid")]
|
||||
GetCpuid(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting lapic state error
|
||||
///
|
||||
#[error("Failed to set Lapic state: {0}")]
|
||||
#[error("Failed to set Lapic state")]
|
||||
SetLapicState(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting Lapic state error
|
||||
///
|
||||
#[error("Failed to get Lapic state: {0}")]
|
||||
#[error("Failed to get Lapic state")]
|
||||
GetlapicState(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting MSR entries error
|
||||
///
|
||||
#[error("Failed to set Msr entries: {0}")]
|
||||
#[error("Failed to set Msr entries")]
|
||||
SetMsrEntries(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting Msr entries error
|
||||
///
|
||||
#[error("Failed to get Msr entries: {0}")]
|
||||
#[error("Failed to get Msr entries")]
|
||||
GetMsrEntries(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting multi-processing state error
|
||||
///
|
||||
#[error("Failed to set MP state: {0}")]
|
||||
#[error("Failed to set MP state")]
|
||||
SetMpState(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting multi-processing state error
|
||||
///
|
||||
#[error("Failed to get MP state: {0}")]
|
||||
#[error("Failed to get MP state")]
|
||||
GetMpState(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting Saved Processor Extended States error
|
||||
///
|
||||
#[cfg(feature = "kvm")]
|
||||
#[error("Failed to set Saved Processor Extended States: {0}")]
|
||||
#[error("Failed to set Saved Processor Extended States")]
|
||||
SetXsaveState(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting Saved Processor Extended States error
|
||||
///
|
||||
#[cfg(feature = "kvm")]
|
||||
#[error("Failed to get Saved Processor Extended States: {0}")]
|
||||
#[error("Failed to get Saved Processor Extended States")]
|
||||
GetXsaveState(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting the VP state components error
|
||||
///
|
||||
#[cfg(feature = "mshv")]
|
||||
#[error("Failed to get VP State Components: {0}")]
|
||||
#[error("Failed to get VP State Components")]
|
||||
GetAllVpStateComponents(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting the VP state components error
|
||||
///
|
||||
#[cfg(feature = "mshv")]
|
||||
#[error("Failed to set VP State Components: {0}")]
|
||||
#[error("Failed to set VP State Components")]
|
||||
SetAllVpStateComponents(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting Extended Control Registers error
|
||||
///
|
||||
#[error("Failed to set Extended Control Registers: {0}")]
|
||||
#[error("Failed to set Extended Control Registers")]
|
||||
SetXcsr(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting Extended Control Registers error
|
||||
///
|
||||
#[error("Failed to get Extended Control Registers: {0}")]
|
||||
#[error("Failed to get Extended Control Registers")]
|
||||
GetXcsr(#[source] anyhow::Error),
|
||||
///
|
||||
/// Running Vcpu error
|
||||
///
|
||||
#[error("Failed to run vcpu: {0}")]
|
||||
#[error("Failed to run vcpu")]
|
||||
RunVcpu(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting Vcpu events error
|
||||
///
|
||||
#[error("Failed to get Vcpu events: {0}")]
|
||||
#[error("Failed to get Vcpu events")]
|
||||
GetVcpuEvents(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting Vcpu events error
|
||||
///
|
||||
#[error("Failed to set Vcpu events: {0}")]
|
||||
#[error("Failed to set Vcpu events")]
|
||||
SetVcpuEvents(#[source] anyhow::Error),
|
||||
///
|
||||
/// Vcpu Init error
|
||||
///
|
||||
#[error("Failed to init vcpu: {0}")]
|
||||
#[error("Failed to init vcpu")]
|
||||
VcpuInit(#[source] anyhow::Error),
|
||||
///
|
||||
/// Vcpu Finalize error
|
||||
///
|
||||
#[error("Failed to finalize vcpu: {0}")]
|
||||
#[error("Failed to finalize vcpu")]
|
||||
VcpuFinalize(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting one reg error
|
||||
///
|
||||
#[error("Failed to set one reg: {0}")]
|
||||
#[error("Failed to set one reg")]
|
||||
SetRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting one reg error
|
||||
///
|
||||
#[error("Failed to get one reg: {0}")]
|
||||
#[error("Failed to get one reg")]
|
||||
GetRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting guest clock paused error
|
||||
///
|
||||
#[error("Failed to notify guest its clock was paused: {0}")]
|
||||
#[error("Failed to notify guest its clock was paused")]
|
||||
NotifyGuestClockPaused(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting debug register error
|
||||
///
|
||||
#[error("Failed to set debug registers: {0}")]
|
||||
#[error("Failed to set debug registers")]
|
||||
SetDebugRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting debug register error
|
||||
///
|
||||
#[error("Failed to get debug registers: {0}")]
|
||||
#[error("Failed to get debug registers")]
|
||||
GetDebugRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting misc register error
|
||||
///
|
||||
#[error("Failed to set misc registers: {0}")]
|
||||
#[error("Failed to set misc registers")]
|
||||
SetMiscRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting misc register error
|
||||
///
|
||||
#[error("Failed to get misc registers: {0}")]
|
||||
#[error("Failed to get misc registers")]
|
||||
GetMiscRegs(#[source] anyhow::Error),
|
||||
///
|
||||
/// Write to Guest Mem
|
||||
///
|
||||
#[error("Failed to write to Guest Mem at: {0}")]
|
||||
#[error("Failed to write to Guest Mem at")]
|
||||
GuestMemWrite(#[source] anyhow::Error),
|
||||
/// Enabling HyperV SynIC error
|
||||
///
|
||||
@@ -216,68 +216,68 @@ pub enum HypervisorCpuError {
|
||||
///
|
||||
/// Getting AArch64 core register error
|
||||
///
|
||||
#[error("Failed to get aarch64 core register: {0}")]
|
||||
#[error("Failed to get aarch64 core register")]
|
||||
GetAarchCoreRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting AArch64 core register error
|
||||
///
|
||||
#[error("Failed to set aarch64 core register: {0}")]
|
||||
#[error("Failed to set aarch64 core register")]
|
||||
SetAarchCoreRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting RISC-V 64-bit core register error
|
||||
///
|
||||
#[error("Failed to get riscv64 core register: {0}")]
|
||||
#[error("Failed to get riscv64 core register")]
|
||||
GetRiscvCoreRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting RISC-V 64-bit core register error
|
||||
///
|
||||
#[error("Failed to set riscv64 core register: {0}")]
|
||||
#[error("Failed to set riscv64 core register")]
|
||||
SetRiscvCoreRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting registers list error
|
||||
///
|
||||
#[error("Failed to retrieve list of registers: {0}")]
|
||||
#[error("Failed to retrieve list of registers")]
|
||||
GetRegList(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting AArch64 system register error
|
||||
///
|
||||
#[error("Failed to get system register: {0}")]
|
||||
#[error("Failed to get system register")]
|
||||
GetSysRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting AArch64 system register error
|
||||
///
|
||||
#[error("Failed to set system register: {0}")]
|
||||
#[error("Failed to set system register")]
|
||||
SetSysRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Getting RISC-V 64-bit non-core register error
|
||||
///
|
||||
#[error("Failed to get non-core register: {0}")]
|
||||
#[error("Failed to get non-core register")]
|
||||
GetNonCoreRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting RISC-V 64-bit non-core register error
|
||||
///
|
||||
#[error("Failed to set non-core register: {0}")]
|
||||
#[error("Failed to set non-core register")]
|
||||
SetNonCoreRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// GVA translation error
|
||||
///
|
||||
#[error("Failed to translate GVA: {0}")]
|
||||
#[error("Failed to translate GVA")]
|
||||
TranslateVirtualAddress(#[source] anyhow::Error),
|
||||
///
|
||||
/// Set cpu attribute error
|
||||
///
|
||||
#[error("Failed to set vcpu attribute: {0}")]
|
||||
#[error("Failed to set vcpu attribute")]
|
||||
SetVcpuAttribute(#[source] anyhow::Error),
|
||||
///
|
||||
/// Check if cpu has a certain attribute error
|
||||
///
|
||||
#[error("Failed to check if vcpu has attribute: {0}")]
|
||||
#[error("Failed to check if vcpu has attribute")]
|
||||
HasVcpuAttribute(#[source] anyhow::Error),
|
||||
///
|
||||
/// Failed to initialize TDX on CPU
|
||||
///
|
||||
#[cfg(feature = "tdx")]
|
||||
#[error("Failed to initialize TDX: {0}")]
|
||||
#[error("Failed to initialize TDX")]
|
||||
InitializeTdx(#[source] std::io::Error),
|
||||
///
|
||||
/// Unknown TDX VM call
|
||||
@@ -295,33 +295,33 @@ pub enum HypervisorCpuError {
|
||||
///
|
||||
/// Error getting TSC frequency
|
||||
///
|
||||
#[error("Failed to get TSC frequency: {0}")]
|
||||
#[error("Failed to get TSC frequency")]
|
||||
GetTscKhz(#[source] anyhow::Error),
|
||||
///
|
||||
/// Error setting TSC frequency
|
||||
///
|
||||
#[error("Failed to set TSC frequency: {0}")]
|
||||
#[error("Failed to set TSC frequency")]
|
||||
SetTscKhz(#[source] anyhow::Error),
|
||||
///
|
||||
/// Error reading value at given GPA
|
||||
///
|
||||
#[error("Failed to read from GPA: {0}")]
|
||||
#[error("Failed to read from GPA")]
|
||||
GpaRead(#[source] anyhow::Error),
|
||||
///
|
||||
/// Error writing value at given GPA
|
||||
///
|
||||
#[error("Failed to write to GPA: {0}")]
|
||||
#[error("Failed to write to GPA")]
|
||||
GpaWrite(#[source] anyhow::Error),
|
||||
///
|
||||
/// Error getting CPUID leaf
|
||||
///
|
||||
#[error("Failed to get CPUID entries: {0}")]
|
||||
#[error("Failed to get CPUID entries")]
|
||||
GetCpuidVales(#[source] anyhow::Error),
|
||||
///
|
||||
/// Setting SEV control register error
|
||||
///
|
||||
#[cfg(feature = "sev_snp")]
|
||||
#[error("Failed to set sev control register: {0}")]
|
||||
#[error("Failed to set sev control register")]
|
||||
SetSevControlRegister(#[source] anyhow::Error),
|
||||
///
|
||||
/// Unsupported SysReg registers
|
||||
|
||||
@@ -18,11 +18,11 @@ pub enum HypervisorDeviceError {
|
||||
///
|
||||
/// Set device attribute error
|
||||
///
|
||||
#[error("Failed to set device attribute: {0}")]
|
||||
#[error("Failed to set device attribute")]
|
||||
SetDeviceAttribute(#[source] anyhow::Error),
|
||||
///
|
||||
/// Get device attribute error
|
||||
///
|
||||
#[error("Failed to get device attribute: {0}")]
|
||||
#[error("Failed to get device attribute")]
|
||||
GetDeviceAttribute(#[source] anyhow::Error),
|
||||
}
|
||||
|
||||
@@ -27,37 +27,37 @@ pub enum HypervisorError {
|
||||
///
|
||||
/// Hypervisor availability check error
|
||||
///
|
||||
#[error("Failed to check availability of the hypervisor: {0}")]
|
||||
#[error("Failed to check availability of the hypervisor")]
|
||||
HypervisorAvailableCheck(#[source] anyhow::Error),
|
||||
///
|
||||
/// hypervisor creation error
|
||||
///
|
||||
#[error("Failed to create the hypervisor: {0}")]
|
||||
#[error("Failed to create the hypervisor")]
|
||||
HypervisorCreate(#[source] anyhow::Error),
|
||||
///
|
||||
/// Vm creation failure
|
||||
///
|
||||
#[error("Failed to create Vm: {0}")]
|
||||
#[error("Failed to create Vm")]
|
||||
VmCreate(#[source] anyhow::Error),
|
||||
///
|
||||
/// Vm setup failure
|
||||
///
|
||||
#[error("Failed to setup Vm: {0}")]
|
||||
#[error("Failed to setup Vm")]
|
||||
VmSetup(#[source] anyhow::Error),
|
||||
///
|
||||
/// API version error
|
||||
///
|
||||
#[error("Failed to get API Version: {0}")]
|
||||
#[error("Failed to get API Version")]
|
||||
GetApiVersion(#[source] anyhow::Error),
|
||||
///
|
||||
/// CpuId error
|
||||
///
|
||||
#[error("Failed to get cpuid: {0}")]
|
||||
#[error("Failed to get cpuid")]
|
||||
GetCpuId(#[source] anyhow::Error),
|
||||
///
|
||||
/// Failed to retrieve list of MSRs.
|
||||
///
|
||||
#[error("Failed to get the list of supported MSRs: {0}")]
|
||||
#[error("Failed to get the list of supported MSRs")]
|
||||
GetMsrList(#[source] anyhow::Error),
|
||||
///
|
||||
/// API version is not compatible
|
||||
@@ -67,22 +67,22 @@ pub enum HypervisorError {
|
||||
///
|
||||
/// Checking extensions failed
|
||||
///
|
||||
#[error("Checking extensions: {0}")]
|
||||
#[error("Checking extensions")]
|
||||
CheckExtensions(#[source] anyhow::Error),
|
||||
///
|
||||
/// Failed to retrieve TDX capabilities
|
||||
///
|
||||
#[error("Failed to retrieve TDX capabilities: {0}")]
|
||||
#[error("Failed to retrieve TDX capabilities")]
|
||||
TdxCapabilities(#[source] anyhow::Error),
|
||||
///
|
||||
/// Failed to set partition property
|
||||
///
|
||||
#[error("Failed to set partition property: {0}")]
|
||||
#[error("Failed to set partition property")]
|
||||
SetPartitionProperty(#[source] anyhow::Error),
|
||||
///
|
||||
/// Running on an unsupported CPU
|
||||
///
|
||||
#[error("Unsupported CPU: {0}")]
|
||||
#[error("Unsupported CPU")]
|
||||
UnsupportedCpu(#[source] anyhow::Error),
|
||||
///
|
||||
/// Launching a VM with unsupported VM Type
|
||||
|
||||
@@ -58,196 +58,196 @@ pub enum HypervisorVmError {
|
||||
///
|
||||
/// Create Vcpu error
|
||||
///
|
||||
#[error("Failed to create Vcpu: {0}")]
|
||||
#[error("Failed to create Vcpu")]
|
||||
CreateVcpu(#[source] anyhow::Error),
|
||||
///
|
||||
/// Identity map address error
|
||||
///
|
||||
#[error("Failed to set identity map address: {0}")]
|
||||
#[error("Failed to set identity map address")]
|
||||
SetIdentityMapAddress(#[source] anyhow::Error),
|
||||
///
|
||||
/// TSS address error
|
||||
///
|
||||
#[error("Failed to set TSS address: {0}")]
|
||||
#[error("Failed to set TSS address")]
|
||||
SetTssAddress(#[source] anyhow::Error),
|
||||
///
|
||||
/// Create interrupt controller error
|
||||
///
|
||||
#[error("Failed to create interrupt controller: {0}")]
|
||||
#[error("Failed to create interrupt controller")]
|
||||
CreateIrq(#[source] anyhow::Error),
|
||||
///
|
||||
/// Register interrupt event error
|
||||
///
|
||||
#[error("Failed to register interrupt event: {0}")]
|
||||
#[error("Failed to register interrupt event")]
|
||||
RegisterIrqFd(#[source] anyhow::Error),
|
||||
///
|
||||
/// Un register interrupt event error
|
||||
///
|
||||
#[error("Failed to unregister interrupt event: {0}")]
|
||||
#[error("Failed to unregister interrupt event")]
|
||||
UnregisterIrqFd(#[source] anyhow::Error),
|
||||
///
|
||||
/// Register IO event error
|
||||
///
|
||||
#[error("Failed to register IO event: {0}")]
|
||||
#[error("Failed to register IO event")]
|
||||
RegisterIoEvent(#[source] anyhow::Error),
|
||||
///
|
||||
/// Unregister IO event error
|
||||
///
|
||||
#[error("Failed to unregister IO event: {0}")]
|
||||
#[error("Failed to unregister IO event")]
|
||||
UnregisterIoEvent(#[source] anyhow::Error),
|
||||
///
|
||||
/// Set GSI routing error
|
||||
///
|
||||
#[error("Failed to set GSI routing: {0}")]
|
||||
#[error("Failed to set GSI routing")]
|
||||
SetGsiRouting(#[source] anyhow::Error),
|
||||
///
|
||||
/// Create user memory error
|
||||
///
|
||||
#[error("Failed to create user memory: {0}")]
|
||||
#[error("Failed to create user memory")]
|
||||
CreateUserMemory(#[source] anyhow::Error),
|
||||
///
|
||||
/// Remove user memory region error
|
||||
///
|
||||
#[error("Failed to remove user memory: {0}")]
|
||||
#[error("Failed to remove user memory")]
|
||||
RemoveUserMemory(#[source] anyhow::Error),
|
||||
///
|
||||
/// Create device error
|
||||
///
|
||||
#[error("Failed to set GSI routing: {0}")]
|
||||
#[error("Failed to set GSI routing")]
|
||||
CreateDevice(#[source] anyhow::Error),
|
||||
///
|
||||
/// Get preferred target error
|
||||
///
|
||||
#[error("Failed to get preferred target: {0}")]
|
||||
#[error("Failed to get preferred target")]
|
||||
GetPreferredTarget(#[source] anyhow::Error),
|
||||
///
|
||||
/// Enable split Irq error
|
||||
///
|
||||
#[error("Failed to enable split Irq: {0}")]
|
||||
#[error("Failed to enable split Irq")]
|
||||
EnableSplitIrq(#[source] anyhow::Error),
|
||||
///
|
||||
/// Enable SGX attribute error
|
||||
///
|
||||
#[error("Failed to enable SGX attribute: {0}")]
|
||||
#[error("Failed to enable SGX attribute")]
|
||||
EnableSgxAttribute(#[source] anyhow::Error),
|
||||
///
|
||||
/// Get clock error
|
||||
///
|
||||
#[error("Failed to get clock: {0}")]
|
||||
#[error("Failed to get clock")]
|
||||
GetClock(#[source] anyhow::Error),
|
||||
///
|
||||
/// Set clock error
|
||||
///
|
||||
#[error("Failed to set clock: {0}")]
|
||||
#[error("Failed to set clock")]
|
||||
SetClock(#[source] anyhow::Error),
|
||||
///
|
||||
/// Create passthrough device
|
||||
///
|
||||
#[error("Failed to create passthrough device: {0}")]
|
||||
#[error("Failed to create passthrough device")]
|
||||
CreatePassthroughDevice(#[source] anyhow::Error),
|
||||
/// Write to Guest memory
|
||||
///
|
||||
#[error("Failed to write to guest memory: {0}")]
|
||||
#[error("Failed to write to guest memory")]
|
||||
GuestMemWrite(#[source] anyhow::Error),
|
||||
///
|
||||
/// Read Guest memory
|
||||
///
|
||||
#[error("Failed to read guest memory: {0}")]
|
||||
#[error("Failed to read guest memory")]
|
||||
GuestMemRead(#[source] anyhow::Error),
|
||||
///
|
||||
/// Read from MMIO Bus
|
||||
///
|
||||
#[error("Failed to read from MMIO Bus: {0}")]
|
||||
#[error("Failed to read from MMIO Bus")]
|
||||
MmioBusRead(#[source] anyhow::Error),
|
||||
///
|
||||
/// Write to MMIO Bus
|
||||
///
|
||||
#[error("Failed to write to MMIO Bus: {0}")]
|
||||
#[error("Failed to write to MMIO Bus")]
|
||||
MmioBusWrite(#[source] anyhow::Error),
|
||||
///
|
||||
/// Read from IO Bus
|
||||
///
|
||||
#[error("Failed to read from IO Bus: {0}")]
|
||||
#[error("Failed to read from IO Bus")]
|
||||
IoBusRead(#[source] anyhow::Error),
|
||||
///
|
||||
/// Write to IO Bus
|
||||
///
|
||||
#[error("Failed to write to IO Bus: {0}")]
|
||||
#[error("Failed to write to IO Bus")]
|
||||
IoBusWrite(#[source] anyhow::Error),
|
||||
///
|
||||
/// Start dirty log error
|
||||
///
|
||||
#[error("Failed to get dirty log: {0}")]
|
||||
#[error("Failed to get dirty log")]
|
||||
StartDirtyLog(#[source] anyhow::Error),
|
||||
///
|
||||
/// Stop dirty log error
|
||||
///
|
||||
#[error("Failed to get dirty log: {0}")]
|
||||
#[error("Failed to get dirty log")]
|
||||
StopDirtyLog(#[source] anyhow::Error),
|
||||
///
|
||||
/// Get dirty log error
|
||||
///
|
||||
#[error("Failed to get dirty log: {0}")]
|
||||
#[error("Failed to get dirty log")]
|
||||
GetDirtyLog(#[source] anyhow::Error),
|
||||
///
|
||||
/// Assert virtual interrupt error
|
||||
///
|
||||
#[error("Failed to assert virtual Interrupt: {0}")]
|
||||
#[error("Failed to assert virtual Interrupt")]
|
||||
AssertVirtualInterrupt(#[source] anyhow::Error),
|
||||
|
||||
#[cfg(feature = "sev_snp")]
|
||||
///
|
||||
/// Error initializing SEV-SNP on the VM
|
||||
///
|
||||
#[error("Failed to initialize SEV-SNP: {0}")]
|
||||
#[error("Failed to initialize SEV-SNP")]
|
||||
InitializeSevSnp(#[source] std::io::Error),
|
||||
|
||||
#[cfg(feature = "tdx")]
|
||||
///
|
||||
/// Error initializing TDX on the VM
|
||||
///
|
||||
#[error("Failed to initialize TDX: {0}")]
|
||||
#[error("Failed to initialize TDX")]
|
||||
InitializeTdx(#[source] std::io::Error),
|
||||
#[cfg(feature = "tdx")]
|
||||
///
|
||||
/// Error finalizing the TDX configuration on the VM
|
||||
///
|
||||
#[error("Failed to finalize TDX: {0}")]
|
||||
#[error("Failed to finalize TDX")]
|
||||
FinalizeTdx(#[source] std::io::Error),
|
||||
#[cfg(feature = "tdx")]
|
||||
///
|
||||
/// Error initializing the TDX memory region
|
||||
///
|
||||
#[error("Failed to initialize memory region TDX: {0}")]
|
||||
#[error("Failed to initialize memory region TDX")]
|
||||
InitMemRegionTdx(#[source] std::io::Error),
|
||||
///
|
||||
/// Create Vgic error
|
||||
///
|
||||
#[error("Failed to create Vgic: {0}")]
|
||||
#[error("Failed to create Vgic")]
|
||||
CreateVgic(#[source] anyhow::Error),
|
||||
///
|
||||
/// Create Vaia error
|
||||
///
|
||||
#[error("Failed to create Vaia: {0}")]
|
||||
#[error("Failed to create Vaia")]
|
||||
CreateVaia(#[source] anyhow::Error),
|
||||
///
|
||||
/// Import isolated pages error
|
||||
///
|
||||
#[error("Failed to import isolated pages: {0}")]
|
||||
#[error("Failed to import isolated pages")]
|
||||
ImportIsolatedPages(#[source] anyhow::Error),
|
||||
/// Failed to complete isolated import
|
||||
///
|
||||
#[error("Failed to complete isolated import: {0}")]
|
||||
#[error("Failed to complete isolated import")]
|
||||
CompleteIsolatedImport(#[source] anyhow::Error),
|
||||
/// Failed to set VM property
|
||||
///
|
||||
#[error("Failed to set VM property: {0}")]
|
||||
#[error("Failed to set VM property")]
|
||||
SetVmProperty(#[source] anyhow::Error),
|
||||
///
|
||||
/// Modify GPA host access error
|
||||
///
|
||||
#[cfg(feature = "sev_snp")]
|
||||
#[error("Failed to modify GPA host access: {0}")]
|
||||
#[error("Failed to modify GPA host access")]
|
||||
ModifyGpaHostAccess(#[source] anyhow::Error),
|
||||
///
|
||||
/// Failed to mmap
|
||||
@@ -258,7 +258,7 @@ pub enum HypervisorVmError {
|
||||
///
|
||||
/// Failed to initialize VM
|
||||
///
|
||||
#[error("Failed to initialize VM: {0}")]
|
||||
#[error("Failed to initialize VM")]
|
||||
InitializeVm(#[source] anyhow::Error),
|
||||
}
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user