tools: acrnctl fix cmd buffer is truncated when vmname too long

'acrnctl start vmname' use a cmd buffer with a sizeof 128 bytes,
cmd[128] buffer will be truncated, when vmnane size is bigger than
29 bytes. In that situation, vmnane size still smaller than
MAX_VM_OS_NAME_LEN, so it should be fixed.
Macro PATH_LEN is useful to determine the cmd[] buffer length, so move
it from acrn_mngr.c into acrn_mngr.h

Tracked-On: #2851
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Reviewed-by: Yan Like <like.yan@intel.com>
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
yuhong.tao@intel.com
2019-03-11 20:56:02 +08:00
committed by wenlingz
parent b2f2d95246
commit 5a7be9b869
4 changed files with 17 additions and 18 deletions

View File

@@ -40,7 +40,6 @@ static int check_dir(const char *path)
#define MNGR_SOCK_FMT "/run/acrn/mngr/%s.%d.socket"
#define MNGR_MAX_HANDLER 8
#define MNGR_MAX_CLIENT 4
#define PATH_LEN 128
#define CLIENT_BUF_LEN 4096