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:
Zhongtao Hu
2023-06-21 17:51:53 +08:00
parent 8d9fd9c067
commit 6039417104
3 changed files with 17 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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@"