Skip to content

Commit a853c05

Browse files
taoyuhongNanlinXie
authored andcommitted
tools: acrnctl: fix: resume default wakeup reason is CBC_WK_RSN_BTN
UOS requires an wakeup reason when resumed from S3 suspend. If user use "acrnctl resume [VMNAME]" without an reason, 0x0 will be used as default reason, and this is not work. We can use CBC_WK_RSN_BTN instead. Tracked-On: #1550 Signed-off-by: Tao, Yuhong <yuhong.tao@intel.com> Acked-by: Yan, Like <like.yan@intel.com>
1 parent a6677e6 commit a853c05

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/acrn-manager/acrnctl.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818
#include <sys/queue.h>
1919
#include <sys/socket.h>
2020
#include <sys/un.h>
21+
#include <stdbool.h>
2122
#include "acrn_mngr.h"
2223
#include "acrnctl.h"
24+
#include "ioc.h"
2325

2426
#define ACRNCTL_OPT_ROOT "/opt/acrn/conf"
2527

@@ -468,7 +470,7 @@ static int acrnctl_do_suspend(int argc, char *argv[])
468470
static int acrnctl_do_resume(int argc, char *argv[])
469471
{
470472
struct vmmngr_struct *s;
471-
unsigned reason = 0;
473+
unsigned reason = CBC_WK_RSN_BTN;
472474

473475
s = vmmngr_find(argv[1]);
474476
if (!s) {
@@ -479,7 +481,8 @@ static int acrnctl_do_resume(int argc, char *argv[])
479481
if (argc == 3) {
480482
sscanf(argv[2], "%x", &reason);
481483
reason = (reason & (0xff << 24)) ? 0 : reason;
482-
}
484+
} else
485+
printf("No wake up reason, use 0x%x\n", reason);
483486

484487
switch (s->state) {
485488
case VM_PAUSED:

0 commit comments

Comments
 (0)