]> git.ipfire.org Git - thirdparty/linux.git/commit
KVM: selftests: Extract guts of THP accessor to standalone sysfs helpers
authorSean Christopherson <seanjc@google.com>
Thu, 8 May 2025 18:46:42 +0000 (18:46 +0000)
committerSean Christopherson <seanjc@google.com>
Fri, 16 May 2025 16:35:26 +0000 (09:35 -0700)
commitd761c14d902e41c1e4c9b57f0e57593b7dfc56a9
treeb473d20f70f070110135702d2c9cddaaad8630ca
parent5e9ac644c40f8315877343034d1d6a8e056bd1dc
KVM: selftests: Extract guts of THP accessor to standalone sysfs helpers

Extract the guts of thp_configured() and get_trans_hugepagesz() to
standalone helpers so that the core logic can be reused for other sysfs
files, e.g. to query numa_balancing.

Opportunistically assert that the initial fscanf() read at least one byte,
and add a comment explaining the second call to fscanf().

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: James Houghton <jthoughton@google.com>
Link: https://lore.kernel.org/r/20250508184649.2576210-2-jthoughton@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/lib/test_util.c