hv: not necessary to deal with '\n' of cmdline in ACRN.

We removed '\n' in bootargs file so there is no '\n' attached
to cmdline when stitching ACRN. Then we don't need to deal with
it in ACRN.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <Eddie.dong@intel.com>
This commit is contained in:
Yin Fengwei 2018-05-21 23:31:23 +08:00 committed by lijinxia
parent 198f2003c2
commit b2c2ca2ecd
2 changed files with 5 additions and 7 deletions

View File

@ -95,7 +95,7 @@ static void parse_other_modules(struct vm *vm,
vm->sw.linux_info.bootargs_src_addr = load_addr;
}
strcpy_s(load_addr + args_size - 1,
strcpy_s(load_addr + args_size,
100, dyn_bootargs);
vm->sw.linux_info.bootargs_size =
strnlen_s(load_addr, MEM_2K);

View File

@ -190,12 +190,11 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
#ifdef CONFIG_CMA
/* add "cma=XXXXM@0xXXXXXXXX" to cmdline*/
if (is_vm0(vm) && (e820_mem.max_ram_blk_size > 0)) {
snprintf(dyn_bootargs, 100, " cma=%dM@0x%llx\n",
snprintf(dyn_bootargs, 100, " cma=%dM@0x%llx",
(e820_mem.max_ram_blk_size >> 20),
e820_mem.max_ram_blk_base);
/* Delete '\n' at the end of cmdline */
strcpy_s((char *)hva
+vm->sw.linux_info.bootargs_size - 1,
+vm->sw.linux_info.bootargs_size,
100, dyn_bootargs);
}
#else
@ -215,11 +214,10 @@ int general_sw_loader(struct vm *vm, struct vcpu *vcpu)
#endif
if (reserving_1g_pages > 0) {
snprintf(dyn_bootargs, 100,
" hugepagesz=1G hugepages=%d\n",
" hugepagesz=1G hugepages=%d",
reserving_1g_pages);
/* Delete '\n' at the end of cmdline */
strcpy_s((char *)hva
+vm->sw.linux_info.bootargs_size - 1,
+vm->sw.linux_info.bootargs_size,
100, dyn_bootargs);
}
}