[kvm-unit-tests PATCH 5/8] x86/hyperv: skip hyperv-clock test if unsupported by host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nadav Amit <nadav.amit@xxxxxxxxx>

Skip the hyperv-clock tests if time reference counter is unsupported by
the host, similarly to the way other hyperv tests first check support of
the host.

Signed-off-by: Nadav Amit <nadav.amit@xxxxxxxxx>
---
 x86/hyperv_clock.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/x86/hyperv_clock.c b/x86/hyperv_clock.c
index b4cfc9f..f1e7204 100644
--- a/x86/hyperv_clock.c
+++ b/x86/hyperv_clock.c
@@ -150,6 +150,11 @@ int main(int ac, char **av)
 	uint64_t tsc1, t1, tsc2, t2;
 	uint64_t ref1, ref2;
 
+	if (!hv_time_ref_counter_supported()) {
+		report_skip("time reference counter is unsupported");
+		return report_summary();
+	}
+
 	setup_vm();
 
 	ncpus = cpu_count();
-- 
2.25.1




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux