[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v2 15/19] replay: flush rr queue before loading
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [RFC PATCH v2 15/19] replay: flush rr queue before loading the vmstate |
Date: |
Sat, 28 Apr 2018 15:37:54 +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 | 10 ++++------
replay/replay-internal.h | 2 --
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index 98d709c..84a1ec5 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -132,6 +132,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 08c1d4c..abe7d2f 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2423,12 +2423,6 @@ int load_snapshot(const char *name, Error **errp)
AioContext *aio_context;
MigrationIncomingState *mis = migration_incoming_get_current();
- if (!replay_can_snapshot()) {
- error_report("Record/replay does not allow loading snapshot "
- "right now. Try once more later.");
- return -EINVAL;
- }
-
if (!bdrv_all_can_snapshot(&bs)) {
error_setg(errp,
"Device '%s' is writable but does not support snapshots",
@@ -2462,6 +2456,10 @@ 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 a2221e5..08ef2ec 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] [RFC PATCH v2 08/19] replay: introduce info hmp/qmp command, (continued)
- [Qemu-devel] [RFC PATCH v2 08/19] replay: introduce info hmp/qmp command, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 06/19] qcow2: introduce icount field for snapshots, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 05/19] replay: finish record/replay before closing the disks, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 07/19] migration: introduce icount field for snapshots, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 09/19] replay: introduce breakpoint at the specified step, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 10/19] replay: implement replay-seek command to proceed to the desired step, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 11/19] replay: flush events when exitting, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 12/19] timer: remove replay clock probe in deadline calculation, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 13/19] replay: refine replay-time module, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 14/19] translator: fix breakpoint processing, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 15/19] replay: flush rr queue before loading the vmstate,
Pavel Dovgalyuk <=
- [Qemu-devel] [RFC PATCH v2 16/19] gdbstub: add reverse step support in replay mode, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 17/19] gdbstub: add reverse continue support in replay mode, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 18/19] replay: describe reverse debugging in docs/replay.txt, Pavel Dovgalyuk, 2018/04/28
- [Qemu-devel] [RFC PATCH v2 19/19] replay: allow loading any snapshots before recording, Pavel Dovgalyuk, 2018/04/28
- Re: [Qemu-devel] [RFC PATCH v2 00/19] reverse debugging, Ciro Santilli, 2018/04/30