[pve-devel] [PATCH docs/qemu-server v5] add qmeventd
Dominik Csapak
d.csapak at proxmox.com
Fri Nov 9 11:05:41 CET 2018
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 v4:
* incorporated feedback from wolfgang
- initialize with NULL
- use < len
- use stdbool
- better error handling for pid
- exit code 0 with -h
- dependecy
- whitespace
- put args on the stack
* sorted headers
* moved service socket to /var/run/qmeventd.sock and have
that directory as RequiresMountsFor=/var/run
(that fixed the issue that qmeventd could not start after a reboot because
/var/run/qemu-server was not created yet)
* added some logging to qm cleanup
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 | 62 ++++++++
PVE/QemuServer.pm | 3 +-
debian/control | 2 +
debian/rules | 2 +-
qmeventd.c | 428 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
qmeventd.h | 55 +++++++
qmeventd.service | 10 ++
8 files changed, 575 insertions(+), 6 deletions(-)
create mode 100644 qmeventd.c
create mode 100644 qmeventd.h
create mode 100644 qmeventd.service
--
2.11.0
More information about the pve-devel
mailing list