aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/lib/kvm_util.c
diff options
context:
space:
mode:
authorVishal Annapurve <[email protected]>2022-11-15 21:38:44 +0000
committerSean Christopherson <[email protected]>2022-11-16 16:58:57 -0800
commite1ab31245c4efe973db4dcd6c82a41c2aec09b27 (patch)
tree721cc7e3fb8ffd09bbc9f6014df9ced40e83965d /tools/testing/selftests/kvm/lib/kvm_util.c
parent197ebb713ad04518ffef6d966954b519a0805100 (diff)
KVM: selftests: Add arch specific initialization
Introduce arch specific API: kvm_selftest_arch_init to allow each arch to handle initialization before running any selftest logic. Suggested-by: Sean Christopherson <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Peter Gonda <[email protected]> Signed-off-by: Vishal Annapurve <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sean Christopherson <[email protected]>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/kvm_util.c')
-rw-r--r--tools/testing/selftests/kvm/lib/kvm_util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 575a0c38d1c0..db62680d5918 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -2087,8 +2087,14 @@ void __vm_get_stat(struct kvm_vm *vm, const char *stat_name, uint64_t *data,
}
}
+__weak void kvm_selftest_arch_init(void)
+{
+}
+
void __attribute((constructor)) kvm_selftest_init(void)
{
/* Tell stdout not to buffer its content. */
setbuf(stdout, NULL);
+
+ kvm_selftest_arch_init();
}