From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RruHS-0001hZ-A3 for qemu-devel@nongnu.org; Mon, 30 Jan 2012 11:40:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RruHM-0006op-FV for qemu-devel@nongnu.org; Mon, 30 Jan 2012 11:40:34 -0500 Received: from mail-gy0-f173.google.com ([209.85.160.173]:42620) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RruHM-0006ol-Bg for qemu-devel@nongnu.org; Mon, 30 Jan 2012 11:40:28 -0500 Received: by ghrr20 with SMTP id r20so1627632ghr.4 for ; Mon, 30 Jan 2012 08:40:27 -0800 (PST) Sender: Paolo Bonzini Message-ID: <4F26C7F5.9070802@redhat.com> Date: Mon, 30 Jan 2012 17:40:21 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1327061100-9286-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1327061100-9286-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] m48t59: use rtc_clock for alarm timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org, =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= On 01/20/2012 01:05 PM, Paolo Bonzini wrote: > This lets the RTC get adjustments from the host NTP client. > The watchdog still uses the vm_clock. The previous behavior is > available with "-rtc clock=vm". > > Cc: Andreas Färber > Signed-off-by: Paolo Bonzini > --- > hw/m48t59.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/m48t59.c b/hw/m48t59.c > index c043996..fd5dc00 100644 > --- a/hw/m48t59.c > +++ b/hw/m48t59.c > @@ -126,7 +126,7 @@ static void alarm_cb (void *opaque) > /* Repeat once a second */ > next_time = 1; > } > - qemu_mod_timer(NVRAM->alrm_timer, qemu_get_clock_ns(vm_clock) + > + qemu_mod_timer(NVRAM->alrm_timer, qemu_get_clock_ns(rtc_clock) + > next_time * 1000); > qemu_set_irq(NVRAM->IRQ, 0); > } > @@ -687,7 +687,7 @@ static void m48t59_init_common(M48t59State *s) > { > s->buffer = g_malloc0(s->size); > if (s->type == 59) { > - s->alrm_timer = qemu_new_timer_ns(vm_clock,&alarm_cb, s); > + s->alrm_timer = qemu_new_timer_ns(rtc_clock,&alarm_cb, s); > s->wd_timer = qemu_new_timer_ns(vm_clock,&watchdog_cb, s); > } > qemu_get_timedate(&s->alarm, 0); Ping. Paolo