[PATCH 1/7] migration: Unify names of migration src main thread

Peter Xu posted 7 patches 1 month, 3 weeks ago
[PATCH 1/7] migration: Unify names of migration src main thread
Posted by Peter Xu 1 month, 3 weeks ago
Make pthread name match with what we report in query-migrationthreads.

We used to report the same, but not anymore after 60ce47675d ("migration:
Rename thread debug names").  Not a huge deal but it was still good to
follow.

Multifd threads are still matched because at least on the src the QMP
facility reused p->name.  The QMP command missed dest multifd threads
though, but that's another thing to address later.

Not copy stable, as we'd better keep the names not changed for stable
branches in QMP responses (even though we shouldn't guarantee ABI stability
on the names anyway).

Cc: Juraj Marcin <jmarcin@redhat.com>
Reported-by: Prasad Pandit <ppandit@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 migration/migration.h | 2 ++
 migration/migration.c | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/migration/migration.h b/migration/migration.h
index 38aa1402d5..519455796d 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -28,6 +28,8 @@
 #include "sysemu/runstate.h"
 #include "migration/misc.h"
 
+#define  MIGRATION_THREAD_SRC_MAIN  "mig/src/main"
+
 struct PostcopyBlocktimeContext;
 
 #define  MIGRATION_RESUME_ACK_VALUE  (1)
diff --git a/migration/migration.c b/migration/migration.c
index ae2be31557..505b62c8f3 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3467,7 +3467,8 @@ static void *migration_thread(void *opaque)
     Error *local_err = NULL;
     int ret;
 
-    thread = migration_threads_add("live_migration", qemu_get_thread_id());
+    thread = migration_threads_add(MIGRATION_THREAD_SRC_MAIN,
+                                   qemu_get_thread_id());
 
     rcu_register_thread();
 
@@ -3820,7 +3821,7 @@ void migrate_fd_connect(MigrationState *s, Error *error_in)
         qemu_thread_create(&s->thread, "mig/snapshot",
                 bg_migration_thread, s, QEMU_THREAD_JOINABLE);
     } else {
-        qemu_thread_create(&s->thread, "mig/src/main",
+        qemu_thread_create(&s->thread, MIGRATION_THREAD_SRC_MAIN,
                 migration_thread, s, QEMU_THREAD_JOINABLE);
     }
     s->migration_thread_running = true;
-- 
2.45.0