mirror of
git://git.proxmox.com/git/qemu-server.git
synced 2025-01-03 01:17:58 +03:00
qmeventd: VMID from PID: don't fail immediately when encountering unexpected entry
While such entries shuoldn't exist in practice without manually messing around, it's not hard to imagine, and there's still a good chance the actual VMID can still be found. It's still unexpected to encounter such entries so keep the log line. Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
a9f2e2d6f9
commit
aaa77c9f7a
@ -105,7 +105,7 @@ get_vmid_from_pid(pid_t pid)
|
|||||||
char *cgroup_path = strrchr(buf, ':');
|
char *cgroup_path = strrchr(buf, ':');
|
||||||
if (!cgroup_path) {
|
if (!cgroup_path) {
|
||||||
fprintf(stderr, "unexpected cgroup entry %s\n", buf);
|
fprintf(stderr, "unexpected cgroup entry %s\n", buf);
|
||||||
goto ret;
|
continue;
|
||||||
}
|
}
|
||||||
cgroup_path++;
|
cgroup_path++;
|
||||||
|
|
||||||
@ -116,13 +116,13 @@ get_vmid_from_pid(pid_t pid)
|
|||||||
char *vmid_start = strrchr(buf, '/');
|
char *vmid_start = strrchr(buf, '/');
|
||||||
if (!vmid_start) {
|
if (!vmid_start) {
|
||||||
fprintf(stderr, "unexpected cgroup entry %s\n", buf);
|
fprintf(stderr, "unexpected cgroup entry %s\n", buf);
|
||||||
goto ret;
|
continue;
|
||||||
}
|
}
|
||||||
vmid_start++;
|
vmid_start++;
|
||||||
|
|
||||||
if (vmid_start[0] == '-' || vmid_start[0] == '\0') {
|
if (vmid_start[0] == '-' || vmid_start[0] == '\0') {
|
||||||
fprintf(stderr, "invalid vmid in cgroup entry %s\n", buf);
|
fprintf(stderr, "invalid vmid in cgroup entry %s\n", buf);
|
||||||
goto ret;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user