replay additions
v2 cover replay additions
Accidentally sent draft version of patches to the mailing list. Please consider this one as the correct one.
This set of patches includex fixes from Alex Bennée for fixing BQL and replay locks after inventing the MTTCG. It also includes some additional replay patches that makes this set of fixes working. It is also fixes some vmstate creation (and loading) issues in record/replay modes:
- VM start/stop fixes in replay mode
- overlay creation for blkreplay filter
- fixes for vmstate save/load in record/replay mode
- fixes for host clock vmstate
- fixes for icount timers vmstate
There is also a set of helper scripts written by Alex Bennée for debugging the record/replay code.
v2 changes:
- updated lock/unlock logic (as suggested by Paolo Bonzini)
- updated cpu execution loop to avoid races in setting/resetting exit request (as suggested by Paolo Bonzini)
- minor changes
---
Alex Bennée (12):
target/arm/arm-powertctl: drop BQL assertions
cpus: push BQL lock to qemu_*_wait_io_event
cpus: only take BQL for sleeping threads replay/replay.c: bump REPLAY_VERSION again replay/replay-internal.c: track holding of replay_lock
replay: make locking visible outside replay code
replay: push replay_mutex_lock up the call tree scripts/qemu-gdb: add simple tcg lock status helper util/qemu-thread-*: add qemu_lock, locked and unlock trace events scripts/analyse-locks-simpletrace.py: script to analyse lock times scripts/replay-dump.py: replay log dumper scripts/qemu-gdb/timers.py: new helper to dump timer state
Pavel Dovgalyuk (14):
block: implement bdrv_snapshot_goto for blkreplay
blkreplay: create temporary overlay for underlaying devices
replay: disable default snapshot for record/replay
replay: fix processing async events
replay: fixed replay_enable_events
replay: fix save/load vm for non-empty queue
replay: added replay log format description
replay: make safe vmstop at record/replay
replay: save prior value of the host clock
icount: fixed saving/restoring of icount warp timers
cpu-exec: don't overwrite exception_index
cpu-exec: reset exit flag before calling cpu_exec_nocache
replay: don't destroy mutex at exit
replay: check return values of fwrite
accel/kvm/kvm-all.c | 4 accel/tcg/cpu-exec.c | 99 ++++++----- block/blkreplay.c | 73 ++++++++ cpus-common.c | 13 + cpus.c | 134 ++++++++++++--- docs/replay.txt | 91 ++++++++++ include/qemu/thread.h | 14 +- include/qemu/timer.h | 14 ++ include/sysemu/replay.h | 19 ++ migration/savevm.c | 13 + replay/replay-char.c | 21 +- replay/replay-events.c | 30 +-- replay/replay-internal.c | 35 +++- replay/replay-internal.h | 9 + replay/replay-snapshot.c | 9 + replay/replay-time.c | 10 + replay/replay.c | 42 ++--- scripts/analyse-locks-simpletrace.py | 99 +++++++++++ scripts/qemu-gdb.py | 4 scripts/qemugdb/tcg.py | 46 +++++ scripts/qemugdb/timers.py | 54 ++++++ scripts/replay-dump.py | 308 ++++++++++++++++++++++++++++++++++ stubs/replay.c | 16 ++ target/arm/arm-powerctl.c | 8 - target/i386/hax-all.c | 2 util/main-loop.c | 17 +- util/qemu-thread-posix.c | 21 +- util/qemu-timer.c | 12 + util/trace-events | 7 - vl.c | 12 + 30 files changed, 1053 insertions(+), 183 deletions(-) create mode 100755 scripts/analyse-locks-simpletrace.py create mode 100644 scripts/qemugdb/tcg.py create mode 100644 scripts/qemugdb/timers.py create mode 100755 scripts/replay-dump.py
Signature · 1 line
Pavel Dovgalyuk
RFC PATCH v2 1/26 block: implement bdrv_snapshot_goto for blkreplay
From: Pavel Dovgalyuk <[email protected]>
This patch enables making snapshots with blkreplay used in block devices.
This function is required to make bdrv_snapshot_goto without calling .bdrv_open which is not implemented.
--- block/blkreplay.c | 8 ++++++++ 1 file changed, 8 insertions(+)
block/blkreplay.c +8 -0
@@ -127,6 +127,12 @@ static int coroutine_fn blkreplay_co_flush(BlockDriverState *bs)return ret; } +static int blkreplay_snapshot_goto (BlockDriverState *bs, +const char *snapshot_id) +{ +return bdrv_snapshot_goto (bs->file->bs, snapshot_id); +} +static BlockDriver bdrv_blkreplay = { .format_name ="blkreplay" , .protocol_name ="blkreplay" ,
@@ -143,6 +149,8 @@ static BlockDriver bdrv_blkreplay = { .bdrv_co_pwrite_zeroes = blkreplay_co_pwrite_zeroes, .bdrv_co_pdiscard = blkreplay_co_pdiscard, .bdrv_co_flush = blkreplay_co_flush, + + .bdrv_snapshot_goto = blkreplay_snapshot_goto, };static void bdrv_blkreplay_init (void )