@@ -21,5 +21,5 @@ struct MigrationThread {
QLIST_ENTRY(MigrationThread) node;
};
-MigrationThread *migration_threads_add(const char *name, int thread_id);
+MigrationThread *migration_threads_add(const char *name);
void migration_threads_remove(MigrationThread *info);
@@ -3467,8 +3467,7 @@ static void *migration_thread(void *opaque)
Error *local_err = NULL;
int ret;
- thread = migration_threads_add(MIGRATION_THREAD_SRC_MAIN,
- qemu_get_thread_id());
+ thread = migration_threads_add(MIGRATION_THREAD_SRC_MAIN);
rcu_register_thread();
@@ -575,7 +575,7 @@ static void *multifd_send_thread(void *opaque)
int ret = 0;
bool use_packets = multifd_use_packets();
- thread = migration_threads_add(p->name, qemu_get_thread_id());
+ thread = migration_threads_add(p->name);
trace_multifd_send_thread_start(p->id);
rcu_register_thread();
@@ -23,11 +23,12 @@ static void __attribute__((constructor)) migration_threads_init(void)
qemu_mutex_init(&migration_threads_lock);
}
-MigrationThread *migration_threads_add(const char *name, int thread_id)
+MigrationThread *migration_threads_add(const char *name)
{
MigrationThread *thread = g_new0(MigrationThread, 1);
+
thread->name = name;
- thread->thread_id = thread_id;
+ thread->thread_id = qemu_get_thread_id();
WITH_QEMU_LOCK_GUARD(&migration_threads_lock) {
QLIST_INSERT_HEAD(&migration_threads, thread, node);
It always fetches the ID of the curren thread, so there's no point passing it over. Signed-off-by: Peter Xu <peterx@redhat.com> --- migration/threadinfo.h | 2 +- migration/migration.c | 3 +-- migration/multifd.c | 2 +- migration/threadinfo.c | 5 +++-- 4 files changed, 6 insertions(+), 6 deletions(-)