qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v7 13/22] replay: push replay_mutex_lock up the


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v7 13/22] replay: push replay_mutex_lock up the call tree
Date: Mon, 12 Mar 2018 14:02:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 27/02/2018 10:52, Pavel Dovgalyuk wrote:
>  
> +void replay_init_locks(void)
> +{
> +    replay_mutex_init();
> +}
> +

This should not be needed as a public function: until replay_mode
is set, replay_lock and replay_unlock do nothing.  I'm squashing this:

diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h
index eeec66b8f4..3ced6bc231 100644
--- a/include/sysemu/replay.h
+++ b/include/sysemu/replay.h
@@ -63,8 +63,6 @@ void replay_mutex_unlock(void);
 
 /* Replay process control functions */
 
-/*! Enables and take replay locks (even if we don't use it) */
-void replay_init_locks(void);
 /*! Enables recording or saving event log with specified parameters */
 void replay_configure(struct QemuOpts *opts);
 /*! Initializes timers used for snapshotting and enables events recording */
diff --git a/replay/replay.c b/replay/replay.c
index a8b57cd077..b3e814a875 100644
--- a/replay/replay.c
+++ b/replay/replay.c
@@ -207,11 +207,6 @@ out:
     return res;
 }
 
-void replay_init_locks(void)
-{
-    replay_mutex_init();
-}
-
 static void replay_enable(const char *fname, int mode)
 {
     const char *fmode = NULL;
@@ -238,8 +233,9 @@ static void replay_enable(const char *fname, int mode)
     }
 
     replay_filename = g_strdup(fname);
-
     replay_mode = mode;
+    replay_mutex_init();
+
     replay_state.data_kind = -1;
     replay_state.instructions_count = 0;
     replay_state.current_step = 0;
diff --git a/vl.c b/vl.c
index 08e81c46a0..5925a4b502 100644
--- a/vl.c
+++ b/vl.c
@@ -3059,7 +3059,6 @@ int main(int argc, char **argv, char **envp)
     qemu_init_cpu_list();
     qemu_init_cpu_loop();
 
-    replay_init_locks();
     qemu_mutex_lock_iothread();
 
     atexit(qemu_run_exit_notifiers);



reply via email to

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