bhyve: Assert success in a couple of libvmmapi calls

- In vmexit_smccc(), copy an assertion from amd64.
- In fbsdrun_addcpu(), make sure that our vm_suspend_cpu() call is
  succesful.

Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D46197
This commit is contained in:
Mark Johnston
2024-07-31 22:40:51 +00:00
parent 2e2b8afa52
commit 4c5188bbeb
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -249,7 +249,8 @@ vmexit_smccc(struct vmctx *ctx, struct vcpu *vcpu, struct vm_run *vmrun)
how = VM_SUSPEND_POWEROFF;
else
how = VM_SUSPEND_RESET;
vm_suspend(ctx, how);
error = vm_suspend(ctx, how);
assert(error == 0 || errno == EALREADY);
break;
default:
break;
+2 -1
View File
@@ -413,7 +413,8 @@ fbsdrun_addcpu(int vcpuid)
CPU_SET_ATOMIC(vcpuid, &cpumask);
vm_suspend_cpu(vi->vcpu);
error = vm_suspend_cpu(vi->vcpu);
assert(error == 0);
error = pthread_create(&thr, NULL, fbsdrun_start_thread, vi);
assert(error == 0);