KVM: selftests: Verify stats fd can be dup()'d and read
authorSean Christopherson <seanjc@google.com>
Tue, 11 Jul 2023 23:01:30 +0000 (16:01 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 29 Jul 2023 15:05:30 +0000 (11:05 -0400)
commit65f1f57f35e5e833c879a7afb9c862c603695917
tree14e83307f5fcbd912678317df8ae3b7613baf53b
parent47d1be8a78fb587fe5a8f0873244476700171403
KVM: selftests: Verify stats fd can be dup()'d and read

Expand the binary stats test to verify that a stats fd can be dup()'d
and read, to (very) roughly simulate userspace passing around the file.
Adding the dup() test is primarily an intermediate step towards verifying
that userspace can read VM/vCPU stats before _and_ after userspace closes
its copy of the VM fd; the dup() test itself is only mildly interesting.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20230711230131.648752-7-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/kvm_binary_stats_test.c