KVM: selftests: Remove redundant setbuf()
PATCH 1/1 KVM: selftests: Remove redundant setbuf()
From: Shaoqin Huang <[email protected]>
Since setbuf(stdout, NULL) has been called in kvm_util.c with __attribute((constructor)). Selftests no need to setup it in their own code.
--- tools/testing/selftests/kvm/aarch64/page_fault_test.c | 2 -- .../selftests/kvm/x86_64/exit_on_emulation_failure_test.c | 3 --- 2 files changed, 5 deletions(-)
tools/testing/selftests/kvm/aarch64/page_fault_test.c +0 -2
@@ -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 ) {
tools/testing/selftests/kvm/x86_64/exit_on_emulation_failure_test.c +0 -3
@@ -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);
Signature · 1 line
2.39.0
Quoted 8 lines · On Fri, Feb 03, 2023, [email protected] wrote:
From: Shaoqin Huang <[email protected]>
Since
setbuf(stdout, NULL)has been called inkvm_util.cwith __attribute((constructor)). Selftests no need to setup it in their own code.Signed-off-by Shaoqin Huang <[email protected]>---
Oliver/Marc, want to grab this one? I doubt there will be conflicts, but IIRC there are a handful of in-flight changes for aarch64/page_fault_test.c.
Quoted 11 lines · Sean Christopherson
Quoted 8 lines · On Fri, Feb 03, 2023, [email protected] wrote:
From: Shaoqin Huang <[email protected]>
Since
setbuf(stdout, NULL)has been called inkvm_util.cwith __attribute((constructor)). Selftests no need to setup it in their own code.Signed-off-by Shaoqin Huang <[email protected]>---
Reviewed-by Sean Christopherson <[email protected]>
Thanks!
Quoted 2 lines
Oliver/Marc, want to grab this one? I doubt there will be conflicts, but IIRC there are a handful of in-flight changes for
aarch64/page_fault_test.c.
That is indeed the plan.
Applying patches for arm64 has taken a bit longer because I don't yet have push access to kvmarm so I need Marc to pull from me. The net effect is emailed thankyous are delayed by a few days, but that wont be an issue going forward.
Signature · 2 lines
Thanks, Oliver
Quoted 11 lines · Oliver Upton
Quoted 10 lines · Sean Christopherson
Quoted 8 lines · On Fri, Feb 03, 2023, [email protected] wrote:
From: Shaoqin Huang <[email protected]>
Since
setbuf(stdout, NULL)has been called inkvm_util.cwith __attribute((constructor)). Selftests no need to setup it in their own code.Signed-off-by Shaoqin Huang <[email protected]>---
Quoted 8 lines
Quoted 1 line
Reviewed-by Sean Christopherson <[email protected]>Thanks!
Quoted 2 lines
Oliver/Marc, want to grab this one? I doubt there will be conflicts, but IIRC there are a handful of in-flight changes for
aarch64/page_fault_test.c.That is indeed the plan.
Now fully caffeinated I see that this was poking at an x86 selftest too. Thanks for reviewing it, I'll grab the patch today.
Signature · 2 lines
Thanks, Oliver
Oliver Upton
AppliedQuoted 8 lines · On Fri, 3 Feb 2023 14:10:36 +0800, [email protected] wrote:
From: Shaoqin Huang <[email protected]>
Since
setbuf(stdout, NULL)has been called inkvm_util.cwith __attribute((constructor)). Selftests no need to setup it in their own code.[...]
Applied to kvmarm/next, thanks!
[1/1] KVM: selftests: Remove redundant setbuf()
https://git.kernel.org/kvmarm/kvmarm/c/6043829fdb71
--
Best,
Oliver