tools:acrn-crashlog: update operations about vmrecord

Replace vmrecord file operations with new functions in vmrecord.c.

Tracked-On: #1024
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Reviewed-by: Liu, Xiaojing <xiaojing.liu@intel.com>
Acked-by: Chen, Gang <gang.c.chen@intel.com>
This commit is contained in:
Liu, Xinwu
2019-04-18 16:00:38 +08:00
committed by ACRN System Integration
parent b5236f21fd
commit 84cf7156ae
5 changed files with 53 additions and 154 deletions

View File

@@ -1093,12 +1093,13 @@ int init_sender(void)
if (!sender)
continue;
ret = asprintf(&sender->log_vmrecordid, "%s/VM_eventsID.log",
ret = asprintf(&sender->vmrecord.path, "%s/VM_eventsID.log",
sender->outdir);
if (ret < 0) {
LOGE("compute string failed, out of memory\n");
return -ENOMEM;
}
pthread_mutex_init(&sender->vmrecord.mtx, NULL);
if (!directory_exists(sender->outdir))
if (mkdir_p(sender->outdir) < 0) {