mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-17 15:38:00 +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(
|
} => Arc::new(
|
||||||
VhostUserEndpoint::new(
|
VhostUserEndpoint::new(
|
||||||
dev_mgr,
|
dev_mgr,
|
||||||
idx as u32,
|
|
||||||
&name,
|
&name,
|
||||||
&device.guest_mac,
|
&device.guest_mac,
|
||||||
path,
|
path,
|
||||||
@ -104,7 +103,6 @@ impl DanInner {
|
|||||||
} => Arc::new(
|
} => Arc::new(
|
||||||
TapEndpoint::new(
|
TapEndpoint::new(
|
||||||
&handle,
|
&handle,
|
||||||
idx as u32,
|
|
||||||
&name,
|
&name,
|
||||||
tap_name,
|
tap_name,
|
||||||
&device.guest_mac,
|
&device.guest_mac,
|
||||||
|
@ -21,9 +21,6 @@ use crate::network::{utils, EndpointState};
|
|||||||
/// TapEndpoint is used to attach to the hypervisor directly
|
/// TapEndpoint is used to attach to the hypervisor directly
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct TapEndpoint {
|
pub struct TapEndpoint {
|
||||||
// Index
|
|
||||||
#[allow(dead_code)]
|
|
||||||
index: u32,
|
|
||||||
// Name of virt interface
|
// Name of virt interface
|
||||||
name: String,
|
name: String,
|
||||||
// Hardware address of virt interface
|
// Hardware address of virt interface
|
||||||
@ -42,7 +39,6 @@ impl TapEndpoint {
|
|||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub async fn new(
|
pub async fn new(
|
||||||
handle: &rtnetlink::Handle,
|
handle: &rtnetlink::Handle,
|
||||||
index: u32,
|
|
||||||
name: &str,
|
name: &str,
|
||||||
tap_name: &str,
|
tap_name: &str,
|
||||||
guest_mac: &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")?;
|
utils::get_mac_addr(&tap_link.attrs().hardware_addr).context("Get mac addr of tap")?;
|
||||||
|
|
||||||
Ok(TapEndpoint {
|
Ok(TapEndpoint {
|
||||||
index,
|
|
||||||
name: name.to_owned(),
|
name: name.to_owned(),
|
||||||
guest_mac: guest_mac.to_owned(),
|
guest_mac: guest_mac.to_owned(),
|
||||||
tap_iface: NetworkInterface {
|
tap_iface: NetworkInterface {
|
||||||
|
@ -18,9 +18,6 @@ use crate::network::EndpointState;
|
|||||||
/// VhostUserEndpoint uses vhost-user-net device, which supports DPDK, etc.
|
/// VhostUserEndpoint uses vhost-user-net device, which supports DPDK, etc.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct VhostUserEndpoint {
|
pub struct VhostUserEndpoint {
|
||||||
// Endpoint index
|
|
||||||
#[allow(dead_code)]
|
|
||||||
index: u32,
|
|
||||||
// Name of virt interface
|
// Name of virt interface
|
||||||
name: String,
|
name: String,
|
||||||
// Hardware address of virt interface
|
// Hardware address of virt interface
|
||||||
@ -38,7 +35,6 @@ pub struct VhostUserEndpoint {
|
|||||||
impl VhostUserEndpoint {
|
impl VhostUserEndpoint {
|
||||||
pub async fn new(
|
pub async fn new(
|
||||||
dev_mgr: &Arc<RwLock<DeviceManager>>,
|
dev_mgr: &Arc<RwLock<DeviceManager>>,
|
||||||
index: u32,
|
|
||||||
name: &str,
|
name: &str,
|
||||||
guest_mac: &str,
|
guest_mac: &str,
|
||||||
socket_path: &str,
|
socket_path: &str,
|
||||||
@ -51,7 +47,6 @@ impl VhostUserEndpoint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ok(VhostUserEndpoint {
|
Ok(VhostUserEndpoint {
|
||||||
index,
|
|
||||||
name: name.to_string(),
|
name: name.to_string(),
|
||||||
guest_mac: guest_mac.to_string(),
|
guest_mac: guest_mac.to_string(),
|
||||||
socket_path: socket_path.to_string(),
|
socket_path: socket_path.to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user