tools: acrnctl: Fix path error when run "acrnctl add" cmd

There is a bug to run 'acrnctl add /[path]/script.sh', when the
launch script has an absolute path. Acrnctl will generate wrong path
for temp files and fail to add VM.

And message '/opt/acrn/conf: No such file or directory' always comes
out, until user once successfully run 'acrnctl add' cmd. That is reported
by _scan_added_vm(), because 'opt/acrn' is missing, only 'acrnctl add'
can create it, we should also check it in _scan_added_vm().

Tracked-On: #2013
Acked-by: Yan, Like <like.yan@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This commit is contained in:
yuhong.tao@intel.com
2018-12-04 15:48:06 +00:00
committed by wenlingz
parent 9761eede2a
commit 7ee0e2e2a4
2 changed files with 7 additions and 4 deletions

View File

@@ -223,6 +223,9 @@ static void _scan_added_vm(void)
char suffix[128];
int ret;
if (check_dir("/opt") || check_dir("/opt/acrn"))
return;
ret = check_dir(ACRNCTL_OPT_ROOT);
if (ret) {
pdebug();