diff mbox

[RFH,0/4] record/replay fixups and doubts

Message ID 001601d1058e$98742b20$c95c8160$@Dovgaluk@ispras.ru
State New
Headers show

Commit Message

Pavel Dovgalyuk Oct. 13, 2015, 8:10 a.m. UTC
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
Pavel Dovgalyuk


> -----Original Message-----
> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo Bonzini
> Sent: Tuesday, October 06, 2015 11:01 PM
> To: qemu-devel@nongnu.org
> Cc: pavel.dovgaluk@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

Comments

Paolo Bonzini Oct. 13, 2015, 4:39 p.m. UTC | #1
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;
diff mbox

Patch

--- 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;
     }