@@ -77,4 +77,17 @@ void replay_save_random(int ret, void *buf, size_t len);
/* Loads the saved values for the random number generator */
int replay_read_random(void *buf, size_t len);
+/* Replay locking
+ *
+ * The locks are needed to protect the shared structures and log file
+ * when doing record/replay. They also are the main sync-point between
+ * the main-loop thread and the vCPU thread. This was a role
+ * previously filled by the BQL which has been busy trying to reduce
+ * its impact across the code. This ensures blocks of events stay
+ * sequential and reproducible.
+ */
+
+void replay_mutex_lock(void);
+void replay_mutex_unlock(void);
+
#endif
@@ -51,19 +51,6 @@ typedef struct ReplayNetState ReplayNetState;
/* Name of the initial VM snapshot */
extern char *replay_snapshot;
-/* Replay locking
- *
- * The locks are needed to protect the shared structures and log file
- * when doing record/replay. They also are the main sync-point between
- * the main-loop thread and the vCPU thread. This was a role
- * previously filled by the BQL which has been busy trying to reduce
- * its impact across the code. This ensures blocks of events stay
- * sequential and reproducible.
- */
-
-void replay_mutex_lock(void);
-void replay_mutex_unlock(void);
-
/* Processing the instructions */
/*! Returns number of executed instructions. */
@@ -94,3 +94,11 @@ void qmp_replay_seek(int64_t icount, Error **errp)
error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND,
"replay support not available");
}
+
+void replay_mutex_lock(void)
+{
+}
+
+void replay_mutex_unlock(void)
+{
+}
@@ -46,6 +46,10 @@ if have_block or have_ga
stub_ss.add(files('qmp-quit.c'))
endif
+if have_block or have_ga or have_user
+ stub_ss.add(files('replay-mutex.c'))
+endif
+
if have_block or have_user
stub_ss.add(files('qtest.c'))
stub_ss.add(files('vm-stop.c'))
new file mode 100644
@@ -0,0 +1,10 @@
+#include "qemu/osdep.h"
+#include "exec/replay-core.h"
+
+void replay_mutex_lock(void)
+{
+}
+
+void replay_mutex_unlock(void)
+{
+}
@@ -41,14 +41,6 @@ bool replay_checkpoint(ReplayCheckpoint checkpoint)
return true;
}
-void replay_mutex_lock(void)
-{
-}
-
-void replay_mutex_unlock(void)
-{
-}
-
void replay_register_char_driver(struct Chardev *chr)
{
}
Sharing pause_all_vcpus() with qemu-user requires providing no-op definitions of replay mutex functions. Make these functions available via replay-core.h and move the existing stubs to a separate file. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> --- include/exec/replay-core.h | 13 +++++++++++++ include/sysemu/replay.h | 13 ------------- replay/stubs-system.c | 8 ++++++++ stubs/meson.build | 4 ++++ stubs/replay-mutex.c | 10 ++++++++++ stubs/replay-tools.c | 8 -------- 6 files changed, 35 insertions(+), 21 deletions(-) create mode 100644 stubs/replay-mutex.c