On 26.04.2022 23:26, Richard Henderson wrote:
On 4/22/22 04:53, Pavel Dovgalyuk wrote:
  static Event *replay_read_event(void)
  {
      Event *event;
+    int event_kind = replay_state.data_kind - EVENT_ASYNC;
Use the enum type.
Ok.

+/* Asynchronous events IDs */
+
+enum ReplayAsyncEventKind {
+    REPLAY_ASYNC_EVENT_BH,
+    REPLAY_ASYNC_EVENT_BH_ONESHOT,
+    REPLAY_ASYNC_EVENT_INPUT,
+    REPLAY_ASYNC_EVENT_INPUT_SYNC,
+    REPLAY_ASYNC_EVENT_CHAR_READ,
+    REPLAY_ASYNC_EVENT_BLOCK,
+    REPLAY_ASYNC_EVENT_NET,
+    REPLAY_ASYNC_COUNT
+};
...
-enum ReplayAsyncEventKind {
-    REPLAY_ASYNC_EVENT_BH,
-    REPLAY_ASYNC_EVENT_BH_ONESHOT,
-    REPLAY_ASYNC_EVENT_INPUT,
-    REPLAY_ASYNC_EVENT_INPUT_SYNC,
-    REPLAY_ASYNC_EVENT_CHAR_READ,
-    REPLAY_ASYNC_EVENT_BLOCK,
-    REPLAY_ASYNC_EVENT_NET,
-    REPLAY_ASYNC_COUNT
-};
-
  typedef enum ReplayAsyncEventKind ReplayAsyncEventKind;
Merge or move the typedef with the enum definition, to keep them together.
Ok.

@@ -59,7 +59,6 @@ static const VMStateDescription vmstate_replay = {
          VMSTATE_UINT32(has_unread_data, ReplayState),
          VMSTATE_UINT64(file_offset, ReplayState),
          VMSTATE_UINT64(block_request_id, ReplayState),
-        VMSTATE_INT32(read_event_kind, ReplayState),
          VMSTATE_UINT64(read_event_id, ReplayState),
          VMSTATE_END_OF_LIST()
      },
Second change here, are you bumping version at the end and I haven't 
seen it yet?
I'm bumping only REPLAY_VERSION which will prevent usage of the wrong 
vmstate.


Reply via email to