diff --git a/pci/src/bus.rs b/pci/src/bus.rs index 602dd1c2e..f6f8ce2d0 100644 --- a/pci/src/bus.rs +++ b/pci/src/bus.rs @@ -27,16 +27,16 @@ const NUM_DEVICE_IDS: usize = 32; #[derive(Error, Debug)] pub enum PciRootError { /// Could not allocate device address space for the device. - #[error("Could not allocate device address space for the device: {0}")] + #[error("Could not allocate device address space for the device")] AllocateDeviceAddrs(#[source] PciDeviceError), /// Could not allocate an IRQ number. #[error("Could not allocate an IRQ number")] AllocateIrq, /// Could not add a device to the port io bus. - #[error("Could not add a device to the port io bus: {0}")] + #[error("Could not add a device to the port io bus")] PioInsert(#[source] vm_device::BusError), /// Could not add a device to the mmio bus. - #[error("Could not add a device to the mmio bus: {0}")] + #[error("Could not add a device to the mmio bus")] MmioInsert(#[source] vm_device::BusError), /// Could not find an available device slot on the PCI bus. #[error("Could not find an available device slot on the PCI bus")] diff --git a/pci/src/device.rs b/pci/src/device.rs index 782958c75..cddb30fce 100644 --- a/pci/src/device.rs +++ b/pci/src/device.rs @@ -18,13 +18,13 @@ use crate::PciBarConfiguration; #[derive(Error, Debug)] pub enum Error { /// Setup of the device capabilities failed. - #[error("Setup of the device capabilities failed: {0}")] + #[error("Setup of the device capabilities failed")] CapabilitiesSetup(#[source] configuration::Error), /// Allocating space for an IO BAR failed. #[error("Allocating space for an IO BAR failed")] IoAllocationFailed(u64), /// Registering an IO BAR failed. - #[error("Registering an IO BAR failed: {0}")] + #[error("Registering an IO BAR failed")] IoRegistrationFailed(u64, #[source] configuration::Error), /// Expected resource not found. #[error("Expected resource not found")] diff --git a/pci/src/msi.rs b/pci/src/msi.rs index edae9af54..ebb7aa3e9 100644 --- a/pci/src/msi.rs +++ b/pci/src/msi.rs @@ -39,9 +39,9 @@ pub fn msi_num_enabled_vectors(msg_ctl: u16) -> usize { #[derive(Error, Debug)] pub enum Error { - #[error("Failed enabling the interrupt route: {0}")] + #[error("Failed enabling the interrupt route")] EnableInterruptRoute(#[source] io::Error), - #[error("Failed updating the interrupt route: {0}")] + #[error("Failed updating the interrupt route")] UpdateInterruptRoute(#[source] io::Error), } diff --git a/pci/src/msix.rs b/pci/src/msix.rs index b66e8e5c5..f323a6917 100644 --- a/pci/src/msix.rs +++ b/pci/src/msix.rs @@ -31,10 +31,10 @@ pub const MSIX_CONFIG_ID: &str = "msix_config"; #[derive(Error, Debug)] pub enum Error { /// Failed enabling the interrupt route. - #[error("Failed enabling the interrupt route: {0}")] + #[error("Failed enabling the interrupt route")] EnableInterruptRoute(#[source] io::Error), /// Failed updating the interrupt route. - #[error("Failed updating the interrupt route: {0}")] + #[error("Failed updating the interrupt route")] UpdateInterruptRoute(#[source] io::Error), } diff --git a/pci/src/vfio.rs b/pci/src/vfio.rs index b76664da8..660f27bd4 100644 --- a/pci/src/vfio.rs +++ b/pci/src/vfio.rs @@ -47,17 +47,17 @@ pub(crate) const VFIO_COMMON_ID: &str = "vfio_common"; #[derive(Debug, Error)] pub enum VfioPciError { - #[error("Failed to create user memory region: {0}")] + #[error("Failed to create user memory region")] CreateUserMemoryRegion(#[source] HypervisorVmError), #[error("Failed to DMA map: {0} for device {1} (guest BDF: {2})")] DmaMap(#[source] vfio_ioctls::VfioError, PathBuf, PciBdf), #[error("Failed to DMA unmap: {0} for device {1} (guest BDF: {2})")] DmaUnmap(#[source] vfio_ioctls::VfioError, PathBuf, PciBdf), - #[error("Failed to enable INTx: {0}")] + #[error("Failed to enable INTx")] EnableIntx(#[source] VfioError), - #[error("Failed to enable MSI: {0}")] + #[error("Failed to enable MSI")] EnableMsi(#[source] VfioError), - #[error("Failed to enable MSI-x: {0}")] + #[error("Failed to enable MSI-x")] EnableMsix(#[source] VfioError), #[error("Failed to mmap the area")] MmapArea, @@ -67,13 +67,13 @@ pub enum VfioPciError { RegionAlignment, #[error("Invalid region size")] RegionSize, - #[error("Failed to retrieve MsiConfigState: {0}")] + #[error("Failed to retrieve MsiConfigState")] RetrieveMsiConfigState(#[source] anyhow::Error), - #[error("Failed to retrieve MsixConfigState: {0}")] + #[error("Failed to retrieve MsixConfigState")] RetrieveMsixConfigState(#[source] anyhow::Error), - #[error("Failed to retrieve PciConfigurationState: {0}")] + #[error("Failed to retrieve PciConfigurationState")] RetrievePciConfigurationState(#[source] anyhow::Error), - #[error("Failed to retrieve VfioCommonState: {0}")] + #[error("Failed to retrieve VfioCommonState")] RetrieveVfioCommonState(#[source] anyhow::Error), } @@ -318,9 +318,9 @@ impl MmioRegionRange for Vec { #[derive(Debug, Error)] pub enum VfioError { - #[error("Kernel VFIO error: {0}")] + #[error("Kernel VFIO error")] KernelVfio(#[source] vfio_ioctls::VfioError), - #[error("VFIO user error: {0}")] + #[error("VFIO user error")] VfioUser(#[source] vfio_user::Error), } diff --git a/pci/src/vfio_user.rs b/pci/src/vfio_user.rs index 3762b2c75..f23259f48 100644 --- a/pci/src/vfio_user.rs +++ b/pci/src/vfio_user.rs @@ -40,17 +40,17 @@ pub struct VfioUserPciDevice { #[derive(Error, Debug)] pub enum VfioUserPciDeviceError { - #[error("Client error: {0}")] + #[error("Client error")] Client(#[source] VfioUserError), - #[error("Failed to map VFIO PCI region into guest: {0}")] + #[error("Failed to map VFIO PCI region into guest")] MapRegionGuest(#[source] HypervisorVmError), - #[error("Failed to DMA map: {0}")] + #[error("Failed to DMA map")] DmaMap(#[source] VfioUserError), - #[error("Failed to DMA unmap: {0}")] + #[error("Failed to DMA unmap")] DmaUnmap(#[source] VfioUserError), - #[error("Failed to initialize legacy interrupts: {0}")] + #[error("Failed to initialize legacy interrupts")] InitializeLegacyInterrupts(#[source] VfioPciError), - #[error("Failed to create VfioCommon: {0}")] + #[error("Failed to create VfioCommon")] CreateVfioCommon(#[source] VfioPciError), }