aboutsummaryrefslogtreecommitdiff
path: root/migration/colo.c
diff options
context:
space:
mode:
authorRao, Lei <lei.rao@intel.com>2021-12-15 01:19:45 +0800
committerJuan Quintela <quintela@redhat.com>2021-12-15 10:31:42 +0100
commit9c5c8ff24e2cc9b4db76c33aa360563407832656 (patch)
treec0c192b46149f1e6fffd41d8027e74a2b9bd258a /migration/colo.c
parent077fbb5942b56826f731de16caae3122a30aab22 (diff)
downloadqemu-9c5c8ff24e2cc9b4db76c33aa360563407832656.zip
qemu-9c5c8ff24e2cc9b4db76c33aa360563407832656.tar.gz
qemu-9c5c8ff24e2cc9b4db76c33aa360563407832656.tar.bz2
COLO: Move some trace code behind qemu_mutex_unlock_iothread()
There is no need to put some trace code in the critical section. So, moving it behind qemu_mutex_unlock_iothread() can reduce the lock time. Signed-off-by: Lei Rao <lei.rao@intel.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'migration/colo.c')
-rw-r--r--migration/colo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/migration/colo.c b/migration/colo.c
index 4a772af..5f7071b 100644
--- a/migration/colo.c
+++ b/migration/colo.c
@@ -680,8 +680,8 @@ static void colo_incoming_process_checkpoint(MigrationIncomingState *mis,
qemu_mutex_lock_iothread();
vm_stop_force_state(RUN_STATE_COLO);
- trace_colo_vm_state_change("run", "stop");
qemu_mutex_unlock_iothread();
+ trace_colo_vm_state_change("run", "stop");
/* FIXME: This is unnecessary for periodic checkpoint mode */
colo_send_message(mis->to_src_file, COLO_MESSAGE_CHECKPOINT_REPLY,
@@ -783,8 +783,8 @@ static void colo_incoming_process_checkpoint(MigrationIncomingState *mis,
vmstate_loading = false;
vm_start();
- trace_colo_vm_state_change("stop", "run");
qemu_mutex_unlock_iothread();
+ trace_colo_vm_state_change("stop", "run");
if (failover_get_state() == FAILOVER_STATUS_RELAUNCH) {
return;
@@ -887,8 +887,8 @@ void *colo_process_incoming_thread(void *opaque)
abort();
#endif
vm_start();
- trace_colo_vm_state_change("stop", "run");
qemu_mutex_unlock_iothread();
+ trace_colo_vm_state_change("stop", "run");
colo_send_message(mis->to_src_file, COLO_MESSAGE_CHECKPOINT_READY,
&local_err);