replay: replay blockers for devices

Some devices are not supported by record/replay subsystem.
This patch introduces replay blocker which denies starting record/replay
if such devices are included into the configuration.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Message-Id: <20150917162512.8676.11367.stgit@PASHA-ISP.def.inno>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
This commit is contained in:
Pavel Dovgalyuk 2015-09-17 19:25:13 +03:00 committed by Paolo Bonzini
parent 7615936ebf
commit 0194749ac4
5 changed files with 35 additions and 0 deletions

View file

@ -28,6 +28,7 @@ ReplayMode replay_mode = REPLAY_MODE_NONE;
/* Name of replay file */
static char *replay_filename;
ReplayState replay_state;
static GSList *replay_blockers;
bool replay_next_event_is(int event)
{
@ -289,6 +290,12 @@ void replay_start(void)
return;
}
if (replay_blockers) {
error_report("Record/replay: %s",
error_get_pretty(replay_blockers->data));
exit(1);
}
/* Timer for snapshotting will be set up here. */
replay_enable_events();
@ -324,3 +331,8 @@ void replay_finish(void)
replay_finish_events();
replay_mutex_destroy();
}
void replay_add_blocker(Error *reason)
{
replay_blockers = g_slist_prepend(replay_blockers, reason);
}