Handle aborting VMs.
Change-Id: Ib5e40a41f398125e82bb6e5f9b884f682d7592eb
diff --git a/main.c b/main.c
index 9ae60c0..9ff6e32 100644
--- a/main.c
+++ b/main.c
@@ -293,6 +293,8 @@
vcpu->timer.function = &hf_vcpu_timer_expired;
while (!kthread_should_stop()) {
+ uint32_t i;
+
/*
* We're about to run the vcpu, so we can reset the abort-sleep
* flag.
@@ -346,6 +348,15 @@
case HF_VCPU_RUN_NOTIFY_WAITERS:
hf_notify_waiters(vcpu->vm->id);
break;
+
+ case HF_VCPU_RUN_ABORTED:
+ for (i = 0; i < vcpu->vm->vcpu_count; i++) {
+ if (i == vcpu->vcpu_index)
+ continue;
+ hf_handle_wake_up_request(vcpu->vm->id, i, 0);
+ }
+ hf_vcpu_sleep(vcpu);
+ break;
}
}