mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-15 14:43:51 +00:00
runtime-rs: Remove unused index from Endpoints
The affected `Endpoint`s are `VhostUserEndpoint` and `TapEndpoint`. Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
This commit is contained in:
parent
60a42351e2
commit
f2d08bc00f
@ -87,7 +87,6 @@ impl DanInner {
|
||||
} => Arc::new(
|
||||
VhostUserEndpoint::new(
|
||||
dev_mgr,
|
||||
idx as u32,
|
||||
&name,
|
||||
&device.guest_mac,
|
||||
path,
|
||||
@ -104,7 +103,6 @@ impl DanInner {
|
||||
} => Arc::new(
|
||||
TapEndpoint::new(
|
||||
&handle,
|
||||
idx as u32,
|
||||
&name,
|
||||
tap_name,
|
||||
&device.guest_mac,
|
||||
|
@ -21,9 +21,6 @@ use crate::network::{utils, EndpointState};
|
||||
/// TapEndpoint is used to attach to the hypervisor directly
|
||||
#[derive(Debug)]
|
||||
pub struct TapEndpoint {
|
||||
// Index
|
||||
#[allow(dead_code)]
|
||||
index: u32,
|
||||
// Name of virt interface
|
||||
name: String,
|
||||
// Hardware address of virt interface
|
||||
@ -42,7 +39,6 @@ impl TapEndpoint {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub async fn new(
|
||||
handle: &rtnetlink::Handle,
|
||||
index: u32,
|
||||
name: &str,
|
||||
tap_name: &str,
|
||||
guest_mac: &str,
|
||||
@ -57,7 +53,6 @@ impl TapEndpoint {
|
||||
utils::get_mac_addr(&tap_link.attrs().hardware_addr).context("Get mac addr of tap")?;
|
||||
|
||||
Ok(TapEndpoint {
|
||||
index,
|
||||
name: name.to_owned(),
|
||||
guest_mac: guest_mac.to_owned(),
|
||||
tap_iface: NetworkInterface {
|
||||
|
@ -18,9 +18,6 @@ use crate::network::EndpointState;
|
||||
/// VhostUserEndpoint uses vhost-user-net device, which supports DPDK, etc.
|
||||
#[derive(Debug)]
|
||||
pub struct VhostUserEndpoint {
|
||||
// Endpoint index
|
||||
#[allow(dead_code)]
|
||||
index: u32,
|
||||
// Name of virt interface
|
||||
name: String,
|
||||
// Hardware address of virt interface
|
||||
@ -38,7 +35,6 @@ pub struct VhostUserEndpoint {
|
||||
impl VhostUserEndpoint {
|
||||
pub async fn new(
|
||||
dev_mgr: &Arc<RwLock<DeviceManager>>,
|
||||
index: u32,
|
||||
name: &str,
|
||||
guest_mac: &str,
|
||||
socket_path: &str,
|
||||
@ -51,7 +47,6 @@ impl VhostUserEndpoint {
|
||||
}
|
||||
|
||||
Ok(VhostUserEndpoint {
|
||||
index,
|
||||
name: name.to_string(),
|
||||
guest_mac: guest_mac.to_string(),
|
||||
socket_path: socket_path.to_string(),
|
||||
|
Loading…
Reference in New Issue
Block a user