[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/2] mc146818rtc: Reset the periodic timer on lo
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 2/2] mc146818rtc: Reset the periodic timer on load |
Date: |
Wed, 17 Jun 2015 16:01:33 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 12/06/2015 16:10, Paul Donohue wrote:
> To correct that problem, this commit resets the periodic timer after
> loading from a snapshot or migration if the clock has either jumped
> backward or has jumped forward by more than the clock jump limit that
> is used by the reset notifier code in qemu-timer.
>
> Signed-off-by: Paul Donohue <address@hidden>
> ---
> hw/timer/mc146818rtc.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
> index f2b77fa..68cf1f0 100644
> --- a/hw/timer/mc146818rtc.c
> +++ b/hw/timer/mc146818rtc.c
> @@ -723,6 +723,12 @@ static int rtc_post_load(void *opaque, int version_id)
> check_update_timer(s);
> }
>
> + uint64_t now = qemu_clock_get_ns(rtc_clock);
> + if (now < (s->next_periodic_time - get_ticks_per_sec()) ||
What is the reason for the "- get_ticks_per_sec()" adjustment? Can I
just remove it?
Paolo
> + now > (s->next_periodic_time + get_max_clock_jump())) {