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