On Wed, Oct 03, 2018 at 11:13:43AM +0200, Dominik Csapak wrote: > this patch aims to execute a script when qemu exits > so that one can do cleanups when using --daemonize without > having to use the qmp monitor
IMHO the idea of cleanup scripts run by QEMU itself is flawed. QEMU will inevitably crash before cleanup scripts can be run, so whatever mgmt app is using QEMU needs to be able to do cleanup without QEMU's help. I think this can be done more reliably with a wrapper script, that spawns QEMU, waits for it to exit and then calls the cleanup script. On Linux at least you can use prctl() with PR_SET_CHILD_SUBREAPER so you can detect exit'ing of QEMU even after it has daemonized. Perhaps we could have such a wrapper script put in the contrib directory Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|