qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/9] replay: simplify async event processing


From: Pavel Dovgalyuk
Subject: Re: [PATCH 4/9] replay: simplify async event processing
Date: Wed, 4 May 2022 10:10:10 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

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

[Prev in Thread] Current Thread [Next in Thread]