9 Star 0 Fork 38

src-anolis-os/qemu-kvm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fixup-can-t-find-cpu-type.patch 924 Bytes
一键复制 编辑 原始数据 按行查看 历史
Xianglai Li 提交于 2024-08-29 19:00 +08:00 . fix compile error for loongarch
From a08da06ba1ca817465e894737dced362babc9f18 Mon Sep 17 00:00:00 2001
From: lixianglai <lixianglai@loongson.cn>
Date: Mon, 29 May 2023 07:51:55 -0400
Subject: [PATCH 19/28] fixup can't find cpu type.
Signed-off-by: lixianglai <lixianglai@loongson.cn>
---
hw/loongarch/larch_3a.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hw/loongarch/larch_3a.c b/hw/loongarch/larch_3a.c
index f83bd3750..5e271f339 100644
--- a/hw/loongarch/larch_3a.c
+++ b/hw/loongarch/larch_3a.c
@@ -547,7 +547,15 @@ static char *get_host_cpu_model_name(void)
fprintf(stderr, "read err...\n");
}
close(fd);
- buf_p = strstr(buf, "name");
+ buf_p = strstr(buf, "Name");
+ if (!buf_p) {
+ buf_p = strstr(buf, "name");
+ }
+ if (!buf_p) {
+ fprintf(stderr, "Can't find cpu name\n");
+ return 0;
+ }
+
while (*buf_p != ':') {
buf_p++;
--
2.43.5
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/qemu-kvm.git
git@gitee.com:src-anolis-os/qemu-kvm.git
src-anolis-os
qemu-kvm
qemu-kvm
a8-virt-stream-an

搜索帮助

371d5123 14472233 46e8bd33 14472233