diff --git a/net_util/src/lib.rs b/net_util/src/lib.rs index 90a6e1080..a28bcc433 100644 --- a/net_util/src/lib.rs +++ b/net_util/src/lib.rs @@ -40,7 +40,7 @@ pub use tap::{Error as TapError, Tap}; #[derive(Error, Debug)] pub enum Error { - #[error("Failed to create a socket: {0}")] + #[error("Failed to create a socket")] CreateSocket(#[source] IoError), } diff --git a/net_util/src/open_tap.rs b/net_util/src/open_tap.rs index 28be56c6f..10d71b29f 100644 --- a/net_util/src/open_tap.rs +++ b/net_util/src/open_tap.rs @@ -12,27 +12,27 @@ use super::{vnet_hdr_len, MacAddr, Tap, TapError}; #[derive(Error, Debug)] pub enum Error { - #[error("Failed to convert an hexadecimal string into an integer: {0}")] + #[error("Failed to convert an hexadecimal string into an integer")] ConvertHexStringToInt(#[source] std::num::ParseIntError), #[error("Error related to the multiqueue support (no support TAP side)")] MultiQueueNoTapSupport, #[error("Error related to the multiqueue support (no support device side)")] MultiQueueNoDeviceSupport, - #[error("Failed to read the TAP flags from sysfs: {0}")] + #[error("Failed to read the TAP flags from sysfs")] ReadSysfsTunFlags(#[source] io::Error), - #[error("Open tap device failed: {0}")] + #[error("Open tap device failed")] TapOpen(#[source] TapError), - #[error("Setting tap IP and/or netmask failed: {0}")] + #[error("Setting tap IP and/or netmask failed")] TapSetIpNetmask(#[source] TapError), - #[error("Setting MAC address failed: {0}")] + #[error("Setting MAC address failed")] TapSetMac(#[source] TapError), - #[error("Getting MAC address failed: {0}")] + #[error("Getting MAC address failed")] TapGetMac(#[source] TapError), - #[error("Setting vnet header size failed: {0}")] + #[error("Setting vnet header size failed")] TapSetVnetHdrSize(#[source] TapError), - #[error("Setting MTU failed: {0}")] + #[error("Setting MTU failed")] TapSetMtu(#[source] TapError), - #[error("Enabling tap interface failed: {0}")] + #[error("Enabling tap interface failed")] TapEnable(#[source] TapError), } diff --git a/net_util/src/queue_pair.rs b/net_util/src/queue_pair.rs index 5a9bd41fb..f28d759fe 100644 --- a/net_util/src/queue_pair.rs +++ b/net_util/src/queue_pair.rs @@ -353,27 +353,27 @@ pub struct NetCounters { pub enum NetQueuePairError { #[error("No memory configured")] NoMemoryConfigured, - #[error("Error registering listener: {0}")] + #[error("Error registering listener")] RegisterListener(#[source] io::Error), - #[error("Error unregistering listener: {0}")] + #[error("Error unregistering listener")] UnregisterListener(#[source] io::Error), - #[error("Error writing to the TAP device: {0}")] + #[error("Error writing to the TAP device")] WriteTap(#[source] io::Error), - #[error("Error reading from the TAP device: {0}")] + #[error("Error reading from the TAP device")] ReadTap(#[source] io::Error), - #[error("Error related to guest memory: {0}")] + #[error("Error related to guest memory")] GuestMemory(#[source] vm_memory::GuestMemoryError), - #[error("Returned an error while iterating through the queue: {0}")] + #[error("Returned an error while iterating through the queue")] QueueIteratorFailed(#[source] virtio_queue::Error), #[error("Descriptor chain is too short")] DescriptorChainTooShort, #[error("Descriptor chain does not contain valid descriptors")] DescriptorChainInvalid, - #[error("Failed to determine if queue needed notification: {0}")] + #[error("Failed to determine if queue needed notification")] QueueNeedsNotification(#[source] virtio_queue::Error), - #[error("Failed to enable notification on the queue: {0}")] + #[error("Failed to enable notification on the queue")] QueueEnableNotification(#[source] virtio_queue::Error), - #[error("Failed to add used index to the queue: {0}")] + #[error("Failed to add used index to the queue")] QueueAddUsed(#[source] virtio_queue::Error), #[error("Descriptor with invalid virtio-net header")] DescriptorInvalidHeader, diff --git a/net_util/src/tap.rs b/net_util/src/tap.rs index 877acadde..3a6e8591c 100644 --- a/net_util/src/tap.rs +++ b/net_util/src/tap.rs @@ -22,21 +22,21 @@ use crate::mac::MAC_ADDR_LEN; #[derive(Error, Debug)] pub enum Error { - #[error("Couldn't open /dev/net/tun: {0}")] + #[error("Couldn't open /dev/net/tun")] OpenTun(#[source] IoError), - #[error("Unable to configure tap interface: {0}")] + #[error("Unable to configure tap interface")] ConfigureTap(#[source] IoError), - #[error("Unable to retrieve features: {0}")] + #[error("Unable to retrieve features")] GetFeatures(#[source] IoError), #[error("Missing multiqueue support in the kernel")] MultiQueueKernelSupport, #[error("ioctl ({0}) failed: {1}")] IoctlError(c_ulong, #[source] IoError), - #[error("Failed to create a socket: {0}")] + #[error("Failed to create a socket")] NetUtil(#[source] NetUtilError), #[error("Invalid interface name")] InvalidIfname, - #[error("Error parsing MAC data: {0}")] + #[error("Error parsing MAC data")] MacParsing(#[source] IoError), #[error("Invalid netmask")] InvalidNetmask,