qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [5055] Handle terminating signals (Gerd Hoffmann)


From: Jan Kiszka
Subject: [Qemu-devel] Re: [5055] Handle terminating signals (Gerd Hoffmann)
Date: Fri, 22 Aug 2008 12:48:03 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

Anthony Liguori wrote:
> Revision: 5055
>           http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5055
> Author:   aliguori
> Date:     2008-08-21 20:08:03 +0000 (Thu, 21 Aug 2008)
> 
> Log Message:
> -----------
> Handle terminating signals (Gerd Hoffmann)
> 
> This patch makes qemu handle signals better.  It sets the request_shutdown
> flag, making the main_loop exit and qemu taking the usual exit route, with
> atexit handlers being called and so on, instead of qemu just being killed
> by the signal.
> 
> To avoid calling vm_start() from the signal handler main_loop() got an
> additional check so qemu_system_shutdown_request() works even when the
> vm is in stopped state.
> 
> Signed-off-by: Gerd Hoffmann <address@hidden>
> Signed-off-by: Anthony Liguori <address@hidden>
> 

...

> Modified: trunk/vl.c
> ===================================================================
> --- trunk/vl.c        2008-08-21 19:33:09 UTC (rev 5054)
> +++ trunk/vl.c        2008-08-21 20:08:03 UTC (rev 5055)
> @@ -7621,6 +7621,8 @@
>                  timeout = 0;
>              }
>          } else {
> +            if (shutdown_requested)
> +                break;
>              timeout = 10;
>          }
>  #ifdef CONFIG_PROFILER

Could we define the policy that no patch is merged which introduces new
compiler warnings? Fix below remove the one caused by the hunk above,
but it still leaves some doubts for the semi-informed reader because the
"if (shutdown_requested)" block under vm_running also checks for
no_shutdown. Please confirm that leaving it out here was by intention.

Jan

--------

Always return EXCP_INTERRUPT when leaving main_loop due to
shutdown_requested.

Signed-off-by: Jan Kiszka <address@hidden>
---
 vl.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: b/vl.c
===================================================================
--- a/vl.c
+++ b/vl.c
@@ -7624,8 +7624,10 @@ static int main_loop(void)
                 timeout = 0;
             }
         } else {
-            if (shutdown_requested)
+            if (shutdown_requested) {
+                ret = EXCP_INTERRUPT;
                 break;
+            }
             timeout = 10;
         }
 #ifdef CONFIG_PROFILER




reply via email to

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