!62 domain: change method of getting domain id
From: @lt0926yy Reviewed-by: @Chuan-Zheng Signed-off-by: @Chuan-Zheng
This commit is contained in:
commit
137544ea3d
42
domain-change-method-of-getting-domain-id.patch
Normal file
42
domain-change-method-of-getting-domain-id.patch
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
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
|
||||||
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
Name: vmtop
|
Name: vmtop
|
||||||
Version: 1.1
|
Version: 1.1
|
||||||
Release: 7
|
Release: 8
|
||||||
Summary: A tool for collecting and analyzing data of virtual machine
|
Summary: A tool for collecting and analyzing data of virtual machine
|
||||||
License: MulanPSL-2.0
|
License: MulanPSL-2.0
|
||||||
Group: Application/System
|
Group: Application/System
|
||||||
@ -39,6 +39,7 @@ Patch0028: proc-del-unused-items-getting-from-proc-stat-refresh.patch
|
|||||||
Patch0029: proc-del-loop-sscanf-for-proc-pid-stat-file.patch
|
Patch0029: proc-del-loop-sscanf-for-proc-pid-stat-file.patch
|
||||||
Patch0030: utils-del-realpath-from-read_file.patch
|
Patch0030: utils-del-realpath-from-read_file.patch
|
||||||
Patch0031: add-README.zh.md.-update-README.md.patch
|
Patch0031: add-README.zh.md.-update-README.md.patch
|
||||||
|
Patch0032: domain-change-method-of-getting-domain-id.patch
|
||||||
|
|
||||||
Requires: libvirt, ncurses
|
Requires: libvirt, ncurses
|
||||||
|
|
||||||
@ -79,6 +80,9 @@ install -m 550 vmtop ${RPM_BUILD_ROOT}/usr/bin/%{name}
|
|||||||
%{_bindir}/vmtop
|
%{_bindir}/vmtop
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Jul 27 2024 liangtian <lt0926yy@163.com> - 1.1-8
|
||||||
|
- domain: change method of getting domain id
|
||||||
|
|
||||||
* Sun Oct 09 2022 fushanqing <fushanqing@kylinos.cn> - 1.1-7
|
* Sun Oct 09 2022 fushanqing <fushanqing@kylinos.cn> - 1.1-7
|
||||||
- Unified license name specification
|
- Unified license name specification
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user