1 Star 0 Fork 16

src-openeuler-fork/vmtop

forked from src-openEuler/vmtop 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
domain-change-method-of-getting-domain-id.patch 1.26 KB
一键复制 编辑 原始数据 按行查看 历史
lt 提交于 2024-07-27 17:30 +08:00 . domain: change method of getting domain id
From 81fcff0cff9ef7ba181163467b4d594c35267c5c Mon Sep 17 00:00:00 2001
From: liangtian <lt0926yy@163.com>
Date: Sat, 27 Jul 2024 16:44:11 +0800
Subject: [PATCH] domain: change method of getting domain id
libvirt 9.10 change cpuset of cgroup path of vm
change <cpuset:/machain.slice/machain-qemu\x2d$id\x2d$name.scope>
to <cpuset:/machain/qemu-$id-$name.libvirt-qemu>
Signed-off-by: liangtian <lt0926yy@163.com>
---
src/domain.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/domain.c b/src/domain.c
index 977cabe..8039182 100644
--- a/src/domain.c
+++ b/src/domain.c
@@ -107,17 +107,17 @@ static int get_id_from_cgroup(pid_t pid)
if (fp == NULL) {
return id;
}
- /* parse id from "cpuset:machine.slice/machine-qemu\x2d$id" */
+ /* parse id from "cpuset:/machine/qemu-$id" */
while (fgets(buf, BUF_SIZE - 1, fp)) {
if (strstr(buf, "cpuset:") == NULL) {
memset(buf, 0, BUF_SIZE);
continue;
}
- tmp = strstr(buf, "machine-qemu\\x2d");
+ tmp = strstr(buf, "qemu-");
if (tmp == NULL) {
continue;
}
- tmp += strlen("machine-qemu\\x2d");
+ tmp += strlen("qemu-");
id = atoi(tmp);
break;
}
--
2.45.2.windows.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler-fork/vmtop.git
git@gitee.com:src-openeuler-fork/vmtop.git
src-openeuler-fork
vmtop
vmtop
master

搜索帮助