From: Fiona Ebner Date: Mon, 10 Jul 2023 08:53:01 +0000 (+0200) Subject: qmeventd: VMID from PID: don't fail immediately when encountering unexpected entry X-Git-Url: https://git.proxmox.com/?p=qemu-server.git;a=commitdiff_plain;h=aaa77c9f7aa4419139a86f397abc4fce8a8e76dd 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 --- diff --git a/qmeventd/qmeventd.c b/qmeventd/qmeventd.c index 0130103..76a894c 100644 --- a/qmeventd/qmeventd.c +++ b/qmeventd/qmeventd.c @@ -105,7 +105,7 @@ get_vmid_from_pid(pid_t pid) char *cgroup_path = strrchr(buf, ':'); if (!cgroup_path) { fprintf(stderr, "unexpected cgroup entry %s\n", buf); - goto ret; + continue; } cgroup_path++; @@ -116,13 +116,13 @@ get_vmid_from_pid(pid_t pid) char *vmid_start = strrchr(buf, '/'); if (!vmid_start) { fprintf(stderr, "unexpected cgroup entry %s\n", buf); - goto ret; + continue; } vmid_start++; if (vmid_start[0] == '-' || vmid_start[0] == '\0') { fprintf(stderr, "invalid vmid in cgroup entry %s\n", buf); - goto ret; + continue; } errno = 0;