summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/include/test_util.h
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2020-03-16 20:37:03 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2020-03-18 16:08:56 +0300
commitbfcaa84975fa0c75deca3e997533aaa35ffed12b (patch)
tree43be2463bbd76e3fdfc167b1aeca17ba5e4ed15a /tools/testing/selftests/kvm/include/test_util.h
parentcf6c26ec7bf5386706cd6522708766eb6522995e (diff)
downloadlinux-bfcaa84975fa0c75deca3e997533aaa35ffed12b.tar.xz
KVM: selftests: Rework timespec functions and usage
The steal_time test's timespec stop condition was wrong and should have used the timespec functions instead to avoid being wrong, but timespec_diff had a strange interface. Rework all the timespec API and its use. Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/include/test_util.h')
-rw-r--r--tools/testing/selftests/kvm/include/test_util.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/include/test_util.h b/tools/testing/selftests/kvm/include/test_util.h
index f588ad1403f1..5eb01bf51b86 100644
--- a/tools/testing/selftests/kvm/include/test_util.h
+++ b/tools/testing/selftests/kvm/include/test_util.h
@@ -61,7 +61,8 @@ void test_assert(bool exp, const char *exp_str,
size_t parse_size(const char *size);
int64_t timespec_to_ns(struct timespec ts);
-struct timespec timespec_diff(struct timespec start, struct timespec end);
struct timespec timespec_add_ns(struct timespec ts, int64_t ns);
+struct timespec timespec_add(struct timespec ts1, struct timespec ts2);
+struct timespec timespec_sub(struct timespec ts1, struct timespec ts2);
#endif /* SELFTEST_KVM_TEST_UTIL_H */