qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Wu <lekensteyn@gmail.com>
To: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: [Qemu-devel] [PATCH] Unbreak -no-quit for GTK when SDL is disabled
Date: Mon, 10 Jun 2013 23:34:52 +0200	[thread overview]
Message-ID: <8922048.8EFbqlEaG9@al> (raw)

When QEMU is built without SDL support, -no-quit would print an error message
that SDL is disabled. Since GTK also supports -no-quit, enable the option when
GTK or SDL is enabled at compile time.

While at it, do not create the no_quit variable when it is not used.

Signed-off-by: Peter Wu <lekensteyn@gmail.com>
---
 include/sysemu/sysemu.h |  2 ++
 vl.c                    | 13 +++++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index 2fb71af..b9b8e52 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -117,7 +117,9 @@ extern int smp_cpus;
 extern int max_cpus;
 extern int cursor_hide;
 extern int graphic_rotate;
+#if defined(CONFIG_SDL) || defined(CONFIG_GTK)
 extern int no_quit;
+#endif
 extern int no_shutdown;
 extern int semihosting_enabled;
 extern int old_param;
diff --git a/vl.c b/vl.c
index cfd2d3e..74ab050 100644
--- a/vl.c
+++ b/vl.c
@@ -202,7 +202,9 @@ static int full_screen = 0;
 #ifdef CONFIG_SDL
 static int no_frame = 0;
 #endif
+#if defined(CONFIG_SDL) || defined(CONFIG_GTK)
 int no_quit = 0;
+#endif
 CharDriverState *serial_hds[MAX_SERIAL_PORTS];
 CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
 CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
@@ -3523,6 +3525,13 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_full_screen:
                 full_screen = 1;
                 break;
+            case QEMU_OPTION_no_quit:
+#if defined(CONFIG_SDL) || defined(CONFIG_GTK)
+                no_quit = 1;
+#else
+                fprintf(stderr, "SDL and GTK support are disabled\n");
+#endif
+                break;
 #ifdef CONFIG_SDL
             case QEMU_OPTION_no_frame:
                 no_frame = 1;
@@ -3533,9 +3542,6 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_ctrl_grab:
                 ctrl_grab = 1;
                 break;
-            case QEMU_OPTION_no_quit:
-                no_quit = 1;
-                break;
             case QEMU_OPTION_sdl:
                 display_type = DT_SDL;
                 break;
@@ -3543,7 +3549,6 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_no_frame:
             case QEMU_OPTION_alt_grab:
             case QEMU_OPTION_ctrl_grab:
-            case QEMU_OPTION_no_quit:
             case QEMU_OPTION_sdl:
                 fprintf(stderr, "SDL support is disabled\n");
                 exit(1);
-- 
1.8.3

             reply	other threads:[~2013-06-10 21:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 21:34 Peter Wu [this message]
2013-06-10 21:53 ` [Qemu-devel] [PATCH] Unbreak -no-quit for GTK when SDL is disabled Anthony Liguori
2013-06-11  8:53   ` Peter Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8922048.8EFbqlEaG9@al \
    --to=lekensteyn@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).