1 Star 0 Fork 70

Jiabo Feng/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
migration-migration-pin-add-some-migration-multiFd-p.patch 5.13 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2024-04-02 20:56 . libvirt update to version 9.10.0-4:
From c934558ff8d535a91146be93d45c730b8023a8cd Mon Sep 17 00:00:00 2001
From: zhengchuan <zhengchuan@huawei.com>
Date: Wed, 14 Dec 2022 11:07:58 +0800
Subject: [PATCH] migration/migration-pin:add some migration/multiFd params
add migration/multiFd params.
Signed-off-by:zhengchuan<zhengchuan@huawei.com>
---
src/conf/domain_conf.c | 8 ++++++++
src/conf/domain_conf.h | 12 ++++++++++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_domain.c | 6 ++++++
src/qemu/qemu_domain.h | 5 ++++-
src/qemu/qemu_migration.c | 1 +
src/util/vircgroup.c | 3 +++
src/util/vircgroup.h | 1 +
8 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 22ad43e1d7..f54f99f379 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -31075,6 +31075,14 @@ virDomainDefHasSpiceGraphics(const virDomainDef *def)
return false;
}
+void
+virDomainMigrationIDDefFree(virDomainMigrationIDDefPtr def)
+{
+ if (!def)
+ return;
+ virBitmapFree(def->cpumask);
+ VIR_FREE(def);
+}
ssize_t
virDomainWatchdogDefFind(const virDomainDef *def,
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index ed07859bc5..196053d950 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -27,6 +27,7 @@
#include <libxml/xpath.h>
#include "internal.h"
+#include "viralloc.h"
#include "virconftypes.h"
#include "capabilities.h"
#include "cpu_conf.h"
@@ -4498,3 +4499,14 @@ virDomainObjGetMessages(virDomainObj *vm,
bool
virDomainDefHasSpiceGraphics(const virDomainDef *def);
+
+typedef struct _virDomainMigrationIDDef virDomainMigrationIDDef;
+typedef virDomainMigrationIDDef *virDomainMigrationIDDefPtr;
+struct _virDomainMigrationIDDef {
+ bool autofill;
+ int thread_id;
+ virBitmap *cpumask;
+ virDomainThreadSchedParam sched;
+};
+
+void virDomainMigrationIDDefFree(virDomainMigrationIDDefPtr def);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 553b01b8c0..4d712f0d79 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -523,6 +523,7 @@ virDomainMemoryModelTypeToString;
virDomainMemoryRemove;
virDomainMemorySourceTypeFromString;
virDomainMemorySourceTypeToString;
+virDomainMigrationIDDefFree;
virDomainMouseModeTypeFromString;
virDomainMouseModeTypeToString;
virDomainNetAllocateActualDevice;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 953808fcfe..6b09c15f7a 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1879,6 +1879,12 @@ qemuDomainObjPrivateFree(void *data)
virObjectUnref(priv->monConfig);
g_free(priv->lockState);
g_free(priv->origname);
+ VIR_FREE(priv->migrationPids);
+ virBitmapFree(priv->pcpumap);
+
+ VIR_FREE(priv->migrationMultiFdPids);
+ priv->migrationMultiFdPids = NULL;
+ priv->migrationMultiFdCount = 0;
virChrdevFree(priv->devs);
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 1e56e50672..0eff9eab72 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -146,7 +146,9 @@ struct _qemuDomainObjPrivate {
unsigned long long preMigrationMemlock; /* Original RLIMIT_MEMLOCK in case
it was changed for the current
migration job. */
-
+ char *migrationPids;
+ char *migrationMultiFdPids;
+ unsigned int migrationMultiFdCount;
virChrdevs *devs;
qemuDomainCleanupCallback *cleanupCallbacks;
@@ -166,6 +168,7 @@ struct _qemuDomainObjPrivate {
/* Bitmaps below hold data from the auto NUMA feature */
virBitmap *autoNodeset;
virBitmap *autoCpuset;
+ virBitmap *pcpumap;
bool signalIOError; /* true if the domain condition should be signalled on
I/O error */
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 7ae1cd7051..b13f2e0c24 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3362,6 +3362,7 @@ qemuMigrationDstPrepareFresh(virQEMUDriver *driver,
priv = vm->privateData;
priv->origname = g_strdup(origname);
+ VIR_FREE(priv->migrationPids);
if (taint_hook) {
/* Domain XML has been altered by a hook script. */
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index b424e1b5d4..62c6df2206 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -1123,6 +1123,9 @@ virCgroupNewThread(virCgroup *domain,
case VIR_CGROUP_THREAD_IOTHREAD:
name = g_strdup_printf("iothread%d", id);
break;
+ case VIR_CGROUP_THREAD_MIGRATION_THREAD:
+ name = g_strdup_printf("migthread%d", id);
+ break;
case VIR_CGROUP_THREAD_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected name value %1$d"), nameval);
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index adf3850b22..c5f6ddd7a6 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -53,6 +53,7 @@ typedef enum {
VIR_CGROUP_THREAD_VCPU = 0,
VIR_CGROUP_THREAD_EMULATOR,
VIR_CGROUP_THREAD_IOTHREAD,
+ VIR_CGROUP_THREAD_MIGRATION_THREAD,
VIR_CGROUP_THREAD_LAST
} virCgroupThreadName;
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/JiaboFeng/libvirt.git
git@gitee.com:JiaboFeng/libvirt.git
JiaboFeng
libvirt
libvirt
master

搜索帮助