Skip to content

Commit 8c2ab95

Browse files
taoyuhongacrnsi
authored andcommitted
tools: acrnd: fix wait_for_stop() return wrong vm state
Ported form apl_sdc_stable branch. The wait_for_stop() first check if all VM are stopped or suspended. It first check if VMs are stopped, then check if they are suspend. If the VMs change state from running to stoped, after check VMs stopped fail, before start check suspend state. wait_for_stop() will mistake resopnse 'All vms have entered S3 state successfully' To fix that, wait_for_stop() must only update VMs's state once, and see if they are stopped, or suspended. Tracked-On: #2398 Signed-off-by: Tao Yuhong <yuhong.tao@intel.com> Signed-off-by: Wei Liu <weix.w.liu@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Yan, Like <like.yan@intel.com>
1 parent 2b900a4 commit 8c2ab95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/acrn-manager/acrnd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,8 @@ static int check_vms_status(unsigned int status)
453453
{
454454
struct vmmngr_struct *s;
455455

456-
vmmngr_update();
457-
458456
LIST_FOREACH(s, &vmmngr_head, list)
459-
if (s->state != status && s->state != VM_CREATED)
457+
if (s->state != status)
460458
return -1;
461459

462460
return 0;
@@ -470,6 +468,8 @@ static int wait_for_stop(unsigned int timeout)
470468

471469
/* list and update the vm status */
472470
do {
471+
vmmngr_update();
472+
473473
printf("Waiting %lu seconds for all vms enter S3/S5 state\n", t);
474474

475475
if (check_vms_status(VM_CREATED) == 0) {

0 commit comments

Comments
 (0)