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.
Acked-by: Yan, Like
@@ -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);
