net_util, virtio-devices, vhost_user_net: Relocate code for opening TAP

By moving the code for opening the TAP device into a shared location we
are starting to remove the requirement for the vhost-user-net backend to
depend on the virtio-devices crate which in of itself depends on many
other crates that are not necessary for the backend to function.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-07-07 15:02:18 +01:00
parent bb390981a9
commit 3e807a19b7
7 changed files with 140 additions and 119 deletions
+4 -2
View File
@@ -11,13 +11,14 @@
#[macro_use]
extern crate lazy_static;
extern crate libc;
extern crate net_gen;
extern crate rand;
extern crate serde;
extern crate net_gen;
extern crate virtio_bindings;
extern crate vmm_sys_util;
mod mac;
mod open_tap;
mod tap;
use std::io::Error as IoError;
@@ -26,6 +27,7 @@ use std::net;
use std::os::unix::io::FromRawFd;
pub use mac::{MacAddr, MAC_ADDR_LEN};
pub use open_tap::{open_tap, Error as OpenTapError};
pub use tap::{Error as TapError, Tap};
#[derive(Debug)]