diff --git a/src/agent/src/config.rs b/src/agent/src/config.rs index 3c64215c84..6441b07a19 100644 --- a/src/agent/src/config.rs +++ b/src/agent/src/config.rs @@ -26,10 +26,6 @@ const VSOCK_PORT: u16 = 1024; const SERVER_ADDR_ENV_VAR: &str = "KATA_AGENT_SERVER_ADDR"; const LOG_LEVEL_ENV_VAR: &str = "KATA_AGENT_LOG_LEVEL"; -// FIXME: unused -const TRACE_MODE_FLAG: &str = "agent.trace"; -const USE_VSOCK_FLAG: &str = "agent.use_vsock"; - #[derive(Debug)] pub struct agentConfig { pub debug_console: bool, diff --git a/src/agent/src/main.rs b/src/agent/src/main.rs index 677c70fa5e..7bfac8a701 100644 --- a/src/agent/src/main.rs +++ b/src/agent/src/main.rs @@ -6,7 +6,6 @@ #![allow(non_camel_case_types)] #![allow(unused_parens)] #![allow(unused_unsafe)] -#![allow(dead_code)] #[macro_use] extern crate lazy_static; extern crate oci; diff --git a/src/agent/src/namespace.rs b/src/agent/src/namespace.rs index 116152121a..6e0d98828f 100644 --- a/src/agent/src/namespace.rs +++ b/src/agent/src/namespace.rs @@ -68,6 +68,7 @@ impl Namespace { self } + #[allow(dead_code)] pub fn set_root_dir(mut self, dir: &str) -> Self { self.persistent_ns_dir = dir.to_string(); self diff --git a/src/agent/src/netlink.rs b/src/agent/src/netlink.rs index 274487a6c6..a851c5ae77 100644 --- a/src/agent/src/netlink.rs +++ b/src/agent/src/netlink.rs @@ -40,6 +40,7 @@ pub enum AddressFilter { /// Return addresses that belong to the given interface. LinkIndex(u32), /// Get addresses with the given prefix. + #[allow(dead_code)] IpAddress(IpAddr), } @@ -215,17 +216,6 @@ impl Handle { Ok(()) } - pub async fn delete_links(&mut self, list: I) -> Result<()> - where - I: IntoIterator, - { - for index in list.into_iter() { - self.handle.link().del(index).execute().await?; - } - - Ok(()) - } - async fn query_routes( &self, ip_version: Option, @@ -742,6 +732,7 @@ impl Address { self.0.header.family == packet::constants::AF_INET6 as u8 } + #[allow(dead_code)] fn prefix(&self) -> u8 { self.0.header.prefix_len } diff --git a/src/agent/src/sandbox.rs b/src/agent/src/sandbox.rs index 10022c0458..60ffd3d3bd 100644 --- a/src/agent/src/sandbox.rs +++ b/src/agent/src/sandbox.rs @@ -150,14 +150,6 @@ impl Sandbox { Ok(()) } - pub fn is_running(&self) -> bool { - self.running - } - - pub fn set_hostname(&mut self, hostname: String) { - self.hostname = hostname; - } - pub async fn setup_shared_namespaces(&mut self) -> Result { // Set up shared IPC namespace self.shared_ipcns = Namespace::new(&self.logger) @@ -732,25 +724,6 @@ mod tests { assert!(s.hooks.as_ref().unwrap().poststop.is_empty()); } - #[tokio::test] - async fn test_sandbox_is_running() { - let logger = slog::Logger::root(slog::Discard, o!()); - let mut s = Sandbox::new(&logger).unwrap(); - s.running = true; - assert!(s.is_running()); - s.running = false; - assert!(!s.is_running()); - } - - #[tokio::test] - async fn test_sandbox_set_hostname() { - let logger = slog::Logger::root(slog::Discard, o!()); - let mut s = Sandbox::new(&logger).unwrap(); - let hostname = "abc123"; - s.set_hostname(hostname.to_string()); - assert_eq!(s.hostname, hostname); - } - #[tokio::test] async fn test_sandbox_set_destroy() { let logger = slog::Logger::root(slog::Discard, o!()); diff --git a/src/agent/src/version.rs.in b/src/agent/src/version.rs.in index 07132fad94..6b2c528fce 100644 --- a/src/agent/src/version.rs.in +++ b/src/agent/src/version.rs.in @@ -7,6 +7,8 @@ // WARNING: This file is auto-generated - DO NOT EDIT! // +#![allow(dead_code)] + pub const AGENT_VERSION: &str = "@AGENT_VERSION@"; pub const API_VERSION: &str = "@API_VERSION@"; pub const VERSION_COMMIT: &str = "@VERSION_COMMIT@";