HV: life_mngr: refine platform shutdown when User VM fails to shutdown

Currently, the lifecycle manager in Service VM will issue poweroff
command to shutdown service VM when User VM fails to shutdown. The
post-launched RTVM with virtio device may hang after Service VM
shutdown.

In this patch, the lifecycle manager in Service VM will stop to
shut down service VM when User VM fails to shutdown. Users have
chance to fix User VM shutdown failure (such as forcelly shutdown
User VM or execute poweroff command in User VM), after the failure
is fixed, user can trigger S5 in service VM to shutdown platform
gracefully.

Tracked-On: #6652

Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
This commit is contained in:
Xiangyang Wu 2021-11-22 14:34:00 +08:00 committed by wenlingz
parent 417c369feb
commit 93d0ad543e
1 changed files with 6 additions and 5 deletions

View File

@ -68,11 +68,12 @@ static void start_system_shutdown(void)
LOG_WRITE("UART connection list is empty, will trigger shutdown system\n");
close_socket(sock_server);
stop_listen_uart_channel_dev(channel);
if (wait_post_vms_shutdown())
LOG_WRITE("Service VM start to power off here\n");
else
LOG_WRITE("Timeout waiting for VMs poweroff, will force poweroff VMs\n");
system_shutdown_flag = true;
if (wait_post_vms_shutdown()) {
LOG_WRITE("Service VM starts to power off.\n");
system_shutdown_flag = true;
} else {
LOG_WRITE("Some User VMs failed to power off, cancelled the platform shut down process.\n");
}
}
}