summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorVipin Sharma <vipinsh@google.com>2023-02-03 17:45:45 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2023-03-14 10:20:09 -0400
commit6f974494b8077bb1a2a10fe33f62c143f246f102 (patch)
tree0d424d1eaf20e1130da513d5c51c9e308befd6d9 /tools
parentc96f57b08012805da323c6bdf929bab1b88d250c (diff)
downloadlinux-stable-6f974494b8077bb1a2a10fe33f62c143f246f102.tar.gz
linux-stable-6f974494b8077bb1a2a10fe33f62c143f246f102.tar.bz2
linux-stable-6f974494b8077bb1a2a10fe33f62c143f246f102.zip
KVM: selftests: Print expected and actual exit reason in KVM exit reason assert
Print what KVM exit reason a test was expecting and what it actually got int TEST_ASSERT_KVM_EXIT_REASON(). Signed-off-by: Vipin Sharma <vipinsh@google.com> Message-Id: <20230204014547.583711-3-vipinsh@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/selftests/kvm/include/test_util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h
index a13663557e2b..a6e9f215ce70 100644
--- a/tools/testing/selftests/kvm/include/test_util.h
+++ b/tools/testing/selftests/kvm/include/test_util.h
@@ -67,7 +67,8 @@ void test_assert(bool exp, const char *exp_str,
__u32 exit_reason = (vcpu)->run->exit_reason; \
\
TEST_ASSERT(exit_reason == (expected), \
- "Unexpected exit reason: %u (%s)", \
+ "Wanted KVM exit reason: %u (%s), got: %u (%s)", \
+ (expected), exit_reason_str((expected)), \
exit_reason, exit_reason_str(exit_reason)); \
} while (0)