Received: from eggs.gnu.org ([2001:4830:134:3::10]:42139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrV9f-0005WP-Av for qemu-devel@nongnu.org; Mon, 02 Jun 2014 12:32:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrV9X-0002Wh-Q5 for qemu-devel@nongnu.org; Mon, 02 Jun 2014 12:32:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrV9X-0002WH-HX for qemu-devel@nongnu.org; Mon, 02 Jun 2014 12:32:03 -0400 Date: Mon, 2 Jun 2014 13:31:45 -0300 From: Marcelo Tosatti Message-ID: <20140602163145.GB18178@amt.cnet> References: <20140530140523.653892288@amt.cnet> <538C402B.4060008@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <538C402B.4060008@redhat.com> Subject: Re: [Qemu-devel] [patch 0/2] add QMP command to reset rtc interrupt backlog List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michal Privoznik Cc: gleb@kernel.org, pbonzini@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com On Mon, Jun 02, 2014 at 11:13:15AM +0200, Michal Privoznik wrote: > On 30.05.2014 16:05, Marcelo Tosatti wrote: > >It is necessary to reset RTC interrupt backlog if guest time is > >synchronized via a different mechanism, such as QGA's guest-set-time > >command. > > > >Failing to do so causes both corrections to be applied (summed), > >resulting in an incorrect guest time. > > > > > > Marcelo, > > what happens if quest is synchronized via NTP? Does this command > still need to be executed after 'cont'? > > Michal Yes because NTP will either take time to adjust by slewing or step the clock (which renders guest-set-time() unuseable). During that time, guest clock will be ahead of realtime. Algorithm should be: - ret = guest-set-time() - if (ret = success) - rtc-reset-reinjection() That leaves a window where RTC interrupts are reinjected, but i see no better option.