From a853c0554674e29daa9e36837a64ad2321e1f0b5 Mon Sep 17 00:00:00 2001 From: "yuhong.tao@intel.com" Date: Mon, 22 Oct 2018 15:02:42 +0000 Subject: [PATCH] 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 Acked-by: Yan, Like --- tools/acrn-manager/acrnctl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/acrn-manager/acrnctl.c b/tools/acrn-manager/acrnctl.c index f3022bdd3..e32bd40af 100644 --- a/tools/acrn-manager/acrnctl.c +++ b/tools/acrn-manager/acrnctl.c @@ -18,8 +18,10 @@ #include #include #include +#include #include "acrn_mngr.h" #include "acrnctl.h" +#include "ioc.h" #define ACRNCTL_OPT_ROOT "/opt/acrn/conf" @@ -468,7 +470,7 @@ static int acrnctl_do_suspend(int argc, char *argv[]) static int acrnctl_do_resume(int argc, char *argv[]) { struct vmmngr_struct *s; - unsigned reason = 0; + unsigned reason = CBC_WK_RSN_BTN; s = vmmngr_find(argv[1]); if (!s) { @@ -479,7 +481,8 @@ static int acrnctl_do_resume(int argc, char *argv[]) if (argc == 3) { sscanf(argv[2], "%x", &reason); reason = (reason & (0xff << 24)) ? 0 : reason; - } + } else + printf("No wake up reason, use 0x%x\n", reason); switch (s->state) { case VM_PAUSED: