Commit 667accab8e3cee23597e4a3af7b06c7efceb2a92

Authored by ths
1 parent a2d4e44b

Implement -no-quit option, by Xavier Gnata.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2239 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 3 changed files with 19 additions and 3 deletions
... ... @@ -496,7 +496,9 @@ static void sdl_refresh(DisplayState *ds)
496 496 sdl_process_key(&ev->key);
497 497 break;
498 498 case SDL_QUIT:
499   - qemu_system_shutdown_request();
  499 + if (!no_quit) {
  500 + qemu_system_shutdown_request();
  501 + }
500 502 break;
501 503 case SDL_MOUSEMOTION:
502 504 if (gui_grab || kbd_mouse_is_absolute()) {
... ...
... ... @@ -143,6 +143,7 @@ int graphic_height = 600;
143 143 #endif
144 144 int graphic_depth = 15;
145 145 int full_screen = 0;
  146 +int no_quit = 0;
146 147 CharDriverState *serial_hds[MAX_SERIAL_PORTS];
147 148 CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
148 149 #ifdef TARGET_I386
... ... @@ -5845,7 +5846,10 @@ void help(void)
5845 5846 "-hdc/-hdd file use 'file' as IDE hard disk 2/3 image\n"
5846 5847 "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n"
5847 5848 "-boot [a|c|d] boot on floppy (a), hard disk (c) or CD-ROM (d)\n"
5848   - "-snapshot write to temporary files instead of disk image files\n"
  5849 + "-snapshot write to temporary files instead of disk image files\n"
  5850 +#ifdef CONFIG_SDL
  5851 + "-no-quit disable SDL window close capability\n"
  5852 +#endif
5849 5853 #ifdef TARGET_I386
5850 5854 "-no-fd-bootchk disable boot signature checking for floppy disks\n"
5851 5855 #endif
... ... @@ -5853,7 +5857,7 @@ void help(void)
5853 5857 "-smp n set the number of CPUs to 'n' [default=1]\n"
5854 5858 "-nographic disable graphical output and redirect serial I/Os to console\n"
5855 5859 #ifndef _WIN32
5856   - "-k language use keyboard layout (for example \"fr\" for French)\n"
  5860 + "-k language use keyboard layout (for example \"fr\" for French)\n"
5857 5861 #endif
5858 5862 #ifdef HAS_AUDIO
5859 5863 "-audio-help print list of audio drivers and their options\n"
... ... @@ -6007,6 +6011,7 @@ enum {
6007 6011 QEMU_OPTION_parallel,
6008 6012 QEMU_OPTION_loadvm,
6009 6013 QEMU_OPTION_full_screen,
  6014 + QEMU_OPTION_no_quit,
6010 6015 QEMU_OPTION_pidfile,
6011 6016 QEMU_OPTION_no_kqemu,
6012 6017 QEMU_OPTION_kernel_kqemu,
... ... @@ -6083,6 +6088,9 @@ const QEMUOption qemu_options[] = {
6083 6088 { "parallel", 1, QEMU_OPTION_parallel },
6084 6089 { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
6085 6090 { "full-screen", 0, QEMU_OPTION_full_screen },
  6091 +#ifdef CONFIG_SDL
  6092 + { "no-quit", 0, QEMU_OPTION_no_quit },
  6093 +#endif
6086 6094 { "pidfile", HAS_ARG, QEMU_OPTION_pidfile },
6087 6095 { "win2k-hack", 0, QEMU_OPTION_win2k_hack },
6088 6096 { "usbdevice", HAS_ARG, QEMU_OPTION_usbdevice },
... ... @@ -6691,6 +6699,11 @@ int main(int argc, char **argv)
6691 6699 case QEMU_OPTION_full_screen:
6692 6700 full_screen = 1;
6693 6701 break;
  6702 +#ifdef CONFIG_SDL
  6703 + case QEMU_OPTION_no_quit:
  6704 + no_quit = 1;
  6705 + break;
  6706 +#endif
6694 6707 case QEMU_OPTION_pidfile:
6695 6708 create_pidfile(optarg);
6696 6709 break;
... ...
... ... @@ -152,6 +152,7 @@ extern int kqemu_allowed;
152 152 extern int win2k_install_hack;
153 153 extern int usb_enabled;
154 154 extern int smp_cpus;
  155 +extern int no_quit;
155 156  
156 157 /* XXX: make it dynamic */
157 158 #if defined (TARGET_PPC) || defined (TARGET_SPARC64)
... ...