tools: acrnd: Fix launch UOS by timer list without fork()

When acrnd_vm_timer_func() launch UOS, it need fork() and run, so
that do not block the main process.

Tracked-On: #2716
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
Acked-by: Yan, Like <like.yan@intel.com>
This commit is contained in:
yuhong.tao@intel.com 2019-01-08 15:22:14 +00:00 committed by wenlingz
parent 5d6f6ab798
commit 204f9750a8
1 changed files with 4 additions and 1 deletions

View File

@ -122,6 +122,7 @@ unsigned get_sos_wakeup_reason(void);
void acrnd_vm_timer_func(struct work_arg *arg)
{
struct vmmngr_struct *vm;
pid_t pid;
if (!arg) {
printf("%s: No work argument configured\n", __func__);
@ -137,7 +138,9 @@ void acrnd_vm_timer_func(struct work_arg *arg)
switch (vm->state) {
case VM_CREATED:
acrnd_run_vm(arg->name);
pid = fork();
if (!pid)
acrnd_run_vm(vm->name);
break;
case VM_SUSPENDED:
resume_vm(arg->name, CBC_WK_RSN_RTC);