mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 01:54:44 +00:00
tools: acrnctl restrict length of vmname to 32 bytes
When run 'acrnctl add launch_script.sh', vmname will be detected from the launch script and stored in vmmngr_struct.name[MAX_VM_OS_NAME_LEN], so vmname should not be longer than MAX_VM_OS_NAME_LEN. Tracked-On: #2851 Signed-off-by: Tao Yuhong <yuhong.tao@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
committed by
wenlingz
parent
8109c2e94c
commit
b2f2d95246
@@ -7,6 +7,8 @@
|
||||
#define _ACRNCTL_H_
|
||||
|
||||
#include <sys/queue.h>
|
||||
#include <acrn_common.h>
|
||||
#include "acrn_mngr.h"
|
||||
|
||||
#define ACRN_CONF_PATH "/usr/share/acrn/conf"
|
||||
#define ACRN_CONF_PATH_ADD ACRN_CONF_PATH "/add"
|
||||
@@ -14,8 +16,6 @@
|
||||
|
||||
#define ACRN_DM_SOCK_PATH "/run/acrn/mngr"
|
||||
|
||||
#define MAX_NAME_LEN (32)
|
||||
|
||||
enum vm_state {
|
||||
VM_STATE_UNKNOWN = 0,
|
||||
VM_CREATED, /* VM created / awaiting start (boot) */
|
||||
@@ -36,7 +36,7 @@ struct vmmngr_struct *vmmngr_find(const char *vmname);
|
||||
|
||||
/* Per-vm vm managerment struct */
|
||||
struct vmmngr_struct {
|
||||
char name[MAX_NAME_LEN];
|
||||
char name[MAX_VM_OS_NAME_LEN];
|
||||
unsigned long state;
|
||||
unsigned long state_tmp;
|
||||
unsigned long update; /* update count, remove a vm if no update for it */
|
||||
|
||||
Reference in New Issue
Block a user