ppc: do not use get_clock_realtime()
PATCH 1/1 ppc: do not use get_clock_realtime()
Use the external qemu-timer API instead.
--- hw/ppc/ppc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/ppc/ppc.c +2 -2
@@ -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 );
Signature · 1 line
1.8.3.1
Quoted 1 line · Paolo Bonzini
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.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 5 lines · Tony Breeds
Quoted 1 line · Paolo Bonzini
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-----
Quoted 3 lines · Paolo Bonzini
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 becauseget_clock_realtime()is forQEMU_CLOCK_HOST.
Somehow this got horrendously lost.
Quoted 3 lines
In addition, all uses of
QEMU_CLOCK_HOSTshould probably usertc_clockinstead, and this patch makes it easier to track those places for a follow-up switch tortc_clock.
Thanks for the explanation.
Yours Tony.
Alexander Graf
AppliedQuoted 4 lines · Paolo Bonzini
Use the external qemu-timer API instead.
Signed-off-by Paolo Bonzini <[email protected]>
Thanks, applied to ppc-next.
Alex