Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Commit

Permalink
Add VM pause support
Browse files Browse the repository at this point in the history
Check if Qemu wants to pause VM. If yes, don't enter guest. This is
used in snapshot scenario that Qemu pauses VM and tell HAXM not to
enter guest after it finishes the last guest IO/MMIO instruction.

Signed-off-by: Hang Yuan <hang.yuan@intel.com>
  • Loading branch information
hyuan3 committed Sep 25, 2019
1 parent 1958f91 commit dca031c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/vcpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1711,6 +1711,14 @@ int vcpu_execute(struct vcpu_t *vcpu)
goto out;
}
}

// Check if Qemu pauses VM
if (htun->_exit_reason == HAX_EXIT_PAUSED) {
htun->_exit_status = HAX_EXIT_PAUSED;
hax_log(HAX_LOGD, "vcpu paused\n");
goto out;
}

err = cpu_vmx_execute(vcpu, htun);
vcpu_is_panic(vcpu);
out:
Expand Down

0 comments on commit dca031c

Please sign in to comment.