qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ppc: do not use get_clock_realtime()
@ 2014-11-26 14:01 Paolo Bonzini
  2014-11-27  0:51 ` Tony Breeds
  2014-12-17 12:00 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
  0 siblings, 2 replies; 5+ messages in thread
From: Paolo Bonzini @ 2014-11-26 14:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-ppc

Use the external qemu-timer API instead.

Cc: qemu-ppc@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/ppc/ppc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index bec82cd..5ce565d 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -844,7 +844,7 @@ static void timebase_pre_save(void *opaque)
         return;
     }
 
-    tb->time_of_the_day_ns = get_clock_realtime();
+    tb->time_of_the_day_ns = qemu_clock_get_ns(QEMU_CLOCK_HOST);
     /*
      * tb_offset is only expected to be changed by migration so
      * there is no need to update it from KVM here
@@ -873,7 +873,7 @@ static int timebase_post_load(void *opaque, int version_id)
      * We try to adjust timebase by downtime if host clocks are not
      * too much out of sync (1 second for now).
      */
-    host_ns = get_clock_realtime();
+    host_ns = qemu_clock_get_ns(QEMU_CLOCK_HOST);
     ns_diff = MAX(0, host_ns - tb_remote->time_of_the_day_ns);
     migration_duration_ns = MIN(NSEC_PER_SEC, ns_diff);
     migration_duration_tb = muldiv64(migration_duration_ns, freq, NSEC_PER_SEC);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] ppc: do not use get_clock_realtime()
  2014-11-26 14:01 [Qemu-devel] [PATCH] ppc: do not use get_clock_realtime() Paolo Bonzini
@ 2014-11-27  0:51 ` Tony Breeds
  2014-11-27 17:00   ` Paolo Bonzini
  2014-12-17 12:00 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
  1 sibling, 1 reply; 5+ messages in thread
From: Tony Breeds @ 2014-11-27  0:51 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-ppc, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

On Wed, Nov 26, 2014 at 03:01:01PM +0100, Paolo Bonzini wrote:
> Use the external qemu-timer API instead.

Perhaps it's obvious but is it reasonable to expand on why you're doign this in
the commit message?
 
Yours Tony.

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] ppc: do not use get_clock_realtime()
  2014-11-27  0:51 ` Tony Breeds
@ 2014-11-27 17:00   ` Paolo Bonzini
  2014-12-05  6:14     ` Tony Breeds
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2014-11-27 17:00 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 27/11/2014 01:51, Tony Breeds wrote:
> On Wed, Nov 26, 2014 at 03:01:01PM +0100, Paolo Bonzini wrote:
>> Use the external qemu-timer API instead.
> 
> Perhaps it's obvious but is it reasonable to expand on why you're 
> doign this in the commit message?

You're right.  It's just that the API should be private to
qemu-timer.c, it is not meant for external usage---and it is messy
because get_clock_realtime() is for QEMU_CLOCK_HOST.

In addition, all uses of QEMU_CLOCK_HOST should probably use rtc_clock
instead, and this patch makes it easier to track those places for a
follow-up switch to rtc_clock.

Paolo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJUd1izAAoJEL/70l94x66D8ncH/jwc6oVfUjHvBau3GJy0Vi/I
S5kMndpPKgepMlAWWSK67uoMZQWAyRwG4Bwyat3g8RnpevQTN1pLZG276c2f5t5o
piB9nGmT7BPhxkEiWGGtxeX5ob1Ab8hhTm4Ai78fH8OnQexBT1B06Oz3zcYZKoGD
ckbCzEeiAb8Jxm4wop/s+WApqcnWAsfriCJ0XWUQxtxIbt3esmfMzW+n2fxvhHI1
ookJgqn1ssHpZBYu5lnsPxY+kVTrf0dQaeiPApGSmHUJknmnAEXUGKl1jsdjLCE2
8h5sasf3a7xL+GmZrYjzyZbLYm6BqmjNSsBYCFHYVYVFl857b/S1azoxPC5EZc0=
=4+yL
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] ppc: do not use get_clock_realtime()
  2014-11-27 17:00   ` Paolo Bonzini
@ 2014-12-05  6:14     ` Tony Breeds
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Breeds @ 2014-12-05  6:14 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-ppc, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 519 bytes --]

On Thu, Nov 27, 2014 at 06:00:38PM +0100, Paolo Bonzini wrote:
> You're right.  It's just that the API should be private to
> qemu-timer.c, it is not meant for external usage---and it is messy
> because get_clock_realtime() is for QEMU_CLOCK_HOST.

Somehow this got horrendously lost.

> In addition, all uses of QEMU_CLOCK_HOST should probably use rtc_clock
> instead, and this patch makes it easier to track those places for a
> follow-up switch to rtc_clock.

Thanks for the explanation.
 
Yours Tony.

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc: do not use get_clock_realtime()
  2014-11-26 14:01 [Qemu-devel] [PATCH] ppc: do not use get_clock_realtime() Paolo Bonzini
  2014-11-27  0:51 ` Tony Breeds
@ 2014-12-17 12:00 ` Alexander Graf
  1 sibling, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2014-12-17 12:00 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: qemu-ppc



On 26.11.14 15:01, Paolo Bonzini wrote:
> Use the external qemu-timer API instead.
> 
> Cc: qemu-ppc@nongnu.org
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks, applied to ppc-next.


Alex

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-17 12:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-26 14:01 [Qemu-devel] [PATCH] ppc: do not use get_clock_realtime() Paolo Bonzini
2014-11-27  0:51 ` Tony Breeds
2014-11-27 17:00   ` Paolo Bonzini
2014-12-05  6:14     ` Tony Breeds
2014-12-17 12:00 ` [Qemu-devel] [Qemu-ppc] " Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).