Skip to content

Commit 428c76c

Browse files
committed
KVM: selftests: Convert s390's memop test to printf style GUEST_ASSERT
Convert s390's memop test to printf-based GUEST_ASSERT, and opportunistically use GUEST_FAIL() to report invalid sizes. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
1 parent c55a475 commit 428c76c

File tree

1 file changed

+4
-3
lines changed
  • tools/testing/selftests/kvm/s390x

1 file changed

+4
-3
lines changed

tools/testing/selftests/kvm/s390x/memop.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*
55
* Copyright (C) 2019, Red Hat, Inc.
66
*/
7+
#define USE_GUEST_ASSERT_PRINTF 1
78

89
#include <stdio.h>
910
#include <stdlib.h>
@@ -279,7 +280,7 @@ enum stage {
279280
vcpu_run(__vcpu); \
280281
get_ucall(__vcpu, &uc); \
281282
if (uc.cmd == UCALL_ABORT) { \
282-
REPORT_GUEST_ASSERT_2(uc, "hints: %lu, %lu"); \
283+
REPORT_GUEST_ASSERT(uc); \
283284
} \
284285
TEST_ASSERT_EQ(uc.cmd, UCALL_SYNC); \
285286
TEST_ASSERT_EQ(uc.args[1], __stage); \
@@ -469,7 +470,7 @@ static __uint128_t cut_to_size(int size, __uint128_t val)
469470
case 16:
470471
return val;
471472
}
472-
GUEST_ASSERT_1(false, "Invalid size");
473+
GUEST_FAIL("Invalid size = %u", size);
473474
return 0;
474475
}
475476

@@ -598,7 +599,7 @@ static bool _cmpxchg(int size, void *target, __uint128_t *old_addr, __uint128_t
598599
return ret;
599600
}
600601
}
601-
GUEST_ASSERT_1(false, "Invalid size");
602+
GUEST_FAIL("Invalid size = %u", size);
602603
return 0;
603604
}
604605

0 commit comments

Comments
 (0)