代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/libvirt 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 4123437e633f05af0ae8091d5db440597394ba36 Mon Sep 17 00:00:00 2001
From: zhaotianrui <zhaotianrui@loongson.cn>
Date: Wed, 11 Jan 2023 14:09:41 -0500
Subject: [PATCH 4/4] Implement the method of getting host info for loongarch
Implement method for loongarch to get host info, such as
cpu frequency, system info, etc.
Signed-off-by: zhaotianrui <zhaotianrui@loongson.cn>
---
src/util/virarch.c | 2 ++
src/util/virhostcpu.c | 2 +-
src/util/virsysinfo.c | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/util/virarch.c b/src/util/virarch.c
index decdbdd7ac..0520a1c80b 100644
--- a/src/util/virarch.c
+++ b/src/util/virarch.c
@@ -227,6 +227,8 @@ virArch virArchFromHost(void)
arch = VIR_ARCH_X86_64;
} else if (STREQ(ut.machine, "sw_64")) {
arch = VIR_ARCH_SW_64;
+ } else if (STREQ(ut.machine, "loongarch64")) {
+ arch = VIR_ARCH_LOONGARCH64;
} else {
/* Otherwise assume the canonical name */
if ((arch = virArchFromString(ut.machine)) == VIR_ARCH_NONE) {
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
index 5ec98d6016..ce3da7e6ec 100644
--- a/src/util/virhostcpu.c
+++ b/src/util/virhostcpu.c
@@ -577,7 +577,7 @@ virHostCPUParseFrequency(FILE *cpuinfo,
char line[1024];
/* No sensible way to retrieve CPU frequency */
- if (ARCH_IS_ARM(arch))
+ if (ARCH_IS_ARM(arch) || ARCH_IS_LOONGARCH(arch))
return 0;
if (ARCH_IS_X86(arch))
diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c
index 8a53702224..6d4778fed7 100644
--- a/src/util/virsysinfo.c
+++ b/src/util/virsysinfo.c
@@ -1190,7 +1190,7 @@ virSysinfoRead(void)
{
#if defined(__powerpc__)
return virSysinfoReadPPC();
-#elif defined(__arm__) || defined(__aarch64__)
+#elif defined(__arm__) || defined(__aarch64__) || defined(__loongarch__)
return virSysinfoReadARM();
#elif defined(__s390__) || defined(__s390x__)
return virSysinfoReadS390();
@@ -1198,6 +1198,7 @@ virSysinfoRead(void)
(defined(__x86_64__) || \
defined(__i386__) || \
defined(__amd64__) || \
+ defined(__loongarch__) || \
defined(__sw_64__))
return virSysinfoReadDMI();
#else /* WIN32 || not supported arch */
--
2.25.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。