Skip to content

Commit 6f97449

Browse files
shvipinbonzini
authored andcommitted
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 <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent c96f57b commit 6f97449

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/testing/selftests/kvm/include/test_util.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ void test_assert(bool exp, const char *exp_str,
6767
__u32 exit_reason = (vcpu)->run->exit_reason; \
6868
\
6969
TEST_ASSERT(exit_reason == (expected), \
70-
"Unexpected exit reason: %u (%s)", \
70+
"Wanted KVM exit reason: %u (%s), got: %u (%s)", \
71+
(expected), exit_reason_str((expected)), \
7172
exit_reason, exit_reason_str(exit_reason)); \
7273
} while (0)
7374

0 commit comments

Comments
 (0)