[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/26] Unbreak -no-quit for GTK, validate SDL options
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 11/26] Unbreak -no-quit for GTK, validate SDL options |
Date: |
Fri, 14 Jun 2013 14:50:27 +0400 |
From: Peter Wu <address@hidden>
Certain options (-no-frame, -alt-grab, -ctrl-grab) only make sense with SDL.
When compiling without SDL, these options (and -no-quit) print an error message
and exit qemu.
In case QEMU is compiled with SDL support, the three aforementioned options
still do not make sense with other display types. This patch addresses that
issue by printing a warning. I have chosen not to exit QEMU afterwards because
having the option is not harmful and before this patch it would be ignored
anyway.
By delaying the sanity check from compile-time with some ifdefs to run-time,
-no-quit is now also properly supported when compiling without SDL.
Signed-off-by: Peter Wu <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
vl.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/vl.c b/vl.c
index 169c807..9f8fd6e 100644
--- a/vl.c
+++ b/vl.c
@@ -3524,7 +3524,6 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_full_screen:
full_screen = 1;
break;
-#ifdef CONFIG_SDL
case QEMU_OPTION_no_frame:
no_frame = 1;
break;
@@ -3537,14 +3536,11 @@ int main(int argc, char **argv, char **envp)
case QEMU_OPTION_no_quit:
no_quit = 1;
break;
+#ifdef CONFIG_SDL
case QEMU_OPTION_sdl:
display_type = DT_SDL;
break;
#else
- 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);
@@ -4085,6 +4081,15 @@ int main(int argc, char **argv, char **envp)
#endif
}
+ if ((no_frame || alt_grab || ctrl_grab) && display_type != DT_SDL) {
+ fprintf(stderr, "-no-frame, -alt-grab and -ctrl-grab are only valid "
+ "for SDL, ignoring option\n");
+ }
+ if (no_quit && (display_type != DT_GTK && display_type != DT_SDL)) {
+ fprintf(stderr, "-no-quit is only valid for GTK and SDL, "
+ "ignoring option\n");
+ }
+
#if defined(CONFIG_GTK)
if (display_type == DT_GTK) {
early_gtk_display_init();
--
1.7.10.4
- [Qemu-devel] [PULL 00/26] Trivial-patches pull request for 2013-06-14, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 01/26] qemu-char: remove a few needless #includes, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 02/26] gitignore: unignore *.patch, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 03/26] configure: remove ${config_host_ld} variable, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 05/26] intc/xilinx_intc: Use qemu_set_irq, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 04/26] configure: Disable host-bsd USB on FreeBSD, Michael Tokarev, 2013/06/14
- Re: [Qemu-devel] [PULL 00/26] Trivial-patches pull request for 2013-06-14, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 12/26] Makefile: Install qemu-img and qemu-nbd man pages only if built, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 19/26] KVM: S390: Add dummy kvm_arch_init_irq_routing(), Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 11/26] Unbreak -no-quit for GTK, validate SDL options,
Michael Tokarev <=
- [Qemu-devel] [PULL 25/26] cputlb: fix debug logs, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 13/26] device tree: Fix cppcheck warning, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 06/26] curl: Whitespace only changes., Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 23/26] main-loop: do not include slirp/slirp.h, use libslirp.h instead, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 10/26] gtk: implement -full-screen, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 14/26] hw/scsi: Don't increment a boolean value, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 15/26] target-sparc: Replace free by g_free, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 16/26] hw/xen: Use g_free instead of free and fix potential memory leaks, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 24/26] create qemu_openpty_raw() helper function and move it to a separate file, Michael Tokarev, 2013/06/14
- [Qemu-devel] [PULL 17/26] ivshmem: add missing error exit(2), Michael Tokarev, 2013/06/14