[pve-devel] [PATCH v2 qemu-server 3/4] qmeventd: VMID from PID: don't fail immediately when encountering unexpected entry

Fiona Ebner f.ebner at proxmox.com
Mon Jul 10 10:53:01 CEST 2023


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 at proxmox.com>
---

New in v2.

 qmeventd/qmeventd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/qmeventd/qmeventd.c b/qmeventd/qmeventd.c
index 0130103d..76a894cb 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;
-- 
2.39.2






More information about the pve-devel mailing list