There is one more fix.
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;
     }

Pavel Dovgalyuk


> -----Original Message-----
> From: Paolo Bonzini [mailto:paolo.bonz...@gmail.com] On Behalf Of Paolo 
> Bonzini
> Sent: Tuesday, October 06, 2015 11:01 PM
> To: qemu-devel@nongnu.org
> Cc: pavel.dovga...@ispras.ru
> Subject: [RFH PATCH 0/4] record/replay fixups and doubts
> 
> These are some comments I have about the record/replay code.  I can
> integrate these in your patches myself, but I need an ack/tested-by and
> in some case more answers...  Please take a look.
> 
> Paolo Bonzini (4):
>   replay: generalize ptimer event to bottom halves
>   more replay fixes
>   why is runstate_is_running needed?
>   events doubts
> 
>  Makefile.objs                       |  2 ++
>  Makefile.target                     |  1 -
>  cpu-exec.c                          |  2 +-
>  cpus.c                              |  2 +-
>  exec.c                              |  2 +-
>  hw/bt/hci.c                         |  4 ++--
>  hw/core/ptimer.c                    |  8 ++------
>  include/qapi/qmp/qerror.h           |  2 +-
>  {replay => include/sysemu}/replay.h |  4 ++--
>  qapi/common.json                    |  6 +-----
>  qemu-timer.c                        | 23 +++++++++--------------
>  replay/Makefile.objs                | 11 +++++------
>  replay/replay-events.c              | 24 +++++++++++++++---------
>  replay/replay-input.c               |  2 +-
>  replay/replay-internal.c            |  4 ++--
>  replay/replay-internal.h            |  2 +-
>  replay/replay-time.c                |  2 +-
>  replay/replay.c                     |  2 +-
>  stubs/Makefile.objs                 |  1 +
>  {replay => stubs}/replay-user.c     |  6 +-----
>  stubs/replay.c                      | 10 +++++-----
>  ui/input.c                          |  2 +-
>  vl.c                                |  6 +++---
>  23 files changed, 59 insertions(+), 69 deletions(-)
>  rename {replay => include/sysemu}/replay.h (97%)
>  mode change 100755 => 100644 replay/Makefile.objs
>  mode change 100755 => 100644 replay/replay-events.c
>  mode change 100755 => 100644 replay/replay-input.c
>  mode change 100755 => 100644 replay/replay-internal.c
>  mode change 100755 => 100644 replay/replay-internal.h
>  mode change 100755 => 100644 replay/replay-time.c
>  mode change 100755 => 100644 replay/replay.c
>  rename {replay => stubs}/replay-user.c (90%)
> 
> --
> 2.5.0



Reply via email to