qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qapi: add info about reset to SHUTDOWN event


From: Dominik Csapak
Subject: Re: [Qemu-devel] [PATCH] qapi: add info about reset to SHUTDOWN event
Date: Wed, 17 Oct 2018 13:34:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 10/17/18 12:58 PM, Paolo Bonzini wrote:
On 17/10/2018 09:17, Dominik Csapak wrote:
On 10/8/18 3:19 PM, Dominik Csapak wrote:
when '-no-reboot' is set, it is interesting if the guest was originally
shutdown or reset, so save and return that info


   {
       if (no_reboot && reason != SHUTDOWN_CAUSE_SUBSYSTEM_RESET) {
+        shutdown_was_reset = true;
           shutdown_requested = reason;
       } else {
           reset_requested = reason;
@@ -1807,7 +1809,8 @@ static bool main_loop_should_exit(void)
       request = qemu_shutdown_requested();
       if (request) {
           qemu_kill_report();
-        qapi_event_send_shutdown(shutdown_caused_by_guest(request));
+        qapi_event_send_shutdown(shutdown_caused_by_guest(request),
+                                 shutdown_was_reset);

So the problem with shutdown_caused_by_guest is that you get the same
value for both guest reset and guest shutdown.  Could we instead just
pass the ShutdownCause in the event (similar to what was proposed even
when discussing commit 08fba7ac9b618516a5f1d096f78a7e2837fe0594)?

You would get either guest-reset or host-qmp if it's a reset; the same
host-qmp reason could account for both "quit" and "system_reset", but in
practice the caller will know if it has asked for a hard shutdown or a
reset.

i would find it nicer to always be able to distinguish between
a reset and a normal exit, since it would be less work on the
management side (i.e. we would have to handle the qmp reset elsewhere
instead of in the same process that monitors the events)

also it would make the 'guest' parameter redundant or change the api and i am not sure about how stable it has to be?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]