diff --git a/virtio-devices/src/balloon.rs b/virtio-devices/src/balloon.rs index 070158cfd..890dfbd9f 100644 --- a/virtio-devices/src/balloon.rs +++ b/virtio-devices/src/balloon.rs @@ -64,27 +64,27 @@ const VIRTIO_BALLOON_F_REPORTING: u64 = 5; #[derive(Error, Debug)] pub enum Error { - #[error("Guest gave us bad memory addresses.: {0}")] + #[error("Guest gave us bad memory addresses.")] GuestMemory(#[source] GuestMemoryError), #[error("Guest gave us a write only descriptor that protocol says to read from")] UnexpectedWriteOnlyDescriptor, #[error("Guest sent us invalid request")] InvalidRequest, - #[error("Fallocate fail.: {0}")] + #[error("Fallocate fail.")] FallocateFail(#[source] std::io::Error), - #[error("Madvise fail.: {0}")] + #[error("Madvise fail.")] MadviseFail(#[source] std::io::Error), - #[error("Failed to EventFd write.: {0}")] + #[error("Failed to EventFd write.")] EventFdWriteFail(#[source] std::io::Error), #[error("Invalid queue index: {0}")] InvalidQueueIndex(usize), - #[error("Fail tp signal: {0}")] + #[error("Fail tp signal")] FailedSignal(#[source] io::Error), #[error("Descriptor chain is too short")] DescriptorChainTooShort, - #[error("Failed adding used index: {0}")] + #[error("Failed adding used index")] QueueAddUsed(#[source] virtio_queue::Error), - #[error("Failed creating an iterator over the queue: {0}")] + #[error("Failed creating an iterator over the queue")] QueueIterator(#[source] virtio_queue::Error), } diff --git a/virtio-devices/src/block.rs b/virtio-devices/src/block.rs index 1589cda02..3baf2e677 100644 --- a/virtio-devices/src/block.rs +++ b/virtio-devices/src/block.rs @@ -61,25 +61,25 @@ pub const MINIMUM_BLOCK_QUEUE_SIZE: u16 = 2; #[derive(Error, Debug)] pub enum Error { - #[error("Failed to parse the request: {0}")] + #[error("Failed to parse the request")] RequestParsing(#[source] block::Error), - #[error("Failed to execute the request: {0}")] + #[error("Failed to execute the request")] RequestExecuting(#[source] block::ExecuteError), - #[error("Failed to complete the request: {0}")] + #[error("Failed to complete the request")] RequestCompleting(#[source] block::Error), #[error("Missing the expected entry in the list of requests")] MissingEntryRequestList, #[error("The asynchronous request returned with failure")] AsyncRequestFailure, - #[error("Failed synchronizing the file: {0}")] + #[error("Failed synchronizing the file")] Fsync(#[source] AsyncIoError), - #[error("Failed adding used index: {0}")] + #[error("Failed adding used index")] QueueAddUsed(#[source] virtio_queue::Error), - #[error("Failed creating an iterator over the queue: {0}")] + #[error("Failed creating an iterator over the queue")] QueueIterator(#[source] virtio_queue::Error), - #[error("Failed to update request status: {0}")] + #[error("Failed to update request status")] RequestStatus(#[source] GuestMemoryError), - #[error("Failed to enable notification: {0}")] + #[error("Failed to enable notification")] QueueEnableNotification(#[source] virtio_queue::Error), #[error("Failed to get {lock_type:?} lock for disk image {path}: {error}")] LockDiskImage { diff --git a/virtio-devices/src/console.rs b/virtio-devices/src/console.rs index da96a336d..f05c0c4f4 100644 --- a/virtio-devices/src/console.rs +++ b/virtio-devices/src/console.rs @@ -51,15 +51,15 @@ const VIRTIO_CONSOLE_F_SIZE: u64 = 0; enum Error { #[error("Descriptor chain too short")] DescriptorChainTooShort, - #[error("Failed to read from guest memory: {0}")] + #[error("Failed to read from guest memory")] GuestMemoryRead(#[source] vm_memory::guest_memory::Error), - #[error("Failed to write to guest memory: {0}")] + #[error("Failed to write to guest memory")] GuestMemoryWrite(#[source] vm_memory::guest_memory::Error), - #[error("Failed to write_all output: {0}")] + #[error("Failed to write_all output")] OutputWriteAll(#[source] io::Error), - #[error("Failed to flush output: {0}")] + #[error("Failed to flush output")] OutputFlush(#[source] io::Error), - #[error("Failed to add used index: {0}")] + #[error("Failed to add used index")] QueueAddUsed(#[source] virtio_queue::Error), } diff --git a/virtio-devices/src/epoll_helper.rs b/virtio-devices/src/epoll_helper.rs index 8ef080e64..5c0b3a57c 100644 --- a/virtio-devices/src/epoll_helper.rs +++ b/virtio-devices/src/epoll_helper.rs @@ -24,19 +24,19 @@ pub struct EpollHelper { #[derive(Error, Debug)] pub enum EpollHelperError { - #[error("Failed to create Fd: {0}")] + #[error("Failed to create Fd")] CreateFd(#[source] std::io::Error), - #[error("Failed to epoll_ctl: {0}")] + #[error("Failed to epoll_ctl")] Ctl(#[source] std::io::Error), - #[error("IO error: {0}")] + #[error("IO error")] IoError(#[source] std::io::Error), - #[error("Failed to epoll_wait: {0}")] + #[error("Failed to epoll_wait")] Wait(#[source] std::io::Error), - #[error("Failed to get virtio-queue index: {0}")] + #[error("Failed to get virtio-queue index")] QueueRingIndex(#[source] virtio_queue::Error), - #[error("Failed to handle virtio device events: {0}")] + #[error("Failed to handle virtio device events")] HandleEvent(#[source] anyhow::Error), - #[error("Failed to handle timeout: {0}")] + #[error("Failed to handle timeout")] HandleTimeout(#[source] anyhow::Error), } diff --git a/virtio-devices/src/iommu.rs b/virtio-devices/src/iommu.rs index e6007578c..6a0ccd6be 100644 --- a/virtio-devices/src/iommu.rs +++ b/virtio-devices/src/iommu.rs @@ -292,7 +292,7 @@ unsafe impl ByteValued for VirtioIommuFault {} #[derive(Error, Debug)] enum Error { - #[error("Guest gave us bad memory addresses: {0}")] + #[error("Guest gave us bad memory addresses")] GuestMemory(#[source] GuestMemoryError), #[error("Guest gave us a write only descriptor that protocol says to read from")] UnexpectedWriteOnlyDescriptor, @@ -322,11 +322,11 @@ enum Error { InvalidUnmapRequestMissingDomain, #[error("Guest sent us invalid PROBE request")] InvalidProbeRequest, - #[error("Failed to performing external mapping: {0}")] + #[error("Failed to performing external mapping")] ExternalMapping(#[source] io::Error), - #[error("Failed to performing external unmapping: {0}")] + #[error("Failed to performing external unmapping")] ExternalUnmapping(#[source] io::Error), - #[error("Failed adding used index: {0}")] + #[error("Failed adding used index")] QueueAddUsed(#[source] virtio_queue::Error), } diff --git a/virtio-devices/src/lib.rs b/virtio-devices/src/lib.rs index b666d68e6..6a21eb273 100644 --- a/virtio-devices/src/lib.rs +++ b/virtio-devices/src/lib.rs @@ -87,19 +87,19 @@ const VIRTIO_F_NOTIFICATION_DATA: u32 = 38; pub enum ActivateError { #[error("Failed to activate virtio device")] BadActivate, - #[error("Failed to clone exit event fd: {0}")] + #[error("Failed to clone exit event fd")] CloneExitEventFd(#[source] std::io::Error), - #[error("Failed to spawn thread: {0}")] + #[error("Failed to spawn thread")] ThreadSpawn(#[source] std::io::Error), - #[error("Failed to setup vhost-user-fs daemon: {0}")] + #[error("Failed to setup vhost-user-fs daemon")] VhostUserFsSetup(#[source] vhost_user::Error), - #[error("Failed to setup vhost-user daemon: {0}")] + #[error("Failed to setup vhost-user daemon")] VhostUserSetup(#[source] vhost_user::Error), - #[error("Failed to create seccomp filter: {0}")] + #[error("Failed to create seccomp filter")] CreateSeccompFilter(#[source] seccompiler::Error), - #[error("Failed to create rate limiter: {0}")] + #[error("Failed to create rate limiter")] CreateRateLimiter(#[source] std::io::Error), - #[error("Failed to activate the vDPA device: {0}")] + #[error("Failed to activate the vDPA device")] ActivateVdpa(#[source] vdpa::Error), } @@ -109,21 +109,21 @@ pub type DeviceEventT = u16; #[derive(Error, Debug)] pub enum Error { - #[error("Failed to single used queue: {0}")] + #[error("Failed to single used queue")] FailedSignalingUsedQueue(#[source] io::Error), - #[error("I/O Error: {0}")] + #[error("I/O Error")] IoError(#[source] io::Error), - #[error("Failed to update memory vhost-user: {0}")] + #[error("Failed to update memory vhost-user")] VhostUserUpdateMemory(#[source] vhost_user::Error), - #[error("Failed to add memory region vhost-user: {0}")] + #[error("Failed to add memory region vhost-user")] VhostUserAddMemoryRegion(#[source] vhost_user::Error), #[error("Failed to set shared memory region")] SetShmRegionsNotSupported, - #[error("Failed to process net queue: {0}")] + #[error("Failed to process net queue")] NetQueuePair(#[source] ::net_util::NetQueuePairError), - #[error("Failed to : {0}")] + #[error("Failed to ")] QueueAddUsed(#[source] virtio_queue::Error), - #[error("Failed to : {0}")] + #[error("Failed to ")] QueueIterator(#[source] virtio_queue::Error), } diff --git a/virtio-devices/src/mem.rs b/virtio-devices/src/mem.rs index 32341f19c..5739a12fa 100644 --- a/virtio-devices/src/mem.rs +++ b/virtio-devices/src/mem.rs @@ -101,7 +101,7 @@ const VIRTIO_MEM_F_ACPI_PXM: u8 = 0; #[derive(Error, Debug)] pub enum Error { - #[error("Guest gave us bad memory addresses: {0}")] + #[error("Guest gave us bad memory addresses")] GuestMemory(#[source] GuestMemoryError), #[error("Guest gave us a write only descriptor that protocol says to read from")] UnexpectedWriteOnlyDescriptor, @@ -113,23 +113,23 @@ pub enum Error { BufferLengthTooSmall, #[error("Guest sent us invalid request")] InvalidRequest, - #[error("Failed to EventFd write: {0}")] + #[error("Failed to EventFd write")] EventFdWriteFail(#[source] std::io::Error), - #[error("Failed to EventFd try_clone: {0}")] + #[error("Failed to EventFd try_clone")] EventFdTryCloneFail(#[source] std::io::Error), - #[error("Failed to MpscRecv: {0}")] + #[error("Failed to MpscRecv")] MpscRecvFail(#[source] mpsc::RecvError), - #[error("Resize invalid argument: {0}")] + #[error("Resize invalid argument")] ResizeError(#[source] anyhow::Error), - #[error("Fail to resize trigger: {0}")] + #[error("Fail to resize trigger")] ResizeTriggerFail(#[source] DeviceError), - #[error("Invalid configuration: {0}")] + #[error("Invalid configuration")] ValidateError(#[source] anyhow::Error), - #[error("Failed discarding memory range: {0}")] + #[error("Failed discarding memory range")] DiscardMemoryRange(#[source] std::io::Error), - #[error("Failed DMA mapping: {0}")] + #[error("Failed DMA mapping")] DmaMap(#[source] std::io::Error), - #[error("Failed DMA unmapping: {0}")] + #[error("Failed DMA unmapping")] DmaUnmap(#[source] std::io::Error), #[error("Invalid DMA mapping handler")] InvalidDmaMappingHandler, @@ -137,7 +137,7 @@ pub enum Error { NotActivatedByGuest, #[error("Unknown request type: {0}")] UnknownRequestType(u16), - #[error("Failed adding used index: {0}")] + #[error("Failed adding used index")] QueueAddUsed(#[source] virtio_queue::Error), } diff --git a/virtio-devices/src/net.rs b/virtio-devices/src/net.rs index a5a5cda5d..7d2a4a459 100644 --- a/virtio-devices/src/net.rs +++ b/virtio-devices/src/net.rs @@ -153,11 +153,11 @@ pub const TX_RATE_LIMITER_EVENT: u16 = EPOLL_HELPER_EVENT_LAST + 6; #[derive(Error, Debug)] pub enum Error { - #[error("Failed to open taps: {0}")] + #[error("Failed to open taps")] OpenTap(#[source] OpenTapError), - #[error("Using existing tap: {0}")] + #[error("Using existing tap")] TapError(#[source] TapError), - #[error("Error calling dup() on tap fd: {0}")] + #[error("Error calling dup() on tap fd")] DuplicateTapFd(#[source] std::io::Error), } diff --git a/virtio-devices/src/pmem.rs b/virtio-devices/src/pmem.rs index 7df772955..5f7ee9457 100644 --- a/virtio-devices/src/pmem.rs +++ b/virtio-devices/src/pmem.rs @@ -75,7 +75,7 @@ unsafe impl ByteValued for VirtioPmemResp {} #[derive(Error, Debug)] enum Error { - #[error("Bad guest memory addresses: {0}")] + #[error("Bad guest memory addresses")] GuestMemory(#[source] GuestMemoryError), #[error("Unexpected write-only descriptor")] UnexpectedWriteOnlyDescriptor, @@ -87,7 +87,7 @@ enum Error { BufferLengthTooSmall, #[error("Invalid request")] InvalidRequest, - #[error("Failed adding used index: {0}")] + #[error("Failed adding used index")] QueueAddUsed(#[source] virtio_queue::Error), } diff --git a/virtio-devices/src/rng.rs b/virtio-devices/src/rng.rs index f89e18068..8429e3b31 100644 --- a/virtio-devices/src/rng.rs +++ b/virtio-devices/src/rng.rs @@ -41,9 +41,9 @@ enum Error { DescriptorChainTooShort, #[error("Invalid descriptor")] InvalidDescriptor, - #[error("Failed to write to guest memory: {0}")] + #[error("Failed to write to guest memory")] GuestMemoryWrite(#[source] vm_memory::guest_memory::Error), - #[error("Failed adding used index: {0}")] + #[error("Failed adding used index")] QueueAddUsed(#[source] virtio_queue::Error), } diff --git a/virtio-devices/src/transport/pci_device.rs b/virtio-devices/src/transport/pci_device.rs index c09efacf4..f493e32ab 100644 --- a/virtio-devices/src/transport/pci_device.rs +++ b/virtio-devices/src/transport/pci_device.rs @@ -310,7 +310,7 @@ impl VirtioPciDeviceActivator { #[derive(Error, Debug)] pub enum VirtioPciDeviceError { - #[error("Failed creating VirtioPciDevice: {0}")] + #[error("Failed creating VirtioPciDevice")] CreateVirtioPciDevice(#[source] anyhow::Error), } pub type Result = std::result::Result; diff --git a/virtio-devices/src/vdpa.rs b/virtio-devices/src/vdpa.rs index 2aff2dcfa..7a8952f21 100644 --- a/virtio-devices/src/vdpa.rs +++ b/virtio-devices/src/vdpa.rs @@ -31,59 +31,59 @@ use crate::{ #[derive(Error, Debug)] pub enum Error { - #[error("Failed to create vhost-vdpa: {0}")] + #[error("Failed to create vhost-vdpa")] CreateVhostVdpa(#[source] vhost::Error), - #[error("Failed to map DMA range: {0}")] + #[error("Failed to map DMA range")] DmaMap(#[source] vhost::Error), - #[error("Failed to unmap DMA range: {0}")] + #[error("Failed to unmap DMA range")] DmaUnmap(#[source] vhost::Error), #[error("Failed to get address range")] GetAddressRange, - #[error("Failed to get the available index from the virtio queue: {0}")] + #[error("Failed to get the available index from the virtio queue")] GetAvailableIndex(#[source] virtio_queue::Error), - #[error("Get virtio configuration size: {0}")] + #[error("Get virtio configuration size")] GetConfigSize(#[source] vhost::Error), - #[error("Get virtio device identifier: {0}")] + #[error("Get virtio device identifier")] GetDeviceId(#[source] vhost::Error), - #[error("Failed to get backend specific features: {0}")] + #[error("Failed to get backend specific features")] GetBackendFeatures(#[source] vhost::Error), - #[error("Failed to get virtio features: {0}")] + #[error("Failed to get virtio features")] GetFeatures(#[source] vhost::Error), - #[error("Failed to get the IOVA range: {0}")] + #[error("Failed to get the IOVA range")] GetIovaRange(#[source] vhost::Error), - #[error("Failed to get queue size: {0}")] + #[error("Failed to get queue size")] GetVringNum(#[source] vhost::Error), #[error("Invalid IOVA range: {0}-{1}")] InvalidIovaRange(u64, u64), #[error("Missing VIRTIO_F_ACCESS_PLATFORM feature")] MissingAccessPlatformVirtioFeature, - #[error("Failed to reset owner: {0}")] + #[error("Failed to reset owner")] ResetOwner(#[source] vhost::Error), - #[error("Failed to set backend specific features: {0}")] + #[error("Failed to set backend specific features")] SetBackendFeatures(#[source] vhost::Error), - #[error("Failed to set backend configuration: {0}")] + #[error("Failed to set backend configuration")] SetConfig(#[source] vhost::Error), - #[error("Failed to set eventfd notifying about a configuration change: {0}")] + #[error("Failed to set eventfd notifying about a configuration change")] SetConfigCall(#[source] vhost::Error), - #[error("Failed to set virtio features: {0}")] + #[error("Failed to set virtio features")] SetFeatures(#[source] vhost::Error), - #[error("Failed to set memory table: {0}")] + #[error("Failed to set memory table")] SetMemTable(#[source] vhost::Error), - #[error("Failed to set owner: {0}")] + #[error("Failed to set owner")] SetOwner(#[source] vhost::Error), - #[error("Failed to set virtio status: {0}")] + #[error("Failed to set virtio status")] SetStatus(#[source] vhost::Error), - #[error("Failed to set vring address: {0}")] + #[error("Failed to set vring address")] SetVringAddr(#[source] vhost::Error), - #[error("Failed to set vring base: {0}")] + #[error("Failed to set vring base")] SetVringBase(#[source] vhost::Error), - #[error("Failed to set vring eventfd when buffer are used: {0}")] + #[error("Failed to set vring eventfd when buffer are used")] SetVringCall(#[source] vhost::Error), - #[error("Failed to enable/disable vring: {0}")] + #[error("Failed to enable/disable vring")] SetVringEnable(#[source] vhost::Error), - #[error("Failed to set vring eventfd when new descriptors are available: {0}")] + #[error("Failed to set vring eventfd when new descriptors are available")] SetVringKick(#[source] vhost::Error), - #[error("Failed to set vring size: {0}")] + #[error("Failed to set vring size")] SetVringNum(#[source] vhost::Error), } diff --git a/virtio-devices/src/vhost_user/mod.rs b/virtio-devices/src/vhost_user/mod.rs index 0f4bb80c7..188942721 100644 --- a/virtio-devices/src/vhost_user/mod.rs +++ b/virtio-devices/src/vhost_user/mod.rs @@ -42,85 +42,85 @@ pub use self::vu_common_ctrl::VhostUserConfig; #[derive(Error, Debug)] pub enum Error { - #[error("Failed accepting connection: {0}")] + #[error("Failed accepting connection")] AcceptConnection(#[source] io::Error), #[error("Invalid available address")] AvailAddress, #[error("Queue number is not correct")] BadQueueNum, - #[error("Failed binding vhost-user socket: {0}")] + #[error("Failed binding vhost-user socket")] BindSocket(#[source] io::Error), - #[error("Creating kill eventfd failed: {0}")] + #[error("Creating kill eventfd failed")] CreateKillEventFd(#[source] io::Error), - #[error("Cloning kill eventfd failed: {0}")] + #[error("Cloning kill eventfd failed")] CloneKillEventFd(#[source] io::Error), #[error("Invalid descriptor table address")] DescriptorTableAddress, - #[error("Signal used queue failed: {0}")] + #[error("Signal used queue failed")] FailedSignalingUsedQueue(#[source] io::Error), - #[error("Failed to read vhost eventfd: {0}")] + #[error("Failed to read vhost eventfd")] MemoryRegions(#[source] MmapError), - #[error("Failed removing socket path: {0}")] + #[error("Failed removing socket path")] RemoveSocketPath(#[source] io::Error), - #[error("Failed to create frontend: {0}")] + #[error("Failed to create frontend")] VhostUserCreateFrontend(#[source] VhostError), - #[error("Failed to open vhost device: {0}")] + #[error("Failed to open vhost device")] VhostUserOpen(#[source] VhostError), #[error("Connection to socket failed")] VhostUserConnect, - #[error("Get features failed: {0}")] + #[error("Get features failed")] VhostUserGetFeatures(#[source] VhostError), - #[error("Get queue max number failed: {0}")] + #[error("Get queue max number failed")] VhostUserGetQueueMaxNum(#[source] VhostError), - #[error("Get protocol features failed: {0}")] + #[error("Get protocol features failed")] VhostUserGetProtocolFeatures(#[source] VhostError), - #[error("Get vring base failed: {0}")] + #[error("Get vring base failed")] VhostUserGetVringBase(#[source] VhostError), #[error("Vhost-user Backend not support vhost-user protocol")] VhostUserProtocolNotSupport, - #[error("Set owner failed: {0}")] + #[error("Set owner failed")] VhostUserSetOwner(#[source] VhostError), - #[error("Reset owner failed: {0}")] + #[error("Reset owner failed")] VhostUserResetOwner(#[source] VhostError), - #[error("Set features failed: {0}")] + #[error("Set features failed")] VhostUserSetFeatures(#[source] VhostError), - #[error("Set protocol features failed: {0}")] + #[error("Set protocol features failed")] VhostUserSetProtocolFeatures(#[source] VhostError), - #[error("Set mem table failed: {0}")] + #[error("Set mem table failed")] VhostUserSetMemTable(#[source] VhostError), - #[error("Set vring num failed: {0}")] + #[error("Set vring num failed")] VhostUserSetVringNum(#[source] VhostError), - #[error("Set vring addr failed: {0}")] + #[error("Set vring addr failed")] VhostUserSetVringAddr(#[source] VhostError), - #[error("Set vring base failed: {0}")] + #[error("Set vring base failed")] VhostUserSetVringBase(#[source] VhostError), - #[error("Set vring call failed: {0}")] + #[error("Set vring call failed")] VhostUserSetVringCall(#[source] VhostError), - #[error("Set vring kick failed: {0}")] + #[error("Set vring kick failed")] VhostUserSetVringKick(#[source] VhostError), - #[error("Set vring enable failed: {0}")] + #[error("Set vring enable failed")] VhostUserSetVringEnable(#[source] VhostError), - #[error("Failed to create vhost eventfd: {0}")] + #[error("Failed to create vhost eventfd")] VhostIrqCreate(#[source] io::Error), - #[error("Failed to read vhost eventfd: {0}")] + #[error("Failed to read vhost eventfd")] VhostIrqRead(#[source] io::Error), - #[error("Failed to read vhost eventfd: {0}")] + #[error("Failed to read vhost eventfd")] VhostUserMemoryRegion(#[source] MmapError), - #[error("Failed to create the frontend request handler from backend: {0}")] + #[error("Failed to create the frontend request handler from backend")] FrontendReqHandlerCreation(#[source] vhost::vhost_user::Error), - #[error("Set backend request fd failed: {0}")] + #[error("Set backend request fd failed")] VhostUserSetBackendRequestFd(#[source] vhost::Error), - #[error("Add memory region failed: {0}")] + #[error("Add memory region failed")] VhostUserAddMemReg(#[source] VhostError), - #[error("Failed getting the configuration: {0}")] + #[error("Failed getting the configuration")] VhostUserGetConfig(#[source] VhostError), - #[error("Failed setting the configuration: {0}")] + #[error("Failed setting the configuration")] VhostUserSetConfig(#[source] VhostError), - #[error("Failed getting inflight shm log: {0}")] + #[error("Failed getting inflight shm log")] VhostUserGetInflight(#[source] VhostError), - #[error("Failed setting inflight shm log: {0}")] + #[error("Failed setting inflight shm log")] VhostUserSetInflight(#[source] VhostError), - #[error("Failed setting the log base: {0}")] + #[error("Failed setting the log base")] VhostUserSetLogBase(#[source] VhostError), #[error("Invalid used address")] UsedAddress, @@ -130,17 +130,17 @@ pub enum Error { MissingRegionFd, #[error("Missing IrqFd")] MissingIrqFd, - #[error("Failed getting the available index: {0}")] + #[error("Failed getting the available index")] GetAvailableIndex(#[source] QueueError), #[error("Migration is not supported by this vhost-user device")] MigrationNotSupported, - #[error("Failed creating memfd: {0}")] + #[error("Failed creating memfd")] MemfdCreate(#[source] io::Error), - #[error("Failed truncating the file size to the expected size: {0}")] + #[error("Failed truncating the file size to the expected size")] SetFileSize(#[source] io::Error), - #[error("Failed to set the seals on the file: {0}")] + #[error("Failed to set the seals on the file")] SetSeals(#[source] io::Error), - #[error("Failed creating new mmap region: {0}")] + #[error("Failed creating new mmap region")] NewMmapRegion(#[source] MmapRegionError), #[error("Could not find the shm log region")] MissingShmLogRegion, diff --git a/virtio-devices/src/vsock/csm/mod.rs b/virtio-devices/src/vsock/csm/mod.rs index 9e02ac854..69de7073d 100644 --- a/virtio-devices/src/vsock/csm/mod.rs +++ b/virtio-devices/src/vsock/csm/mod.rs @@ -32,10 +32,10 @@ pub enum Error { #[error("TX buffer full")] TxBufFull, /// An I/O error occurred, when attempting to flush the connection TX buffer. - #[error("Error flushing TX buffer: {0}")] + #[error("Error flushing TX buffer")] TxBufFlush(#[source] std::io::Error), /// An I/O error occurred, when attempting to write data to the host-side stream. - #[error("Error writing to host side stream: {0}")] + #[error("Error writing to host side stream")] StreamWrite(#[source] std::io::Error), } diff --git a/virtio-devices/src/vsock/unix/mod.rs b/virtio-devices/src/vsock/unix/mod.rs index 6250e41e9..13c988319 100644 --- a/virtio-devices/src/vsock/unix/mod.rs +++ b/virtio-devices/src/vsock/unix/mod.rs @@ -31,34 +31,34 @@ mod defs { #[derive(Error, Debug)] pub enum Error { /// Error converting from UTF-8 - #[error("Error converting from UTF-8: {0}")] + #[error("Error converting from UTF-8")] ConvertFromUtf8(#[source] std::str::Utf8Error), /// Error registering a new epoll-listening FD. - #[error("Error registering a new epoll-listening FD: {0}")] + #[error("Error registering a new epoll-listening FD")] EpollAdd(#[source] std::io::Error), /// Error creating an epoll FD. - #[error("Error creating an epoll FD: {0}")] + #[error("Error creating an epoll FD")] EpollFdCreate(#[source] std::io::Error), /// The host made an invalid vsock port connection request. #[error("The host made an invalid vsock port connection request")] InvalidPortRequest, /// Error parsing integer. - #[error("Error parsing integer: {0}")] + #[error("Error parsing integer")] ParseInteger(#[source] std::num::ParseIntError), /// Error reading stream port. - #[error("Error reading stream port: {0}")] + #[error("Error reading stream port")] ReadStreamPort(#[source] Box), /// Error accepting a new connection from the host-side Unix socket. - #[error("Error accepting a new connection from the host-side Unix socket: {0}")] + #[error("Error accepting a new connection from the host-side Unix socket")] UnixAccept(#[source] std::io::Error), /// Error binding to the host-side Unix socket. - #[error("Error binding to the host-side Unix socket: {0}")] + #[error("Error binding to the host-side Unix socket")] UnixBind(#[source] std::io::Error), /// Error connecting to a host-side Unix socket. - #[error("Error connecting to a host-side Unix socket: {0}")] + #[error("Error connecting to a host-side Unix socket")] UnixConnect(#[source] std::io::Error), /// Error reading from host-side Unix socket. - #[error("Error reading from host-side Unix socket: {0}")] + #[error("Error reading from host-side Unix socket")] UnixRead(#[source] std::io::Error), /// Muxer connection limit reached. #[error("Muxer connection limit reached")] diff --git a/virtio-devices/src/watchdog.rs b/virtio-devices/src/watchdog.rs index 4e36f79bb..fdfc977d9 100644 --- a/virtio-devices/src/watchdog.rs +++ b/virtio-devices/src/watchdog.rs @@ -48,15 +48,15 @@ const WATCHDOG_TIMEOUT: u64 = WATCHDOG_TIMER_INTERVAL as u64 + 5; #[derive(Error, Debug)] enum Error { - #[error("Error programming timer fd: {0}")] + #[error("Error programming timer fd")] TimerfdSetup(#[source] io::Error), #[error("Descriptor chain too short")] DescriptorChainTooShort, - #[error("Failed adding used index: {0}")] + #[error("Failed adding used index")] QueueAddUsed(#[source] virtio_queue::Error), #[error("Invalid descriptor")] InvalidDescriptor, - #[error("Failed to write to guest memory: {0}")] + #[error("Failed to write to guest memory")] GuestMemoryWrite(#[source] vm_memory::guest_memory::Error), }