aboutsummaryrefslogtreecommitdiff
path: root/replay
diff options
context:
space:
mode:
Diffstat (limited to 'replay')
-rw-r--r--replay/replay-events.c8
-rw-r--r--replay/replay-internal.h6
-rw-r--r--replay/replay-snapshot.c1
3 files changed, 13 insertions, 2 deletions
diff --git a/replay/replay-events.c b/replay/replay-events.c
index 4eb2ea3604..c513913671 100644
--- a/replay/replay-events.c
+++ b/replay/replay-events.c
@@ -309,3 +309,11 @@ bool replay_events_enabled(void)
{
return events_enabled;
}
+
+uint64_t blkreplay_next_id(void)
+{
+ if (replay_events_enabled()) {
+ return replay_state.block_request_id++;
+ }
+ return 0;
+}
diff --git a/replay/replay-internal.h b/replay/replay-internal.h
index e07eb7d45d..9117e442d0 100644
--- a/replay/replay-internal.h
+++ b/replay/replay-internal.h
@@ -68,6 +68,10 @@ typedef struct ReplayState {
unsigned int has_unread_data;
/*! Temporary variable for saving current log offset. */
uint64_t file_offset;
+ /*! Next block operation id.
+ This counter is global, because requests from different
+ block devices should not get overlapping ids. */
+ uint64_t block_request_id;
} ReplayState;
extern ReplayState replay_state;
@@ -123,8 +127,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);
-/*! 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 */
diff --git a/replay/replay-snapshot.c b/replay/replay-snapshot.c
index a17e80e26c..498059734d 100644
--- a/replay/replay-snapshot.c
+++ b/replay/replay-snapshot.c
@@ -50,6 +50,7 @@ static const VMStateDescription vmstate_replay = {
VMSTATE_UINT32(data_kind, ReplayState),
VMSTATE_UINT32(has_unread_data, ReplayState),
VMSTATE_UINT64(file_offset, ReplayState),
+ VMSTATE_UINT64(block_request_id, ReplayState),
VMSTATE_END_OF_LIST()
},
};