net_util, virtio-devices: Move TAP register/unregister helpers

Move these helper functions into net_util so that they can be used from
code inside there.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-07-07 16:06:54 +01:00
parent 7f3e40e0cf
commit 1237784a8f
5 changed files with 40 additions and 37 deletions

View File

@@ -6,9 +6,9 @@
// found in the THIRD-PARTY file.
use super::net_util::{
build_net_config_space, build_net_config_space_with_mq, register_listener, unregister_listener,
CtrlVirtio, NetCtrlEpollHandler, VirtioNetConfig, KILL_EVENT, NET_EVENTS_COUNT, PAUSE_EVENT,
RX_QUEUE_EVENT, RX_TAP_EVENT, TX_QUEUE_EVENT,
build_net_config_space, build_net_config_space_with_mq, CtrlVirtio, NetCtrlEpollHandler,
VirtioNetConfig, KILL_EVENT, NET_EVENTS_COUNT, PAUSE_EVENT, RX_QUEUE_EVENT, RX_TAP_EVENT,
TX_QUEUE_EVENT,
};
use super::Error as DeviceError;
use super::{
@@ -18,7 +18,10 @@ use crate::VirtioInterrupt;
use anyhow::anyhow;
use libc::EAGAIN;
use libc::EFD_NONBLOCK;
use net_util::{open_tap, MacAddr, OpenTapError, RxVirtio, Tap, TxVirtio};
use net_util::{
open_tap, register_listener, unregister_listener, MacAddr, OpenTapError, RxVirtio, Tap,
TxVirtio,
};
use std::cmp;
use std::collections::HashMap;
use std::fs::File;