From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm2bd-0007Ji-7w for qemu-devel@nongnu.org; Tue, 13 Oct 2015 12:39:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zm2bZ-0006MT-5O for qemu-devel@nongnu.org; Tue, 13 Oct 2015 12:39:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zm2bY-0006MM-WA for qemu-devel@nongnu.org; Tue, 13 Oct 2015 12:39:13 -0400 References: <1444161658-15038-1-git-send-email-pbonzini@redhat.com> <001601d1058e$98742b20$c95c8160$@Dovgaluk@ispras.ru> From: Paolo Bonzini Message-ID: <561D33AC.3070007@redhat.com> Date: Tue, 13 Oct 2015 18:39:08 +0200 MIME-Version: 1.0 In-Reply-To: <001601d1058e$98742b20$c95c8160$@Dovgaluk@ispras.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFH PATCH 0/4] record/replay fixups and doubts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgaluk , qemu-devel@nongnu.org On 13/10/2015 10:10, Pavel Dovgaluk wrote: > Sometimes replay cannot continue after stopping/restarting of the virtual machine. > This happens because warp on stopped machine and on running machine behaves differently. > Timers deadline calculation depends on enabled flag of the virtual timer. > The following patch fixes the problem - it disables warp when machine is stopped. > > index 5130806..7a337d9 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -411,7 +411,7 @@ void qemu_clock_warp(QEMUClockType type) > } > > /* warp clock deterministically in record/replay mode */ > - if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP)) { > + if (!runstate_is_running() || !replay_checkpoint(CHECKPOINT_CLOCK_WARP)) { > return; > } Thanks, I'm adding a comment too: @@ -410,6 +410,13 @@ void qemu_clock_warp(QEMUClockType type) return; } + /* Nothing to do if the VM is stopped: QEMU_CLOCK_VIRTUAL timers + * do not fire, so computing the deadline does not make sense. + */ + if (!runstate_is_running()) { + return; + } + /* warp clock deterministically in record/replay mode */ if (!replay_checkpoint(CHECKPOINT_CLOCK_WARP)) { return;