summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/x86_64/sync_regs_test.c
diff options
context:
space:
mode:
authorVishal Annapurve <vannapurve@google.com>2022-11-15 21:38:43 +0000
committerSean Christopherson <seanjc@google.com>2022-11-16 16:58:56 -0800
commit197ebb713ad04518ffef6d966954b519a0805100 (patch)
tree2c4a9c02a943939ccdf9d3f6f5ac50c725b1fc8e /tools/testing/selftests/kvm/x86_64/sync_regs_test.c
parent96b69958c77d84e49c06ebe2e3502e4c1620e3c0 (diff)
downloadlinux-197ebb713ad04518ffef6d966954b519a0805100.tar.bz2
KVM: selftests: move common startup logic to kvm_util.c
Consolidate common startup logic in one place by implementing a single setup function with __attribute((constructor)) for all selftests within kvm_util.c. This allows moving logic like: /* Tell stdout not to buffer its content */ setbuf(stdout, NULL); to a single file for all selftests. This will also allow any required setup at entry in future to be done in common main function. Link: https://lore.kernel.org/lkml/Ywa9T+jKUpaHLu%2Fl@google.com Suggested-by: Sean Christopherson <seanjc@google.com> Reviewed-by: Andrew Jones <andrew.jones@linux.dev> Reviewed-by: Peter Gonda <pgonda@google.com> Signed-off-by: Vishal Annapurve <vannapurve@google.com> Link: https://lore.kernel.org/r/20221115213845.3348210-2-vannapurve@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/sync_regs_test.c')
-rw-r--r--tools/testing/selftests/kvm/x86_64/sync_regs_test.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/sync_regs_test.c b/tools/testing/selftests/kvm/x86_64/sync_regs_test.c
index 9b6db0b0b13e..d2f9b5bdfab2 100644
--- a/tools/testing/selftests/kvm/x86_64/sync_regs_test.c
+++ b/tools/testing/selftests/kvm/x86_64/sync_regs_test.c
@@ -90,9 +90,6 @@ int main(int argc, char *argv[])
struct kvm_vcpu_events events;
int rv, cap;
- /* Tell stdout not to buffer its content */
- setbuf(stdout, NULL);
-
cap = kvm_check_cap(KVM_CAP_SYNC_REGS);
TEST_REQUIRE((cap & TEST_SYNC_FIELDS) == TEST_SYNC_FIELDS);
TEST_REQUIRE(!(cap & INVALID_SYNC_FIELD));