On 04/17/2013 07:38 PM, Mike Qiu wrote:
From: Mike Qiu <[email protected]>

The name of the clock on Power guest is "timebase" which is
different from it counterpart in x86 "kvm-clock"

To makes it can work in both Power and x86 guest, add the
platform check.

Signed-off-by: Mike Qiu <[email protected]>
---
  shared/deps/test_clock_getres/test_clock_getres.c |    7 ++++++-
  1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/shared/deps/test_clock_getres/test_clock_getres.c 
b/shared/deps/test_clock_getres/test_clock_getres.c
index 81d3b9c..986276a 100644
--- a/shared/deps/test_clock_getres/test_clock_getres.c
+++ b/shared/deps/test_clock_getres/test_clock_getres.c
@@ -1,5 +1,6 @@
  /*
- *  Test clock resolution for KVM guests that have kvm-clock as clock source
+ *  Test clock resolution for KVM guests that have kvm-clock or timebase
+ *  as clock source
   *
   *  Copyright (c) 2010 Red Hat, Inc
   *  Author: Lucas Meneghel Rodrigues <[email protected]>
@@ -38,7 +39,11 @@ int main(void) {
                sscanf(line, "%s", &clocksource);
        }
        fclose(fr);
+#if defined(__powerpc64__)
+        if (!strncmp(clocksource, "timebase", strlen("timebase"))) {
+#else
        if (!strncmp(clocksource, "kvm-clock", strlen("kvm-clock"))) {
+#endif
This patch works.
But both  "Tab" and four space are used in this patch.
                if (clock_return == 0) {
                        if (res.tv_sec > 1 || res.tv_nsec > 100) {
                                printf("FAIL: clock_getres returned bad clock 
resolution\n");

_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel

Reply via email to