dm: use MAX_VM_NAME_LEN instead of MAX_VMNAME_LEN

use the common MAX_VM_NAME_LEN to keep sync with hypervisor.

Tracked-On: #6685
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
This commit is contained in:
Mingqiang Chi 2021-11-16 16:01:42 +08:00 committed by wenlingz
parent b864cef228
commit a87fa12895
4 changed files with 5 additions and 6 deletions

View File

@ -1007,8 +1007,8 @@ main(int argc, char *argv[])
vmname = argv[0]; vmname = argv[0];
if (strnlen(vmname, MAX_VMNAME_LEN) >= MAX_VMNAME_LEN) { if (strnlen(vmname, MAX_VM_NAME_LEN) >= MAX_VM_NAME_LEN) {
pr_err("The name of the VM exceeds the maximum length: %u\n", MAX_VMNAME_LEN - 1); pr_err("The name of the VM exceeds the maximum length: %u\n", MAX_VM_NAME_LEN - 1);
exit(1); exit(1);
} }

View File

@ -210,7 +210,7 @@ vm_create(const char *name, uint64_t req_buf, int *vcpu_num)
/* command line arguments specified CPU affinity could overwrite HV's static configuration */ /* command line arguments specified CPU affinity could overwrite HV's static configuration */
create_vm.cpu_affinity = cpu_affinity_bitmap; create_vm.cpu_affinity = cpu_affinity_bitmap;
strncpy((char *)create_vm.name, name, strnlen(name, MAX_VMNAME_LEN)); strncpy((char *)create_vm.name, name, strnlen(name, MAX_VM_NAME_LEN));
if (is_rtvm) { if (is_rtvm) {
create_vm.vm_flag |= GUEST_FLAG_RT; create_vm.vm_flag |= GUEST_FLAG_RT;

View File

@ -91,7 +91,7 @@ typedef void* (*ioc_work)(void *arg);
* IOC mediator and virtual UART communication channel path, * IOC mediator and virtual UART communication channel path,
* comes from DM command line parameters. * comes from DM command line parameters.
*/ */
static char virtual_uart_path[32 + MAX_VMNAME_LEN]; static char virtual_uart_path[32 + MAX_VM_NAME_LEN];
/* /*
* To activate CBC signal channel(/dev/cbc-signals). * To activate CBC signal channel(/dev/cbc-signals).

View File

@ -32,8 +32,7 @@
#include <stdbool.h> #include <stdbool.h>
#include "types.h" #include "types.h"
#include "dm_string.h" #include "dm_string.h"
#include "acrn_common.h"
#define MAX_VMNAME_LEN 16U
struct vmctx; struct vmctx;
extern uint8_t trusty_enabled; extern uint8_t trusty_enabled;