代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From c9074196761ed6c180a53ccdc0bb692f31491158 Mon Sep 17 00:00:00 2001
From: zhengchuan <zhengchuan@huawei.com>
Date: Wed, 30 Nov 2022 15:59:27 +0800
Subject: [PATCH] migration/multifd-pin: add qemu monitor callback functions
add qemu monitor callback functions
Signed-off-by:zhengchuan<zhengchuan@huawei.com>
---
src/qemu/qemu_monitor.c | 9 +++++++++
src/qemu/qemu_monitor.h | 8 ++++++++
src/qemu/qemu_monitor_json.c | 15 +++++++++++++++
3 files changed, 32 insertions(+)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 1d5d47ea22..e4a1852d05 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1410,6 +1410,15 @@ qemuMonitorEmitMigrationPid(qemuMonitor *mon,
}
+void
+qemuMonitorEmitMigrationMultiFdPids(qemuMonitor *mon,
+ int mpid)
+{
+ VIR_DEBUG("mon=%p, pass=%d", mon, mpid);
+ QEMU_MONITOR_CALLBACK(mon, domainMigrationMultiFdPids, mon->vm, mpid);
+}
+
+
void
qemuMonitorEmitRdmaGidStatusChanged(qemuMonitor *mon,
const char *netdev,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 646e97a8e6..e893542971 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -332,6 +332,10 @@ typedef void (*qemuMonitorDomainMigrationPidCallback)(qemuMonitor *mon,
virDomainObj *vm,
int mcpid);
+typedef void (*qemuMonitorDomainMigrationMultiFdPidsCallback)(qemuMonitor *mon,
+ virDomainObj *vm,
+ int mcpid);
+
typedef enum {
QEMU_MONITOR_MEMORY_FAILURE_RECIPIENT_HYPERVISOR,
QEMU_MONITOR_MEMORY_FAILURE_RECIPIENT_GUEST,
@@ -405,6 +409,7 @@ struct _qemuMonitorCallbacks {
qemuMonitorDomainMemoryDeviceSizeChange domainMemoryDeviceSizeChange;
qemuMonitorDomainDeviceUnplugErrCallback domainDeviceUnplugError;
qemuMonitorDomainMigrationPidCallback domainMigrationPid;
+ qemuMonitorDomainMigrationMultiFdPidsCallback domainMigrationMultiFdPids;
qemuMonitorDomainNetdevStreamDisconnectedCallback domainNetdevStreamDisconnected;
};
@@ -512,6 +517,9 @@ void qemuMonitorEmitMigrationPass(qemuMonitor *mon,
void qemuMonitorEmitMigrationPid(qemuMonitor *mon, int mpid);
+void qemuMonitorEmitMigrationMultiFdPids(qemuMonitor *mon,
+ int mpid);
+
void qemuMonitorEmitAcpiOstInfo(qemuMonitor *mon,
const char *alias,
const char *slotType,
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 4c1b8c9eb7..acd5ce5297 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -85,6 +85,7 @@ static void qemuMonitorJSONHandleMemoryFailure(qemuMonitor *mon, virJSONValue *d
static void qemuMonitorJSONHandleMemoryDeviceSizeChange(qemuMonitor *mon, virJSONValue *data);
static void qemuMonitorJSONHandleDeviceUnplugErr(qemuMonitor *mon, virJSONValue *data);
static void qemuMonitorJSONHandleMigrationPid(qemuMonitor *mon, virJSONValue *data);
+static void qemuMonitorJSONHandleMigrationMultiFdPids(qemuMonitor *mon, virJSONValue *data);
static void qemuMonitorJSONHandleNetdevStreamDisconnected(qemuMonitor *mon, virJSONValue *data);
typedef struct {
@@ -107,6 +108,7 @@ static qemuEventHandler eventHandlers[] = {
{ "MEMORY_DEVICE_SIZE_CHANGE", qemuMonitorJSONHandleMemoryDeviceSizeChange, },
{ "MEMORY_FAILURE", qemuMonitorJSONHandleMemoryFailure, },
{ "MIGRATION", qemuMonitorJSONHandleMigrationStatus, },
+ { "MIGRATION_MULTIFD_PID", qemuMonitorJSONHandleMigrationMultiFdPids, },
{ "MIGRATION_PASS", qemuMonitorJSONHandleMigrationPass, },
{ "MIGRATION_PID", qemuMonitorJSONHandleMigrationPid, },
{ "NETDEV_STREAM_DISCONNECTED", qemuMonitorJSONHandleNetdevStreamDisconnected, },
@@ -146,6 +148,19 @@ static void qemuMonitorJSONHandleMigrationPid(qemuMonitor *mon,
qemuMonitorEmitMigrationPid(mon, mpid);
}
+static void qemuMonitorJSONHandleMigrationMultiFdPids(qemuMonitor *mon,
+ virJSONValue *data)
+{
+ int mpid;
+
+ if (virJSONValueObjectGetNumberInt(data, "pid", &mpid) < 0) {
+ VIR_WARN("missing multifd pid in migration-multifd-pid event");
+ return;
+ }
+
+ qemuMonitorEmitMigrationMultiFdPids(mon, mpid);
+}
+
static int
qemuMonitorEventCompare(const void *key, const void *elt)
{
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。