KVM: selftests: Remove redundant setbuf()
authorShaoqin Huang <shahuang@redhat.com>
Fri, 3 Feb 2023 06:10:36 +0000 (14:10 +0800)
committerOliver Upton <oliver.upton@linux.dev>
Fri, 3 Feb 2023 21:26:48 +0000 (21:26 +0000)
Since setbuf(stdout, NULL) has been called in kvm_util.c with
__attribute((constructor)). Selftests no need to setup it in their own
code.

Signed-off-by: Shaoqin Huang <shahuang@redhat.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20230203061038.277655-1-shahuang@redhat.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
tools/testing/selftests/kvm/aarch64/page_fault_test.c
tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c

index beb944fa6fd4692fddad8875ef16fb2469c8ab74..513b20bec3c27ef5ad1f2831c8e8148731eae1cc 100644 (file)
@@ -1093,8 +1093,6 @@ int main(int argc, char *argv[])
        enum vm_mem_backing_src_type src_type;
        int opt;
 
-       setbuf(stdout, NULL);
-
        src_type = DEFAULT_VM_MEM_SRC;
 
        while ((opt = getopt(argc, argv, "hm:s:")) != -1) {
index 37c61f712fd5cef5e0f0d000906419465381f11f..e334844d6e1d795473aba76a31133d8e73b35870 100644 (file)
@@ -26,9 +26,6 @@ int main(int argc, char *argv[])
        struct kvm_vcpu *vcpu;
        struct kvm_vm *vm;
 
-       /* Tell stdout not to buffer its content */
-       setbuf(stdout, NULL);
-
        TEST_REQUIRE(kvm_has_cap(KVM_CAP_EXIT_ON_EMULATION_FAILURE));
 
        vm = vm_create_with_one_vcpu(&vcpu, guest_code);