~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to replay/replay.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#include "replay-internal.h"
17
17
#include "qemu/timer.h"
18
18
#include "qemu/main-loop.h"
 
19
#include "sysemu/cpus.h"
19
20
#include "sysemu/sysemu.h"
20
21
#include "qemu/error-report.h"
21
22
 
22
23
/* Current version of the replay mechanism.
23
24
   Increase it when file format changes. */
24
 
#define REPLAY_VERSION              0xe02004
 
25
#define REPLAY_VERSION              0xe02006
25
26
/* Size of replay log header */
26
27
#define HEADER_SIZE                 (sizeof(uint32_t) + sizeof(uint64_t))
27
28
 
28
29
ReplayMode replay_mode = REPLAY_MODE_NONE;
 
30
char *replay_snapshot;
29
31
 
30
32
/* Name of replay file  */
31
33
static char *replay_filename;
82
84
        if (replay_state.instructions_count > 0) {
83
85
            int count = (int)(replay_get_current_step()
84
86
                              - replay_state.current_step);
 
87
 
 
88
            /* Time can only go forward */
 
89
            assert(count >= 0);
 
90
 
85
91
            replay_state.instructions_count -= count;
86
92
            replay_state.current_step += count;
87
93
            if (replay_state.instructions_count == 0) {
292
298
        exit(1);
293
299
    }
294
300
 
 
301
    replay_snapshot = g_strdup(qemu_opt_get(opts, "rrsnapshot"));
295
302
    replay_vmstate_register();
296
303
    replay_enable(fname, mode);
297
304
 
346
353
        replay_filename = NULL;
347
354
    }
348
355
 
 
356
    g_free(replay_snapshot);
 
357
    replay_snapshot = NULL;
 
358
 
349
359
    replay_finish_events();
350
360
    replay_mutex_destroy();
351
361
}