this series adds qmeventd, a binary which listens on a socket and waits for qemu to connect to it, and thenfor the shutdown event of qemu
i use this to execute 'qm cleanup' when a vm exits, and can detect if a qemu crashed/was stopped from within/etc. changes from v3: * added missing build dependency * fixed string handling in get_vmid_from_pid * use strtoul instead of custom code * changed multiple fatal errors to simply logging * added SIGCLD handler * changed manpage from rst to adoc and moved to pve-docs * changed fds to have CLOEXEC * changed from accept to accept4 * whitespace fixes * changed error handling from macro to inline function * put buf/vmid limits in struct and use sizeof instead of #define changes from v2: * completely reversed the logic: instead of having one binary per vm, we now have one proper daemon which listens and waits for qemu to connect to it, this way the race is on the qemu side (if it crashes/gets killed before connecting to the socket) instead of with us (connecting to a non existing qemu process) * dropped the --no-reboot patch/logic, as my patch upstream was not accepted, but i will send another version of it there soon * added a manpage, option parsing, etc. changes from v1: * 1/5 is new and contains changes that we want for qemu 2.12 * incorporated feedback from w.bumiller * fixed the -no-reboot check pve-docs: Dominik Csapak (1): add qmeventd manpage Makefile | 3 ++- pve-doc-generator.mk.in | 2 +- qmeventd.8-synopsis.adoc | 16 ++++++++++++++++ qmeventd.adoc | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 qmeventd.8-synopsis.adoc create mode 100644 qmeventd.adoc qemu-server: Dominik Csapak (3): add qmeventd add 'qm cleanup' use qmeventd to execute qm cleanup Makefile | 19 ++- PVE/CLI/qm.pm | 59 ++++++++ PVE/QemuServer.pm | 3 +- debian/control | 3 + debian/rules | 2 +- qmeventd.c | 433 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ qmeventd.h | 55 +++++++ qmeventd.service | 9 ++ 8 files changed, 577 insertions(+), 6 deletions(-) create mode 100644 qmeventd.c create mode 100644 qmeventd.h create mode 100644 qmeventd.service -- 2.11.0 _______________________________________________ pve-devel mailing list [email protected] https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
