From 7caa5d818e0fa0e1cee2513f2fde4e81f8b5cc13 Mon Sep 17 00:00:00 2001 From: zhengchuan Date: Mon, 5 Dec 2022 20:52:25 +0800 Subject: [PATCH] migration: report migration related thread pid to libvirt in order to control migration thread cgroup, we need to report migration related thread pid to libvirt Signed-off-by:zhengchuan --- migration/migration.c | 3 +++ qapi/migration.json | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index 3ce04b2aaf..7c2fdde26b 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -3299,6 +3299,9 @@ static void *migration_thread(void *opaque) MigThrError thr_error; bool urgent = false; + /* report migration thread pid to libvirt */ + qapi_event_send_migration_pid(qemu_get_thread_id()); + thread = migration_threads_add("live_migration", qemu_get_thread_id()); rcu_register_thread(); diff --git a/qapi/migration.json b/qapi/migration.json index 29af841f4e..b442d0d878 100644 --- a/qapi/migration.json +++ b/qapi/migration.json @@ -1447,6 +1447,18 @@ { 'event': 'MIGRATION_PASS', 'data': { 'pass': 'int' } } +## +# @MIGRATION_PID: +# +# Emitted when migration thread appear +# +# @pid: pid of migration thread +# +# Since: EulerOS Virtual +## +{ 'event': 'MIGRATION_PID', + 'data': { 'pid': 'int' } } + ## # @COLOMessage: # -- 2.27.0