Skip to content

Commit b1586cc

Browse files
taoyuhongwenlingz
authored andcommitted
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 <yuhong.tao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent c55308b commit b1586cc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

hypervisor/include/arch/x86/vm_config.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
#include <types.h>
1111
#include <pci.h>
1212
#include <multiboot.h>
13-
14-
#define MAX_CONFIG_NAME_SIZE 32U
13+
#include <acrn_common.h>
1514

1615
#define PLUG_CPU(n) (1U << (n))
1716

@@ -33,7 +32,7 @@ struct acrn_vm_mem_config {
3332
};
3433

3534
struct acrn_vm_os_config {
36-
char name[MAX_CONFIG_NAME_SIZE]; /* OS name, useful for debug */
35+
char name[MAX_VM_OS_NAME_LEN]; /* OS name, useful for debug */
3736
char bootargs[MAX_BOOTARGS_SIZE]; /* boot args/cmdline */
3837
} __aligned(8);
3938

@@ -44,7 +43,7 @@ struct acrn_vm_pci_ptdev_config {
4443

4544
struct acrn_vm_config {
4645
enum acrn_vm_type type; /* specify the type of VM */
47-
char name[MAX_CONFIG_NAME_SIZE]; /* VM name identifier, useful for debug. */
46+
char name[MAX_VM_OS_NAME_LEN]; /* VM name identifier, useful for debug. */
4847
uint8_t GUID[16]; /* GUID of the VM */
4948
uint64_t pcpu_bitmap; /* from pcpu bitmap, we could know VM core number */
5049
uint64_t guest_flags; /* VM flags that we want to configure for guest

hypervisor/include/public/acrn_common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ struct acrn_create_vm {
357357
uint8_t reserved2[16];
358358
} __aligned(8);
359359

360+
#define MAX_VM_OS_NAME_LEN 32U
361+
360362
/**
361363
* @brief Info to create a VCPU
362364
*

0 commit comments

Comments
 (0)