mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-06-30 23:12:36 +00:00
vmm,cpu: Deny resizing only if the vcpu amount has changed
188078467d
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…
Reference in New Issue
Block a user