mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-03-20 07:58:55 +00:00
virtio-devices: net: Derive thiserror::Error
Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
parent
54c484397e
commit
a7f3620564
@ -32,6 +32,7 @@ use std::sync::{Arc, Barrier};
|
||||
use std::thread;
|
||||
use std::vec::Vec;
|
||||
use std::{collections::HashMap, convert::TryInto};
|
||||
use thiserror::Error;
|
||||
use versionize::{VersionMap, Versionize, VersionizeResult};
|
||||
use versionize_derive::Versionize;
|
||||
use virtio_bindings::bindings::virtio_net::*;
|
||||
@ -138,15 +139,13 @@ pub const RX_RATE_LIMITER_EVENT: u16 = EPOLL_HELPER_EVENT_LAST + 5;
|
||||
// New 'wake up' event from the tx rate limiter
|
||||
pub const TX_RATE_LIMITER_EVENT: u16 = EPOLL_HELPER_EVENT_LAST + 6;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Error, Debug)]
|
||||
pub enum Error {
|
||||
/// Failed to open taps.
|
||||
#[error("Failed to open taps: {0}")]
|
||||
OpenTap(OpenTapError),
|
||||
|
||||
// Using existing tap
|
||||
#[error("Using existing tap: {0}")]
|
||||
TapError(TapError),
|
||||
|
||||
// Error calling dup() on tap fd
|
||||
#[error("Error calling dup() on tap fd: {0}")]
|
||||
DuplicateTapFd(std::io::Error),
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user