[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/3] migration: report migration thread name to libvirt
From: |
Jiang Jiacheng |
Subject: |
[PATCH 1/3] migration: report migration thread name to libvirt |
Date: |
Fri, 20 Jan 2023 16:47:33 +0800 |
Report migration thread name to libvirt in order to
support query migration thread infomation by its name.
Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>
---
migration/migration.c | 3 +++
migration/multifd.c | 5 ++++-
qapi/migration.json | 12 ++++++++++++
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/migration/migration.c b/migration/migration.c
index 52b5d39244..b4ce458bb9 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -3955,6 +3955,9 @@ static void *migration_thread(void *opaque)
MigThrError thr_error;
bool urgent = false;
+ /* report migration thread name to libvirt */
+ qapi_event_send_migration_name("live_migration");
+
rcu_register_thread();
object_ref(OBJECT(s));
diff --git a/migration/multifd.c b/migration/multifd.c
index 000ca4d4ec..6e834c7111 100644
--- a/migration/multifd.c
+++ b/migration/multifd.c
@@ -17,6 +17,7 @@
#include "exec/ramblock.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
+#include "qapi/qapi-events-migration.h"
#include "ram.h"
#include "migration.h"
#include "socket.h"
@@ -24,7 +25,6 @@
#include "qemu-file.h"
#include "trace.h"
#include "multifd.h"
-
#include "qemu/yank.h"
#include "io/channel-socket.h"
#include "yank_functions.h"
@@ -650,6 +650,9 @@ static void *multifd_send_thread(void *opaque)
int ret = 0;
bool use_zero_copy_send = migrate_use_zero_copy_send();
+ /* report multifd thread name to libvirt */
+ qapi_event_send_migration_name(p->name);
+
trace_multifd_send_thread_start(p->id);
rcu_register_thread();
diff --git a/qapi/migration.json b/qapi/migration.json
index 88ecf86ac8..b0cf366ac0 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -1286,6 +1286,18 @@
{ 'event': 'MIGRATION_PASS',
'data': { 'pass': 'int' } }
+##
+# @MIGRATION_NAME:
+#
+# Emitted when migration thread appear
+#
+# @name: name of migration thread
+#
+# Since: 7.2
+##
+{ 'event': 'MIGRATION_NAME',
+ 'data': { 'name': 'str' } }
+
##
# @COLOMessage:
#
--
2.33.0
- Re: [PATCH 3/3] migration: save/delete migration thread info, (continued)
[PATCH 2/3] migration: implement query migration threadinfo by name, Jiang Jiacheng, 2023/01/20
[PATCH 1/3] migration: report migration thread name to libvirt,
Jiang Jiacheng <=