misc: devices: 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:
parent
5711f31995
commit
1b91aa8ef3
7 changed files with 21 additions and 21 deletions
|
|
@ -17,38 +17,38 @@ pub enum Error {
|
|||
#[error("Invalid delivery mode")]
|
||||
InvalidDeliveryMode,
|
||||
/// Failed creating the interrupt source group.
|
||||
#[error("Failed creating the interrupt source group: {0}")]
|
||||
#[error("Failed creating the interrupt source group")]
|
||||
CreateInterruptSourceGroup(#[source] io::Error),
|
||||
/// Failed triggering the interrupt.
|
||||
#[error("Failed triggering the interrupt: {0}")]
|
||||
#[error("Failed triggering the interrupt")]
|
||||
TriggerInterrupt(#[source] io::Error),
|
||||
/// Failed masking the interrupt.
|
||||
#[error("Failed masking the interrupt: {0}")]
|
||||
#[error("Failed masking the interrupt")]
|
||||
MaskInterrupt(#[source] io::Error),
|
||||
/// Failed unmasking the interrupt.
|
||||
#[error("Failed unmasking the interrupt: {0}")]
|
||||
#[error("Failed unmasking the interrupt")]
|
||||
UnmaskInterrupt(#[source] io::Error),
|
||||
/// Failed updating the interrupt.
|
||||
#[error("Failed updating the interrupt: {0}")]
|
||||
#[error("Failed updating the interrupt")]
|
||||
UpdateInterrupt(#[source] io::Error),
|
||||
/// Failed enabling the interrupt.
|
||||
#[error("Failed enabling the interrupt: {0}")]
|
||||
#[error("Failed enabling the interrupt")]
|
||||
EnableInterrupt(#[source] io::Error),
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
/// Failed creating GIC device.
|
||||
#[error("Failed creating GIC device: {0}")]
|
||||
#[error("Failed creating GIC device")]
|
||||
CreateGic(#[source] hypervisor::HypervisorVmError),
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
/// Failed restoring GIC device.
|
||||
#[error("Failed restoring GIC device: {0}")]
|
||||
#[error("Failed restoring GIC device")]
|
||||
RestoreGic(#[source] hypervisor::arch::aarch64::gic::Error),
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
/// Failed creating AIA device.
|
||||
#[error("Failed creating AIA device: {0}")]
|
||||
#[error("Failed creating AIA device")]
|
||||
CreateAia(#[source] hypervisor::HypervisorVmError),
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
/// Failed restoring AIA device.
|
||||
#[error("Failed restoring AIA device: {0}")]
|
||||
#[error("Failed restoring AIA device")]
|
||||
RestoreAia(#[source] hypervisor::arch::riscv64::aia::Error),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ pub enum Error {
|
|||
BadWriteOffset(u64),
|
||||
#[error("GPIO interrupt disabled by guest driver")]
|
||||
GpioInterruptDisabled,
|
||||
#[error("Could not trigger GPIO interrupt: {0}")]
|
||||
#[error("Could not trigger GPIO interrupt")]
|
||||
GpioInterruptFailure(#[source] io::Error),
|
||||
#[error("Invalid GPIO Input key triggered: {0}")]
|
||||
GpioTriggerKeyFailure(u32),
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ pub const NANOS_PER_SECOND: u64 = 1_000_000_000;
|
|||
pub enum Error {
|
||||
#[error("Bad Write Offset: {0}")]
|
||||
BadWriteOffset(u64),
|
||||
#[error("Failed to trigger interrupt: {0}")]
|
||||
#[error("Failed to trigger interrupt")]
|
||||
InterruptFailure(#[source] io::Error),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,11 +53,11 @@ pub enum Error {
|
|||
BadWriteOffset(u64),
|
||||
#[error("pl011: DMA not implemented")]
|
||||
DmaNotImplemented,
|
||||
#[error("Failed to trigger interrupt: {0}")]
|
||||
#[error("Failed to trigger interrupt")]
|
||||
InterruptFailure(#[source] io::Error),
|
||||
#[error("Failed to write: {0}")]
|
||||
#[error("Failed to write")]
|
||||
WriteAllFailure(#[source] io::Error),
|
||||
#[error("Failed to flush: {0}")]
|
||||
#[error("Failed to flush")]
|
||||
FlushFailure(#[source] io::Error),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ const MINOR_VERSION: u64 = 0;
|
|||
#[derive(Error, Debug)]
|
||||
pub enum Error {
|
||||
// device errors
|
||||
#[error("Guest gave us bad memory addresses: {0}")]
|
||||
#[error("Guest gave us bad memory addresses")]
|
||||
GuestMemory(#[source] GuestMemoryError),
|
||||
#[error("Guest sent us invalid request")]
|
||||
InvalidRequest,
|
||||
|
|
@ -51,7 +51,7 @@ pub enum Error {
|
|||
InvalidArgument(u64),
|
||||
#[error("Unknown function code: {0}")]
|
||||
UnknownFunctionCode(u64),
|
||||
#[error("Libc call fail: {0}")]
|
||||
#[error("Libc call fail")]
|
||||
LibcFail(#[source] std::io::Error),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ const PVPANIC_CRASH_LOADED: u8 = 1 << 1;
|
|||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum PvPanicError {
|
||||
#[error("Failed creating PvPanicDevice: {0}")]
|
||||
#[error("Failed creating PvPanicDevice")]
|
||||
CreatePvPanicDevice(#[source] anyhow::Error),
|
||||
#[error("Failed to retrieve PciConfigurationState: {0}")]
|
||||
#[error("Failed to retrieve PciConfigurationState")]
|
||||
RetrievePciConfigurationState(#[source] anyhow::Error),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ use vm_device::BusDevice;
|
|||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum Error {
|
||||
#[error("Emulator doesn't implement min required capabilities: {0}")]
|
||||
#[error("Emulator doesn't implement min required capabilities")]
|
||||
CheckCaps(#[source] anyhow::Error),
|
||||
#[error("Failed to initialize tpm: {0}")]
|
||||
#[error("Failed to initialize tpm")]
|
||||
Init(#[source] anyhow::Error),
|
||||
}
|
||||
type Result<T> = anyhow::Result<T, Error>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue