mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-13 21:09:31 +00:00
runtime-rs: add default_maxmemory in config file
add default_maxmemory in config file Fixes:#6875 Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
This commit is contained in:
@@ -653,6 +653,13 @@ pub struct MemoryInfo {
|
||||
/// If swap_in_bytes and memory_limit_in_bytes is not set, the size should be default_memory.
|
||||
#[serde(default)]
|
||||
pub enable_guest_swap: bool,
|
||||
|
||||
/// Default maximum memory in MiB per SB / VM
|
||||
/// unspecified or == 0 --> will be set to the actual amount of physical RAM
|
||||
/// > 0 <= amount of physical RAM --> will be set to the specified number
|
||||
/// > amount of physical RAM --> will be set to the actual amount of physical RAM
|
||||
#[serde(default)]
|
||||
pub default_maxmemory: u32,
|
||||
}
|
||||
|
||||
impl MemoryInfo {
|
||||
|
@@ -124,6 +124,8 @@ DEFMEMSZ := 2048
|
||||
# - vm template memory
|
||||
# - hugepage memory
|
||||
DEFMEMSLOTS := 10
|
||||
# Default maximum memory in MiB
|
||||
DEFMAXMEMSZ := 0
|
||||
##VAR DEFBRIDGES=<number> Default number of bridges
|
||||
DEFBRIDGES := 0
|
||||
DEFENABLEANNOTATIONS := [\"kernel_params\"]
|
||||
@@ -307,6 +309,7 @@ USER_VARS += DEFMAXVCPUS_ACRN
|
||||
USER_VARS += DEFMAXVCPUS_DB
|
||||
USER_VARS += DEFMEMSZ
|
||||
USER_VARS += DEFMEMSLOTS
|
||||
USER_VARS += DEFMAXMEMSZ
|
||||
USER_VARS += DEFBRIDGES
|
||||
USER_VARS += DEFNETWORKMODEL_DB
|
||||
USER_VARS += DEFNETWORKMODEL_CLH
|
||||
|
@@ -101,6 +101,13 @@ default_bridges = @DEFBRIDGES@
|
||||
# If unspecified then it will be set @DEFMEMSZ@ MiB.
|
||||
default_memory = @DEFMEMSZ@
|
||||
|
||||
# Default maximum memory in MiB per SB / VM
|
||||
# unspecified or == 0 --> will be set to the actual amount of physical RAM
|
||||
# > 0 <= amount of physical RAM --> will be set to the specified number
|
||||
# > amount of physical RAM --> will be set to the actual amount of physical RAM
|
||||
default_maxmemory = @DEFMAXMEMSZ@
|
||||
|
||||
|
||||
# Block storage driver to be used for the hypervisor in case the container
|
||||
# rootfs is backed by a block device. DB only supports virtio-blk.
|
||||
block_device_driver = "@DEFBLOCKSTORAGEDRIVER_DB@"
|
||||
|
Reference in New Issue
Block a user