mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 13:05:45 +00:00
hypervisor: kvm: aarch64: Trigger reset upon KVM_SYSTEM_EVENT_RESET
This will trigger Vm::vm_reboot to make the VM reboot. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
b076602b87
commit
c4dc25de09
@ -723,10 +723,12 @@ impl cpu::Vcpu for KvmVcpu {
|
|||||||
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
VcpuExit::SystemEvent(event_type, flags) => {
|
VcpuExit::SystemEvent(event_type, flags) => {
|
||||||
use kvm_bindings::KVM_SYSTEM_EVENT_SHUTDOWN;
|
use kvm_bindings::{KVM_SYSTEM_EVENT_RESET, KVM_SYSTEM_EVENT_SHUTDOWN};
|
||||||
// On Aarch64, when the VM is shutdown, run() returns
|
// On Aarch64, when the VM is shutdown, run() returns
|
||||||
// VcpuExit::SystemEvent with reason KVM_SYSTEM_EVENT_SHUTDOWN
|
// VcpuExit::SystemEvent with reason KVM_SYSTEM_EVENT_SHUTDOWN
|
||||||
if event_type == KVM_SYSTEM_EVENT_SHUTDOWN {
|
if event_type == KVM_SYSTEM_EVENT_SHUTDOWN
|
||||||
|
|| event_type == KVM_SYSTEM_EVENT_RESET
|
||||||
|
{
|
||||||
Ok(cpu::VmExit::Reset)
|
Ok(cpu::VmExit::Reset)
|
||||||
} else {
|
} else {
|
||||||
Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(
|
Err(cpu::HypervisorCpuError::RunVcpu(anyhow!(
|
||||||
|
Loading…
Reference in New Issue
Block a user