mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-30 12:44:39 +00:00
runtime-rs: handle default_vcpus greator than default_maxvcpu
when the default_vcpus is greater than the default_maxvcpus, the default vcpu number should be set equal to the default_maxvcpus. Fixes: #4712 Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
This commit is contained in:
parent
540303880e
commit
43045be8d1
@ -65,6 +65,10 @@ impl ConfigPlugin for DragonballConfig {
|
||||
db.cpu_info.default_maxvcpus = default::MAX_DRAGONBALL_VCPUS;
|
||||
}
|
||||
|
||||
if db.cpu_info.default_vcpus as u32 > db.cpu_info.default_maxvcpus {
|
||||
db.cpu_info.default_vcpus = db.cpu_info.default_maxvcpus as i32;
|
||||
}
|
||||
|
||||
if db.machine_info.entropy_source.is_empty() {
|
||||
db.machine_info.entropy_source =
|
||||
default::DEFAULT_DRAGONBALL_ENTROPY_SOURCE.to_string();
|
||||
|
Loading…
Reference in New Issue
Block a user