1 Star 0 Fork 71

xiuqing/libvirt_source

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
migration-multifd-pin-add-qemu-monitor-callback-func.patch 4.51 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2024-04-02 20:56 . libvirt update to version 9.10.0-4:
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiuqing1/libvirt_source.git
git@gitee.com:xiuqing1/libvirt_source.git
xiuqing1
libvirt_source
libvirt_source
master

搜索帮助