From b1586ccc3e8f9e2e8d91478ca7c4eff6cb173046 Mon Sep 17 00:00:00 2001 From: "yuhong.tao@intel.com" Date: Tue, 19 Mar 2019 11:13:14 +0000 Subject: [PATCH] HV: move MAX_CONFIG_NAME_SIZE to acrn_common.h The vm_config in hypervisor restricted VM name size to MAX_CONFIG_NAME_SIZE (32 bytes). When UOS is launched by DM, the vmname is passed in as the last optional args, we hope to to copy it to vm_config in the future. So the size of vmname in DM args should be restricted to MAX_CONFIG_NAME_SIZE, too. Because MAX_CONFIG_NAME_SIZE will be used by DM, we move it from vm_config.h to acrn_common.h We also rename MAX_CONFIG_NAME_SIZE to MAX_VM_OS_NAME_LEN, because it will be used by another components, should has a clear name. Tracked-On: #2851 Signed-off-by: Tao Yuhong Acked-by: Eddie Dong --- hypervisor/include/arch/x86/vm_config.h | 7 +++---- hypervisor/include/public/acrn_common.h | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hypervisor/include/arch/x86/vm_config.h b/hypervisor/include/arch/x86/vm_config.h index cbe6cbba1..2142082b2 100644 --- a/hypervisor/include/arch/x86/vm_config.h +++ b/hypervisor/include/arch/x86/vm_config.h @@ -10,8 +10,7 @@ #include #include #include - -#define MAX_CONFIG_NAME_SIZE 32U +#include #define PLUG_CPU(n) (1U << (n)) @@ -33,7 +32,7 @@ struct acrn_vm_mem_config { }; struct acrn_vm_os_config { - char name[MAX_CONFIG_NAME_SIZE]; /* OS name, useful for debug */ + char name[MAX_VM_OS_NAME_LEN]; /* OS name, useful for debug */ char bootargs[MAX_BOOTARGS_SIZE]; /* boot args/cmdline */ } __aligned(8); @@ -44,7 +43,7 @@ struct acrn_vm_pci_ptdev_config { struct acrn_vm_config { enum acrn_vm_type type; /* specify the type of VM */ - char name[MAX_CONFIG_NAME_SIZE]; /* VM name identifier, useful for debug. */ + char name[MAX_VM_OS_NAME_LEN]; /* VM name identifier, useful for debug. */ uint8_t GUID[16]; /* GUID of the VM */ uint64_t pcpu_bitmap; /* from pcpu bitmap, we could know VM core number */ uint64_t guest_flags; /* VM flags that we want to configure for guest diff --git a/hypervisor/include/public/acrn_common.h b/hypervisor/include/public/acrn_common.h index 07c6b9b42..814a6b702 100644 --- a/hypervisor/include/public/acrn_common.h +++ b/hypervisor/include/public/acrn_common.h @@ -357,6 +357,8 @@ struct acrn_create_vm { uint8_t reserved2[16]; } __aligned(8); +#define MAX_VM_OS_NAME_LEN 32U + /** * @brief Info to create a VCPU *