Patchwork register signal handler after initializing SDL.

login
register
mail settings
Submitter Gleb Natapov
Date March 31, 2011, 9:27 a.m.
Message ID <20110331092723.GJ7766@redhat.com>
Download mbox | patch
Permalink /patch/89051/
State New
Headers show

Comments

Gleb Natapov - March 31, 2011, 9:27 a.m.
SDL library initialization mangles signal handlers, so QEMU should
register them after initializing SDL. This was the case before and code
even have a comment about that. Fix it to be so again.

Signed-off-by: Gleb Natapov <gleb@redhat.com> 
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
--
			Gleb.
Aurelien Jarno - April 3, 2011, 10:26 p.m.
On Thu, Mar 31, 2011 at 11:27:23AM +0200, Gleb Natapov wrote:
> SDL library initialization mangles signal handlers, so QEMU should
> register them after initializing SDL. This was the case before and code
> even have a comment about that. Fix it to be so again.
> 
> Signed-off-by: Gleb Natapov <gleb@redhat.com> 
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Thanks, applied.


> diff --git a/vl.c b/vl.c
> index 192a240..93aaccf 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -3148,9 +3148,6 @@ int main(int argc, char **argv, char **envp)
>  
>      cpu_synchronize_all_post_init();
>  
> -    /* must be after terminal init, SDL library changes signal handlers */
> -    os_setup_signal_handling();
> -
>      set_numa_modes();
>  
>      current_machine = machine;
> @@ -3206,6 +3203,9 @@ int main(int argc, char **argv, char **envp)
>          break;
>      }
>  
> +    /* must be after terminal init, SDL library changes signal handlers */
> +    os_setup_signal_handling();
> +
>  #ifdef CONFIG_VNC
>      /* init remote displays */
>      if (vnc_display) {
> --
> 			Gleb.
> 
>

Patch

diff --git a/vl.c b/vl.c
index 192a240..93aaccf 100644
--- a/vl.c
+++ b/vl.c
@@ -3148,9 +3148,6 @@  int main(int argc, char **argv, char **envp)
 
     cpu_synchronize_all_post_init();
 
-    /* must be after terminal init, SDL library changes signal handlers */
-    os_setup_signal_handling();
-
     set_numa_modes();
 
     current_machine = machine;
@@ -3206,6 +3203,9 @@  int main(int argc, char **argv, char **envp)
         break;
     }
 
+    /* must be after terminal init, SDL library changes signal handlers */
+    os_setup_signal_handling();
+
 #ifdef CONFIG_VNC
     /* init remote displays */
     if (vnc_display) {