[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v14 15/25] replay: flush rr queue before loading the
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [PATCH v14 15/25] replay: flush rr queue before loading the vmstate |
Date: |
Fri, 15 Mar 2019 15:09:44 +0300 |
User-agent: |
StGit/0.17.1-dirty |
Non-empty record/replay queue prevents saving and loading the VM state,
because it includes pending bottom halves and block coroutines.
But when the new VM state is loaded, we don't have to preserve the consistency
of the current state anymore. Therefore this patch just flushes the queue
allowing the coroutines to finish.
Signed-off-by: Pavel Dovgalyuk <address@hidden>
---
include/sysemu/replay.h | 2 ++
migration/savevm.c | 6 ++++++
replay/replay-internal.h | 2 --
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index 3fe14b5f57..d7e859d915 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -140,6 +140,8 @@ void replay_disable_events(void);
void replay_enable_events(void);
/*! Returns true when saving events is enabled */
bool replay_events_enabled(void);
+/* Flushes events queue */
+void replay_flush_events(void);
/*! Adds bottom half event to the queue */
void replay_bh_schedule_event(QEMUBH *bh);
/*! Adds input event to the queue */
diff --git a/migration/savevm.c b/migration/savevm.c
index 468a5a6c90..6a0ebacfed 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2788,6 +2788,12 @@ int load_snapshot(const char *name, Error **errp)
return -EINVAL;
}
+ /*
+ * Flush the record/replay queue. Now the VM state is going
+ * to change. Therefore we don't need to preserve its consistency
+ */
+ replay_flush_events();
+
/* Flush all IO requests so they don't interfere with the new state. */
bdrv_drain_all_begin();
diff --git a/replay/replay-internal.h b/replay/replay-internal.h
index 8c15a41350..945802361b 100644
--- a/replay/replay-internal.h
+++ b/replay/replay-internal.h
@@ -146,8 +146,6 @@ void replay_read_next_clock(unsigned int kind);
void replay_init_events(void);
/*! Clears internal data structures for events handling */
void replay_finish_events(void);
-/*! Flushes events queue */
-void replay_flush_events(void);
/*! Returns true if there are any unsaved events in the queue */
bool replay_has_events(void);
/*! Saves events from queue into the file */
- [Qemu-devel] [PATCH v14 22/25] util/qemu-timer: refactor deadline calculation for external timers, (continued)
- [Qemu-devel] [PATCH v14 22/25] util/qemu-timer: refactor deadline calculation for external timers, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 23/25] replay: fix replay shutdown, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 25/25] icount: clean up cpu_can_io before jumping to the next block, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 13/25] replay: implement replay-seek command, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 14/25] replay: refine replay-time module, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 06/25] replay: finish record/replay before closing the disks, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 21/25] replay: document development rules, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 10/25] qapi: introduce replay.json for record/replay-related stuff, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 09/25] replay: provide an accessor for rr filename, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 18/25] replay: describe reverse debugging in docs/replay.txt, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 15/25] replay: flush rr queue before loading the vmstate,
Pavel Dovgalyuk <=
- [Qemu-devel] [PATCH v14 04/25] replay: update docs for record/replay with block devices, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 11/25] replay: introduce info hmp/qmp command, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 19/25] replay: add BH oneshot event for block layer, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 01/25] replay: add missing fix for internal function, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 24/25] replay: rename step-related variables and functions, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 03/25] replay: disable default snapshot for record/replay, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 17/25] gdbstub: add reverse continue support in replay mode, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 05/25] replay: don't drain/flush bdrv queue while RR is working, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 16/25] gdbstub: add reverse step support in replay mode, Pavel Dovgalyuk, 2019/03/15
- [Qemu-devel] [PATCH v14 20/25] replay: init rtc after enabling the replay, Pavel Dovgalyuk, 2019/03/15