dm:send shutdown to life_mngr on SOS

it will send shutdown command to life_mngr on SOS
after the UOS has poweroff itself

Tracked-On: #4446
Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Reviewed-by: Minggui Cao <minggui.cao@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Mingqiang Chi 2020-03-06 00:03:25 +08:00 committed by wenlingz
parent f78558a4fd
commit 910ac9f917

View File

@ -319,6 +319,21 @@ void pm_by_vuart_init(struct vmctx *ctx)
void pm_by_vuart_deinit(struct vmctx *ctx)
{
/* it indicates that acrn-dm has received shutdown command
* from UOS in this state, and it will send shutdown command
* to life_mngr running on SOS to shutdown system after UOS
* has poweroff itself.
*/
if (pm_monitor_state == SHUTDOWN_REQ_FROM_UOS) {
/* send shutdown command to life_mngr running on SOS */
if (send_shutdown_to_lifemngr() != 0) {
pr_err("send shutdown to life-management failed\r\n");
}
}
pthread_cancel(pm_monitor_thread);
pthread_join(pm_monitor_thread, NULL);
close(node_fd);
node_fd = -1;
}