DM: Decouple and increase kernel boot args length

Currently, we use STR_LEN for all checking the size of all the
acrn-dm parameters. But some parameters like kernel boot args
can grow based on different needs. For example, when kata launches
guest VM using acrn, the kernel boot args increases by 256 bytes
(i.e 1024 +256).

Just increasing STR_LEN will unnecessarily increase allocations
for other acrn-dm parameters. So decoupling only boot_args
length and increasing it to 2048.

PS: If other parameters like ramdisk path, kernel path,
elf_path etc. don't need 1024 bytes, we can reduce STR_LEN
to 256 or 512 bytes.

Tracked-On: #3138
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Vijay Dhanraj 2019-05-17 17:12:32 -07:00 committed by ACRN System Integration
parent f2fe35472b
commit f010f99d67
2 changed files with 4 additions and 3 deletions

View File

@ -36,7 +36,7 @@
#include "pci_core.h"
int with_bootargs;
static char bootargs[STR_LEN];
static char bootargs[BOOT_ARG_LEN];
/*
* Default e820 mem map:
@ -106,9 +106,9 @@ const struct e820_entry e820_default_entries[NUM_E820_ENTRIES] = {
int
acrn_parse_bootargs(char *arg)
{
size_t len = strnlen(arg, STR_LEN);
size_t len = strnlen(arg, BOOT_ARG_LEN);
if (len < STR_LEN) {
if (len < BOOT_ARG_LEN) {
strncpy(bootargs, arg, len + 1);
with_bootargs = 1;
printf("SW_LOAD: get bootargs %s\n", bootargs);

View File

@ -29,6 +29,7 @@
#define _CORE_SW_LOAD_
#define STR_LEN 1024
#define BOOT_ARG_LEN 2048
/* E820 memory types */
#define E820_TYPE_RAM 1 /* EFI 1, 2, 3, 4, 5, 6, 7 */