diff options
author | Ben Gardon <bgardon@google.com> | 2022-06-14 00:25:15 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-24 11:51:43 +0300 |
commit | 32faa0647cea46ffda9095c3a8c95b315e139f0f (patch) | |
tree | 07a55095af6bf355454d5702d8116d507a0e78c5 /tools/testing/selftests/kvm/kvm_binary_stats_test.c | |
parent | fcd48a213f0ac45c2187b09e19d4849e14cb59f8 (diff) | |
download | linux-32faa0647cea46ffda9095c3a8c95b315e139f0f.tar.xz |
KVM: selftests: Read binary stats header in lib
Move the code to read the binary stats header to the KVM selftests
library. It will be re-used by other tests to check KVM behavior.
No functional change intended.
Reviewed-by: David Matlack <dmatlack@google.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20220613212523.3436117-3-bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/kvm_binary_stats_test.c')
-rw-r--r-- | tools/testing/selftests/kvm/kvm_binary_stats_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/kvm/kvm_binary_stats_test.c b/tools/testing/selftests/kvm/kvm_binary_stats_test.c index ac5c3d0181e3..2a90b6276fcd 100644 --- a/tools/testing/selftests/kvm/kvm_binary_stats_test.c +++ b/tools/testing/selftests/kvm/kvm_binary_stats_test.c @@ -33,8 +33,8 @@ static void stats_test(int stats_fd) struct kvm_stats_desc *pdesc; /* Read kvm stats header */ - ret = read(stats_fd, &header, sizeof(header)); - TEST_ASSERT(ret == sizeof(header), "Read stats header"); + read_stats_header(stats_fd, &header); + size_desc = sizeof(*stats_desc) + header.name_size; /* Read kvm stats id string */ |