diff options
author | Vipin Sharma <vipinsh@google.com> | 2023-02-03 17:45:44 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2023-03-14 10:20:09 -0400 |
commit | c96f57b08012805da323c6bdf929bab1b88d250c (patch) | |
tree | 462f58f1e9409d8ac1b3b65c6b037dd6a7f511df /tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c | |
parent | KVM: selftests: Add EVTCHNOP_send slow path test to xen_shinfo_test (diff) | |
download | wireguard-linux-c96f57b08012805da323c6bdf929bab1b88d250c.tar.xz wireguard-linux-c96f57b08012805da323c6bdf929bab1b88d250c.zip |
KVM: selftests: Make vCPU exit reason test assertion common
Make TEST_ASSERT_KVM_EXIT_REASON() macro and replace all exit reason
test assert statements with it.
No functional changes intended.
Signed-off-by: Vipin Sharma <vipinsh@google.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Message-Id: <20230204014547.583711-2-vipinsh@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c')
-rw-r--r-- | tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c b/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c index 68a7d354ea07..e446d76d1c0c 100644 --- a/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c +++ b/tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c @@ -156,7 +156,6 @@ int main(int argc, char *argv[]) vm_vaddr_t hcall_page; struct kvm_vcpu *vcpu; struct kvm_vm *vm; - struct kvm_run *run; struct ucall uc; int stage; @@ -165,7 +164,6 @@ int main(int argc, char *argv[]) /* Create VM */ vm = vm_create_with_one_vcpu(&vcpu, guest_code); vcpu_set_hv_cpuid(vcpu); - run = vcpu->run; vcpu_alloc_svm(vm, &nested_gva); vcpu_alloc_hyperv_test_pages(vm, &hv_pages_gva); @@ -177,10 +175,7 @@ int main(int argc, char *argv[]) for (stage = 1;; stage++) { vcpu_run(vcpu); - TEST_ASSERT(run->exit_reason == KVM_EXIT_IO, - "Stage %d: unexpected exit reason: %u (%s),\n", - stage, run->exit_reason, - exit_reason_str(run->exit_reason)); + TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO); switch (get_ucall(vcpu, &uc)) { case UCALL_ABORT: |