Patchwork [01/15] sdl: Fix termination in -no-shutdown mode

login
register
mail settings
Submitter Jan Kiszka
Date July 30, 2011, 9:39 a.m.
Message ID <328490ad2c7aeb3ebf2404264b36368ce06e8579.1312018756.git.jan.kiszka@web.de>
Download mbox | patch
Permalink /patch/107491/
State New
Headers show

Comments

Jan Kiszka - July 30, 2011, 9:39 a.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

Just like the monitor does, we need to clear no_shutdown before calling
qemu_system_shutdown_request on quit requests. Otherwise, QEMU just
stops the VM.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 ui/sdl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Anthony Liguori - July 30, 2011, 12:57 p.m.
On 07/30/2011 04:39 AM, Jan Kiszka wrote:
> From: Jan Kiszka<jan.kiszka@siemens.com>
>
> Just like the monitor does, we need to clear no_shutdown before calling
> qemu_system_shutdown_request on quit requests. Otherwise, QEMU just
> stops the VM.
>
> Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>

Regards,

Anthony Liguori

> ---
>   ui/sdl.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/ui/sdl.c b/ui/sdl.c
> index 6dbc5cb..9efcda5 100644
> --- a/ui/sdl.c
> +++ b/ui/sdl.c
> @@ -672,8 +672,10 @@ static void sdl_refresh(DisplayState *ds)
>                   sdl_process_key(&ev->key);
>               break;
>           case SDL_QUIT:
> -            if (!no_quit)
> +            if (!no_quit) {
> +                no_shutdown = 0;
>                   qemu_system_shutdown_request();
> +            }
>               break;
>           case SDL_MOUSEMOTION:
>               if (gui_grab || kbd_mouse_is_absolute() ||

Patch

diff --git a/ui/sdl.c b/ui/sdl.c
index 6dbc5cb..9efcda5 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -672,8 +672,10 @@  static void sdl_refresh(DisplayState *ds)
                 sdl_process_key(&ev->key);
             break;
         case SDL_QUIT:
-            if (!no_quit)
+            if (!no_quit) {
+                no_shutdown = 0;
                 qemu_system_shutdown_request();
+            }
             break;
         case SDL_MOUSEMOTION:
             if (gui_grab || kbd_mouse_is_absolute() ||