]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: selftests: Get VM's binary stats FD when opening VM
authorSean Christopherson <seanjc@google.com>
Sat, 11 Jan 2025 00:50:46 +0000 (16:50 -0800)
committerSean Christopherson <seanjc@google.com>
Fri, 14 Feb 2025 15:02:11 +0000 (07:02 -0800)
commitea7179f99514f8119c6327d7c3b84a439a273533
tree593760c8a17f8bcd3f25667045f11b7d919d0291
parente65faf71bd54ac957aed3c2e81a964fea63f3e82
KVM: selftests: Get VM's binary stats FD when opening VM

Get and cache a VM's binary stats FD when the VM is opened, as opposed to
waiting until the stats are first used.  Opening the stats FD outside of
__vm_get_stat() will allow converting it to a scope-agnostic helper.

Note, this doesn't interfere with kvm_binary_stats_test's testcase that
verifies a stats FD can be used after its own VM's FD is closed, as the
cached FD is also closed during kvm_vm_free().

Link: https://lore.kernel.org/r/20250111005049.1247555-7-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/lib/kvm_util.c