mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-02 13:44:33 +00:00
rust-agent: Remove or rename unused parameters
Parameters that are never used were removed. Parameters that are unused, but necessary because of some common interface were renamed with a _ prefix. In one case, consume the parameter by adding an info! call, and fix a minor typo in a message in the same function. This addresses the following warning: warning: unused variable: `child` --> rustjail/src/container.rs:1128:5 | 1128 | child: &mut Child, | ^^^^^ help: if this is intentional, prefix it with an underscore: `_child` warning: unused variable: `logger` --> rustjail/src/container.rs:1049:22 | 1049 | fn update_namespaces(logger: &Logger, spec: &mut Spec, init_pid: RawFd) -> Result<()> { | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_logger` Fixes: #750 Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
This commit is contained in:
parent
5a1d331135
commit
f832d8a651
@ -230,7 +230,7 @@ impl CgroupManager for Manager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn set_network_resources(
|
fn set_network_resources(
|
||||||
cg: &cgroups::Cgroup,
|
_cg: &cgroups::Cgroup,
|
||||||
network: &LinuxNetwork,
|
network: &LinuxNetwork,
|
||||||
res: &mut cgroups::Resources,
|
res: &mut cgroups::Resources,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
@ -259,7 +259,7 @@ fn set_network_resources(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn set_devices_resources(
|
fn set_devices_resources(
|
||||||
cg: &cgroups::Cgroup,
|
_cg: &cgroups::Cgroup,
|
||||||
device_resources: &Vec<LinuxDeviceCgroup>,
|
device_resources: &Vec<LinuxDeviceCgroup>,
|
||||||
res: &mut cgroups::Resources,
|
res: &mut cgroups::Resources,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
@ -288,7 +288,7 @@ fn set_devices_resources(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn set_hugepages_resources(
|
fn set_hugepages_resources(
|
||||||
cg: &cgroups::Cgroup,
|
_cg: &cgroups::Cgroup,
|
||||||
hugepage_limits: &Vec<LinuxHugepageLimit>,
|
hugepage_limits: &Vec<LinuxHugepageLimit>,
|
||||||
res: &mut cgroups::Resources,
|
res: &mut cgroups::Resources,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
|
@ -888,7 +888,6 @@ impl BaseContainer for LinuxContainer {
|
|||||||
&p,
|
&p,
|
||||||
self.cgroup_manager.as_ref().unwrap(),
|
self.cgroup_manager.as_ref().unwrap(),
|
||||||
&st,
|
&st,
|
||||||
&mut child,
|
|
||||||
pwfd,
|
pwfd,
|
||||||
prfd,
|
prfd,
|
||||||
) {
|
) {
|
||||||
@ -1039,8 +1038,9 @@ fn do_exec(args: &[String]) -> ! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn update_namespaces(logger: &Logger, spec: &mut Spec, init_pid: RawFd) -> Result<()> {
|
fn update_namespaces(logger: &Logger, spec: &mut Spec, init_pid: RawFd) -> Result<()> {
|
||||||
|
info!(logger, "updating namespaces");
|
||||||
let linux = match spec.linux.as_mut() {
|
let linux = match spec.linux.as_mut() {
|
||||||
None => return Err(anyhow!("Spec didn't container linux field")),
|
None => return Err(anyhow!("Spec didn't contain linux field")),
|
||||||
Some(l) => l,
|
Some(l) => l,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1117,7 +1117,6 @@ fn join_namespaces(
|
|||||||
p: &Process,
|
p: &Process,
|
||||||
cm: &FsManager,
|
cm: &FsManager,
|
||||||
st: &OCIState,
|
st: &OCIState,
|
||||||
_child: &mut Child,
|
|
||||||
pwfd: RawFd,
|
pwfd: RawFd,
|
||||||
prfd: RawFd,
|
prfd: RawFd,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
|
Loading…
Reference in New Issue
Block a user