]> git.proxmox.com Git - qemu-server.git/commitdiff
qmeventd: VMID from PID: don't fail immediately when encountering unexpected entry
authorFiona Ebner <f.ebner@proxmox.com>
Mon, 10 Jul 2023 08:53:01 +0000 (10:53 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 17 Jul 2023 09:30:48 +0000 (11:30 +0200)
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>
qmeventd/qmeventd.c

index 0130103de0575b795f7fb800ac8024f4f93c688d..76a894cb56d1bc2ba01da9cea605cf20935bf015 100644 (file)
@@ -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;