Skip to content

Commit 4a073e8

Browse files
angquan yubonzini
authored andcommitted
KVM: selftests: Actually print out magic token in NX hugepages skip message
Pass MAGIC_TOKEN to __TEST_REQUIRE() when printing the help message about needing to pass a magic value to manually run the NX hugepages test, otherwise the help message will contain garbage. In file included from x86_64/nx_huge_pages_test.c:15: x86_64/nx_huge_pages_test.c: In function ‘main’: include/test_util.h:40:32: error: format ‘%d’ expects a matching ‘int’ argument [-Werror=format=] 40 | ksft_exit_skip("- " fmt "\n", ##__VA_ARGS__); \ | ^~~~ x86_64/nx_huge_pages_test.c:259:9: note: in expansion of macro ‘__TEST_REQUIRE’ 259 | __TEST_REQUIRE(token == MAGIC_TOKEN, | ^~~~~~~~~~~~~~ Signed-off-by: angquan yu <angquan21@gmail.com> Link: https://lore.kernel.org/r/20231128221105.63093-1-angquan21@gmail.com [sean: rewrite shortlog+changelog] Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 6254eeb commit 4a073e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ int main(int argc, char **argv)
259259
__TEST_REQUIRE(token == MAGIC_TOKEN,
260260
"This test must be run with the magic token %d.\n"
261261
"This is done by nx_huge_pages_test.sh, which\n"
262-
"also handles environment setup for the test.");
262+
"also handles environment setup for the test.", MAGIC_TOKEN);
263263

264264
run_test(reclaim_period_ms, false, reboot_permissions);
265265
run_test(reclaim_period_ms, true, reboot_permissions);

0 commit comments

Comments
 (0)