diff options
author | Andrew Jones <drjones@redhat.com> | 2020-03-16 20:37:03 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-03-18 16:08:56 +0300 |
commit | bfcaa84975fa0c75deca3e997533aaa35ffed12b (patch) | |
tree | 43be2463bbd76e3fdfc167b1aeca17ba5e4ed15a /tools/testing/selftests/kvm/include | |
parent | cf6c26ec7bf5386706cd6522708766eb6522995e (diff) | |
download | linux-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')
-rw-r--r-- | tools/testing/selftests/kvm/include/test_util.h | 3 |
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 */ |