acrn-dm: add some logs for vm state transition

add logs for vm state transition to help
analyze some problems.

Tracked-On: #4098
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Mingqiang Chi
2020-05-12 11:04:44 +08:00
committed by wenlingz
parent e58609ad1f
commit 4d3221a7f3
7 changed files with 30 additions and 4 deletions

View File

@@ -615,6 +615,7 @@ vm_system_reset(struct vmctx *ctx)
vm_reset_vdevs(ctx);
vm_reset(ctx);
pr_info("%s: setting VM state to %s\n", __func__, vm_state_to_str(VM_SUSPEND_NONE));
vm_set_suspend_mode(VM_SUSPEND_NONE);
/* set the BSP init state */
@@ -711,7 +712,8 @@ num_vcpus_allowed(struct vmctx *ctx)
static void
sig_handler_term(int signo)
{
printf("Receive SIGINT to terminate application...\n");
pr_info("Received SIGINT to terminate application...\n");
pr_info("%s: setting VM state to %s\n", __func__, vm_state_to_str(VM_SUSPEND_POWEROFF));
vm_set_suspend_mode(VM_SUSPEND_POWEROFF);
mevent_notify();
}
@@ -1065,6 +1067,7 @@ main(int argc, char *argv[])
vm_destroy(ctx);
_ctx = 0;
pr_info("%s: setting VM state to %s\n", __func__, vm_state_to_str(VM_SUSPEND_NONE));
vm_set_suspend_mode(VM_SUSPEND_NONE);
}