diff options
author | Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> | 2015-09-17 19:24:22 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-11-06 10:16:02 +0100 |
commit | c0c071d05279ec1429352200affc5c70bb4e5980 (patch) | |
tree | deff0163aa688b841d7ef4bc3571c0dcfefee924 /replay/replay-internal.h | |
parent | 6f0609697f3670bf755a91477487507a8ffee471 (diff) |
replay: asynchronous events infrastructure
This patch adds module for saving and replaying asynchronous events.
These events include network packets, keyboard and mouse input,
USB packets, thread pool and bottom halves callbacks.
All events are stored in the queue to be processed at synchronization points
such as beginning of TB execution, or checkpoint in the iothread.
Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Message-Id: <20150917162422.8676.88696.stgit@PASHA-ISP.def.inno>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Diffstat (limited to 'replay/replay-internal.h')
-rw-r--r-- | replay/replay-internal.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/replay/replay-internal.h b/replay/replay-internal.h index 5ff1c14287..23807ca413 100644 --- a/replay/replay-internal.h +++ b/replay/replay-internal.h @@ -21,9 +21,19 @@ enum ReplayEvents { EVENT_INTERRUPT, /* for emulated exceptions */ EVENT_EXCEPTION, + /* for async events */ + EVENT_ASYNC, EVENT_COUNT }; +/* Asynchronous events IDs */ + +enum ReplayAsyncEventKind { + REPLAY_ASYNC_COUNT +}; + +typedef enum ReplayAsyncEventKind ReplayAsyncEventKind; + typedef struct ReplayState { /*! Current step - number of processed instructions and timer events. */ uint64_t current_step; @@ -75,4 +85,23 @@ void replay_save_instructions(void); \return true, if event was found */ bool replay_next_event_is(int event); +/* Asynchronous events queue */ + +/*! Initializes events' processing internals */ +void replay_init_events(void); +/*! Clears internal data structures for events handling */ +void replay_finish_events(void); +/*! Enables storing events in the queue */ +void replay_enable_events(void); +/*! Flushes events queue */ +void replay_flush_events(void); +/*! Clears events list before loading new VM state */ +void replay_clear_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 */ +void replay_save_events(int checkpoint); +/*! Read events from the file into the input queue */ +void replay_read_events(int checkpoint); + #endif |