qemu-server/qmeventd
Fiona Ebner 556cc662ab qmeventd: go back to extracting vmid from commandline instead of cgroup file
In spirit, this is a revert of 502870a0 ("qmeventd: extract vmid from
cgroup file instead of cmdline"), but instead of relying on the custom
'id' commandline option that's added by a Proxmox VE patch to QEMU,
rely on the standard 'pidfile' option to extract the VM ID.

As reported in the community forum [0], at least during stop mode
backup, it seems to be possible to end up with the VM process having
> 0::/system.slice/pvescheduler.service
as its single cgroup entry. It's not clear what exactly happens and
there was no success to reproduce the issue. Might be a rare bug in
systemd or in pve-common's enter_systemd_scope() code.

This was not the first time relying on the cgroup entry caused issues,
see d0b58753 ("qmeventd: improve getting VMID from PID in presence of
legacy cgroup entries").

To avoid such edge cases and issues in the future, go back to
extracting the VM ID from the process's commandline.

It's enough to care about the first occurrence of the 'pidfile'
option, because that's the one added by Proxmox VE, so the 'continue's
in the loop turn into 'break's. Even though a later option would
override the first for QEMU itself to use, that's not supported
anyways and the important part is the VM ID which is present in the
first.

[0]: https://forum.proxmox.com/threads/147409/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20240614092134.18729-1-f.ebner@proxmox.com
2025-04-07 22:08:13 +02:00
..
Makefile qmeventd: fix linker flags order 2021-02-11 18:02:18 +01:00
qmeventd.c qmeventd: go back to extracting vmid from commandline instead of cgroup file 2025-04-07 22:08:13 +02:00
qmeventd.h qmeventd: rework 'forced_cleanup' handling and set timeout to 60s 2022-09-23 12:00:20 +02:00
qmeventd.service stop qmeventd after pve-guests and pve-ha-lrm services 2020-11-12 17:06:33 +01:00