mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 03:12:27 +00:00
vmm,cpu: Deny resizing only if the vcpu amount has changed
188078467db42f50f5b7e7a7969738ebf8aec95c made clear that resize should only happen when dealing with a "dynamic" CpuManager. Although this is very much correct, it causes a regression on Kata Containers (and on any other consumer of Cloud Hypervisor) in cases where a resize would be triggered but the vCPUs values wouldn't be changed. There's no doubt Kata Containers could do better and do not call a resize in such situations, and that's something that should **also** be solved there. However, we should also work this around on Cloud Hypervisor side as it introduces a regression with the current Kata Containers code. Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
db06c31305
commit
2c8045343c
@ -1129,6 +1129,10 @@ impl CpuManager {
|
||||
}
|
||||
|
||||
pub fn resize(&mut self, desired_vcpus: u8) -> Result<bool> {
|
||||
if desired_vcpus.cmp(&self.present_vcpus()) == cmp::Ordering::Equal {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
if !self.dynamic {
|
||||
return Err(Error::ResizingNotSupported);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user