On 07/04/2017 17:35, Daniel P. Berrange wrote: > Is it conceivable that we find a non-signal based way to distinguish > guest initiated shutdown, from host OS initiated kill when on Win32 ?
As far as I know there's no such thing as a "soft kill" (SIGTERM) on Win32, since there is no kill function (only raise). The only interprocess "signals" are Ctrl-C/Ctrl-Break events for the console, which are mapped to SIGINT or SIGBREAK respectively (the difference is that the application cannot trap Ctrl-Break, while it can disable the default Ctrl-C handler). Likewise there are close-window, logoff and system shutdown events that the application can trap, but I'm not sure how much they are worth reporting in the SHUTDOWN event and I'm also not sure that you get them if you don't have a console, as is the case for qemu-system-x86_64w.exe. Paolo > If so, rather than including a 'signal' field in the event, it might > be better to just have a 'source': 'host|guest' field. ie we would > indicate /who/ initiated the shutdown, rather than /how/ it was > initiated.