Skip to content

Commit 910ac9f

Browse files
mingqiangchiwenlingz
authored andcommitted
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>
1 parent f78558a commit 910ac9f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

devicemodel/core/pm_vuart.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,21 @@ void pm_by_vuart_init(struct vmctx *ctx)
319319

320320
void pm_by_vuart_deinit(struct vmctx *ctx)
321321
{
322+
/* it indicates that acrn-dm has received shutdown command
323+
* from UOS in this state, and it will send shutdown command
324+
* to life_mngr running on SOS to shutdown system after UOS
325+
* has poweroff itself.
326+
*/
327+
if (pm_monitor_state == SHUTDOWN_REQ_FROM_UOS) {
328+
/* send shutdown command to life_mngr running on SOS */
329+
if (send_shutdown_to_lifemngr() != 0) {
330+
pr_err("send shutdown to life-management failed\r\n");
331+
}
332+
}
333+
334+
pthread_cancel(pm_monitor_thread);
335+
pthread_join(pm_monitor_thread, NULL);
336+
322337
close(node_fd);
323338
node_fd = -1;
324339
}

0 commit comments

Comments
 (0)