mirror of https://gitee.com/openkylin/qemu.git
migration: save/delete migration thread info
To support query migration thread infomation, save and delete thread(live_migration and multifdsend) information at thread creation and finish. Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
671326201d
commit
1b1f4ab69c
|
@ -58,6 +58,7 @@
|
|||
#include "net/announce.h"
|
||||
#include "qemu/queue.h"
|
||||
#include "multifd.h"
|
||||
#include "threadinfo.h"
|
||||
#include "qemu/yank.h"
|
||||
#include "sysemu/cpus.h"
|
||||
#include "yank_functions.h"
|
||||
|
@ -4028,10 +4029,13 @@ static void qemu_savevm_wait_unplug(MigrationState *s, int old_state,
|
|||
static void *migration_thread(void *opaque)
|
||||
{
|
||||
MigrationState *s = opaque;
|
||||
MigrationThread *thread = NULL;
|
||||
int64_t setup_start = qemu_clock_get_ms(QEMU_CLOCK_HOST);
|
||||
MigThrError thr_error;
|
||||
bool urgent = false;
|
||||
|
||||
thread = MigrationThreadAdd("live_migration", qemu_get_thread_id());
|
||||
|
||||
rcu_register_thread();
|
||||
|
||||
object_ref(OBJECT(s));
|
||||
|
@ -4108,6 +4112,7 @@ static void *migration_thread(void *opaque)
|
|||
migration_iteration_finish(s);
|
||||
object_unref(OBJECT(s));
|
||||
rcu_unregister_thread();
|
||||
MigrationThreadDel(thread);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "qemu-file.h"
|
||||
#include "trace.h"
|
||||
#include "multifd.h"
|
||||
#include "threadinfo.h"
|
||||
|
||||
#include "qemu/yank.h"
|
||||
#include "io/channel-socket.h"
|
||||
|
@ -649,10 +650,13 @@ int multifd_send_sync_main(QEMUFile *f)
|
|||
static void *multifd_send_thread(void *opaque)
|
||||
{
|
||||
MultiFDSendParams *p = opaque;
|
||||
MigrationThread *thread = NULL;
|
||||
Error *local_err = NULL;
|
||||
int ret = 0;
|
||||
bool use_zero_copy_send = migrate_use_zero_copy_send();
|
||||
|
||||
thread = MigrationThreadAdd(p->name, qemu_get_thread_id());
|
||||
|
||||
trace_multifd_send_thread_start(p->id);
|
||||
rcu_register_thread();
|
||||
|
||||
|
@ -762,6 +766,7 @@ out:
|
|||
qemu_mutex_unlock(&p->mutex);
|
||||
|
||||
rcu_unregister_thread();
|
||||
MigrationThreadDel(thread);
|
||||
trace_multifd_send_thread_end(p->id, p->num_packets, p->total_normal_pages);
|
||||
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue