diff options
author | Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> | 2018-09-12 11:18:59 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-10-02 19:08:51 +0200 |
commit | d873fe03766481b72549ff15ee647c086a98c12f (patch) | |
tree | c9301fc63c8d3024394102d9a985eaffae7af6a1 /replay/replay-events.c | |
parent | 0c08185f8fe1eb20edec1a2bf32b4d219cc023f0 (diff) |
replay: flush events when exiting
This patch adds events processing when emulation finishes instead
of just cleaning the queue. Now the bdrv coroutines will be in consistent
state when emulator closes. It allows correct polling of the block layer
at exit.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Message-Id: <20180912081859.3228.79735.stgit@pasha-VirtualBox>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'replay/replay-events.c')
-rw-r--r-- | replay/replay-events.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/replay/replay-events.c b/replay/replay-events.c index 707de3867b..0964a82838 100644 --- a/replay/replay-events.c +++ b/replay/replay-events.c @@ -94,18 +94,6 @@ void replay_disable_events(void) } } -void replay_clear_events(void) -{ - g_assert(replay_mutex_locked()); - - while (!QTAILQ_EMPTY(&events_list)) { - Event *event = QTAILQ_FIRST(&events_list); - QTAILQ_REMOVE(&events_list, event, events); - - g_free(event); - } -} - /*! Adds specified async event to the queue */ void replay_add_event(ReplayAsyncEventKind event_kind, void *opaque, @@ -308,7 +296,7 @@ void replay_init_events(void) void replay_finish_events(void) { events_enabled = false; - replay_clear_events(); + replay_flush_events(); } bool replay_events_enabled(void) |