dm: add S3 support for UOS

We do:
 - pause target vm
 - suspend all virtual devices
 - wait for resume notification
 - resume all virtual devices
 - reset target vm

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yin Fengwei
2018-05-21 16:49:57 +08:00
committed by lijinxia
parent 8ee4c0b1dd
commit a8a27d82d0
4 changed files with 71 additions and 2 deletions

View File

@@ -316,6 +316,8 @@ mevent_dispatch(void)
assert(pipev != NULL);
for (;;) {
int suspend_mode;
/*
* Block awaiting events
*/
@@ -328,8 +330,11 @@ mevent_dispatch(void)
*/
mevent_handle(eventlist, ret);
if ((vm_get_suspend_mode() != VM_SUSPEND_NONE) &&
(vm_get_suspend_mode() != VM_SUSPEND_SYSTEM_RESET))
suspend_mode = vm_get_suspend_mode();
if ((suspend_mode != VM_SUSPEND_NONE) &&
(suspend_mode != VM_SUSPEND_SYSTEM_RESET) &&
(suspend_mode != VM_SUSPEND_SUSPEND))
break;
}
}