diff mbox series

[04/16] migration: Avoid two src-downtime-end tracepoints for postcopy

Message ID 20250114230746.3268797-5-peterx@redhat.com (mailing list archive)
State New
Headers show
Series migration: Switchover phase refactoring | expand

Commit Message

Peter Xu Jan. 14, 2025, 11:07 p.m. UTC
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>
---
 migration/migration.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/migration/migration.c b/migration/migration.c
index 0eb28e850d..e1fc1a7fdc 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -125,9 +125,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)