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 <liangtian13@huawei.com>
43 lines
1.3 KiB
Diff
43 lines
1.3 KiB
Diff
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
|
|
|