mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 04:34:27 +00:00
fix(clippy): fix clippy error
Fixes: #5030 Signed-off-by: Yushuo <y-shuo@linux.alibaba.com> Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
This commit is contained in:
parent
67972ec48a
commit
7b1e67819c
@ -494,6 +494,10 @@ impl CloudHypervisorInner {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) async fn resize_vcpu(&self, old_vcpu: u32, new_vcpu: u32) -> Result<(u32, u32)> {
|
||||||
|
Ok((old_vcpu, new_vcpu))
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) async fn get_pids(&self) -> Result<Vec<u32>> {
|
pub(crate) async fn get_pids(&self) -> Result<Vec<u32>> {
|
||||||
Ok(Vec::<u32>::new())
|
Ok(Vec::<u32>::new())
|
||||||
}
|
}
|
||||||
|
@ -114,6 +114,11 @@ impl Hypervisor for CloudHypervisor {
|
|||||||
inner.cleanup().await
|
inner.cleanup().await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn resize_vcpu(&self, old_vcpu: u32, new_vcpu: u32) -> Result<(u32, u32)> {
|
||||||
|
let inner = self.inner.read().await;
|
||||||
|
inner.resize_vcpu(old_vcpu, new_vcpu).await
|
||||||
|
}
|
||||||
|
|
||||||
async fn get_pids(&self) -> Result<Vec<u32>> {
|
async fn get_pids(&self) -> Result<Vec<u32>> {
|
||||||
let inner = self.inner.read().await;
|
let inner = self.inner.read().await;
|
||||||
inner.get_pids().await
|
inner.get_pids().await
|
||||||
|
@ -331,7 +331,7 @@ impl DragonballInner {
|
|||||||
// the error in this function is not ok to be tolerated, the container boot will fail
|
// the error in this function is not ok to be tolerated, the container boot will fail
|
||||||
fn precheck_resize_vcpus(&self, old_vcpus: u32, new_vcpus: u32) -> Result<(u32, u32)> {
|
fn precheck_resize_vcpus(&self, old_vcpus: u32, new_vcpus: u32) -> Result<(u32, u32)> {
|
||||||
// old_vcpus > 0, safe for conversion
|
// old_vcpus > 0, safe for conversion
|
||||||
let current_vcpus = old_vcpus as u32;
|
let current_vcpus = old_vcpus;
|
||||||
|
|
||||||
// a non-zero positive is required
|
// a non-zero positive is required
|
||||||
if new_vcpus == 0 {
|
if new_vcpus == 0 {
|
||||||
|
@ -173,7 +173,7 @@ impl CgroupsResource {
|
|||||||
}
|
}
|
||||||
ResourceUpdateOp::Update | ResourceUpdateOp::Del => {
|
ResourceUpdateOp::Update | ResourceUpdateOp::Del => {
|
||||||
if let Some(old_resource) = old_resources {
|
if let Some(old_resource) = old_resources {
|
||||||
resources.insert(cid.to_owned(), old_resource.clone());
|
resources.insert(cid.to_owned(), old_resource);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user