migration: Avoid two src-downtime-end tracepoints for postcopy
authorPeter Xu <peterx@redhat.com>
Tue, 14 Jan 2025 23:07:34 +0000 (18:07 -0500)
committerFabiano Rosas <farosas@suse.de>
Wed, 29 Jan 2025 14:56:40 +0000 (11:56 -0300)
Postcopy can trigger this tracepoint twice, while only the 1st one is
valid.  Avoid triggering the 2nd tracepoint just like what we do with
recording the total downtime.

Signed-off-by: Peter Xu <peterx@redhat.com>
Tested-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Juraj Marcin <jmarcin@redhat.com>
Link: https://lore.kernel.org/r/20250114230746.3268797-5-peterx@redhat.com
Signed-off-by: Fabiano Rosas <farosas@suse.de>
migration/migration.c

index a9fe9c282179fe81904800d1a8f896cbb6901c3d..07b6b730b78e9ebfd625714ff6832457fb7c7cfb 100644 (file)
@@ -129,9 +129,8 @@ static void migration_downtime_end(MigrationState *s)
      */
     if (!s->downtime) {
         s->downtime = now - s->downtime_start;
+        trace_vmstate_downtime_checkpoint("src-downtime-end");
     }
-
-    trace_vmstate_downtime_checkpoint("src-downtime-end");
 }
 
 static bool migration_needs_multiple_sockets(void)