dm: introduce system/full reset and suspend

Guest has erquirement to support system/full reboot and S3. Which could
trigger different reset path in guest

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yin Fengwei
2018-05-21 16:32:32 +08:00
committed by lijinxia
parent 76662a634f
commit 8d12c06270
6 changed files with 24 additions and 15 deletions

View File

@@ -42,6 +42,7 @@
#include "ps2kbd.h"
#include "ps2mouse.h"
#include "vmmapi.h"
#include "mevent.h"
static void
atkbdc_assert_kbd_intr(struct atkbdc_base *base)
@@ -359,8 +360,9 @@ atkbdc_sts_ctl_handler(struct vmctx *ctx, int vcpu, int in, int port,
base->status |= KBDS_AUX_BUFFER_FULL |
KBDS_KBD_BUFFER_FULL;
break;
case KBDC_RESET: /* Pulse "reset" line */
error = vm_suspend(ctx, VM_SUSPEND_RESET);
case KBDC_RESET: /* Pulse "cold reset" line */
error = vm_suspend(ctx, VM_SUSPEND_FULL_RESET);
mevent_notify();
assert(error == 0 || errno == EALREADY);
break;
default: