mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
misc: devices: streamline #[source] and Error impl
This streamlines the Error implementation in the Cloud Hypervisor code base to match the remaining parts so that everything follows the agreed conventions. These are leftovers missed in the previous commits. 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
d2ca7b0e87
commit
ab575a54b9
@@ -37,19 +37,19 @@ pub enum Error {
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
/// Failed creating GIC device.
|
||||
#[error("Failed creating GIC device: {0}")]
|
||||
CreateGic(hypervisor::HypervisorVmError),
|
||||
CreateGic(#[source] hypervisor::HypervisorVmError),
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
/// Failed restoring GIC device.
|
||||
#[error("Failed restoring GIC device: {0}")]
|
||||
RestoreGic(hypervisor::arch::aarch64::gic::Error),
|
||||
RestoreGic(#[source] hypervisor::arch::aarch64::gic::Error),
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
/// Failed creating AIA device.
|
||||
#[error("Failed creating AIA device: {0}")]
|
||||
CreateAia(hypervisor::HypervisorVmError),
|
||||
CreateAia(#[source] hypervisor::HypervisorVmError),
|
||||
#[cfg(target_arch = "riscv64")]
|
||||
/// Failed restoring AIA device.
|
||||
#[error("Failed restoring AIA device: {0}")]
|
||||
RestoreAia(hypervisor::arch::riscv64::aia::Error),
|
||||
RestoreAia(#[source] hypervisor::arch::riscv64::aia::Error),
|
||||
}
|
||||
|
||||
type Result<T> = result::Result<T, Error>;
|
||||
|
||||
@@ -43,11 +43,11 @@ const N_GPIOS: u32 = 8;
|
||||
pub enum Error {
|
||||
#[error("Bad Write Offset: {0}")]
|
||||
BadWriteOffset(u64),
|
||||
#[error("GPIO interrupt disabled by guest driver.")]
|
||||
#[error("GPIO interrupt disabled by guest driver")]
|
||||
GpioInterruptDisabled,
|
||||
#[error("Could not trigger GPIO interrupt: {0}.")]
|
||||
#[error("Could not trigger GPIO interrupt: {0}")]
|
||||
GpioInterruptFailure(#[source] io::Error),
|
||||
#[error("Invalid GPIO Input key triggered: {0}.")]
|
||||
#[error("Invalid GPIO Input key triggered: {0}")]
|
||||
GpioTriggerKeyFailure(u32),
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ const AMBA_ID_HIGH: u64 = 0x401;
|
||||
pub enum Error {
|
||||
#[error("pl011_write: Bad Write Offset: {0}")]
|
||||
BadWriteOffset(u64),
|
||||
#[error("pl011: DMA not implemented.")]
|
||||
#[error("pl011: DMA not implemented")]
|
||||
DmaNotImplemented,
|
||||
#[error("Failed to trigger interrupt: {0}")]
|
||||
InterruptFailure(#[source] io::Error),
|
||||
|
||||
Reference in New Issue
Block a user