mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-15 06:44:58 +00:00
DM: restrict vmname size to 32 bytes
Length of vmname is restricted to MAX_VM_OS_NAME_LEN. Keep it coincide with VM name array size in vm_config. Tracked-On: #2851 Signed-off-by: Tao Yuhong <yuhong.tao@intel.com> Acked-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
b1586ccc3e
commit
8109c2e94c
@ -924,6 +924,10 @@ dm_run(int argc, char *argv[])
|
||||
}
|
||||
|
||||
vmname = argv[0];
|
||||
if (strnlen(vmname, MAX_VM_OS_NAME_LEN) >= MAX_VM_OS_NAME_LEN) {
|
||||
fprintf(stderr, "vmname size exceed %u\n",MAX_VM_OS_NAME_LEN);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
ctx = vm_create(vmname, (unsigned long)vhm_req_buf);
|
||||
|
@ -100,7 +100,7 @@ typedef void* (*ioc_work)(void *arg);
|
||||
* IOC mediator and virtual UART communication channel path,
|
||||
* comes from DM command line parameters.
|
||||
*/
|
||||
static char virtual_uart_path[32];
|
||||
static char virtual_uart_path[32 + MAX_VM_OS_NAME_LEN];
|
||||
|
||||
/*
|
||||
* To activate CBC signal channel(/dev/cbc-signals).
|
||||
|
Loading…
Reference in New Issue
Block a user