From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GbxJV-0006Ih-6t for qemu-devel@nongnu.org; Mon, 23 Oct 2006 06:45:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GbxJR-0006Ch-Cu for qemu-devel@nongnu.org; Mon, 23 Oct 2006 06:45:47 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GbxJR-0006C5-1l for qemu-devel@nongnu.org; Mon, 23 Oct 2006 06:45:45 -0400 Received: from [217.115.192.216] (helo=topaz.conuropsis.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GbxJQ-0003Lf-T5 for qemu-devel@nongnu.org; Mon, 23 Oct 2006 06:45:45 -0400 Received: from ramasmiette.univ-lyon1.fr ([134.214.4.65]:51014) by topaz.conuropsis.org with esmtpsa (authenticated xavier) (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.62) id 1GbxJL-0000xn-OH for qemu-devel@nongnu.org; Mon, 23 Oct 2006 12:45:39 +0200 Message-ID: <453C9D57.7020409@obs.univ-lyon1.fr> Date: Mon, 23 Oct 2006 12:45:43 +0200 From: Xavier Gnata MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060507000107080408020902" Subject: [Qemu-devel] RFC : disable SDL window close capability\n Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------060507000107080408020902 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Hi, I have been asked to disable the capability to close qemu by clicking on the SDL window x icon. The goal is to avoid lay users to shutdown the running OS under Qemu in a not clean way. The patch is pretty simple. It adds a runtime -no-quit option. Any comments? Xavier. -- ############################################ Xavier Gnata CRAL - Observatoire de Lyon 9, avenue Charles André 69561 Saint Genis Laval cedex Phone: +33 4 78 86 85 28 Fax: +33 4 78 86 83 86 E-mail: gnata@obs.univ-lyon1.fr ############################################ --------------060507000107080408020902 Content-Type: text/x-patch; name="no-quit.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="no-quit.patch" Index: sdl.c =================================================================== RCS file: /sources/qemu/qemu/sdl.c,v retrieving revision 1.31 diff -u -r1.31 sdl.c --- sdl.c 19 Aug 2006 14:27:30 -0000 1.31 +++ sdl.c 23 Oct 2006 10:39:12 -0000 @@ -496,7 +496,9 @@ sdl_process_key(&ev->key); break; case SDL_QUIT: - qemu_system_shutdown_request(); + if (!no_quit) { + qemu_system_shutdown_request(); + } break; case SDL_MOUSEMOTION: if (gui_grab || kbd_mouse_is_absolute()) { Index: vl.c =================================================================== RCS file: /sources/qemu/qemu/vl.c,v retrieving revision 1.217 diff -u -r1.217 vl.c --- vl.c 2 Oct 2006 19:44:22 -0000 1.217 +++ vl.c 23 Oct 2006 10:39:12 -0000 @@ -143,6 +143,7 @@ #endif int graphic_depth = 15; int full_screen = 0; +int no_quit = 0; CharDriverState *serial_hds[MAX_SERIAL_PORTS]; CharDriverState *parallel_hds[MAX_PARALLEL_PORTS]; #ifdef TARGET_I386 @@ -5841,6 +5842,7 @@ "-cdrom file use 'file' as IDE cdrom image (cdrom is ide1 master)\n" "-boot [a|c|d] boot on floppy (a), hard disk (c) or CD-ROM (d)\n" "-snapshot write to temporary files instead of disk image files\n" + "-no-quit disable SDL window close capability\n" #ifdef TARGET_I386 "-no-fd-bootchk disable boot signature checking for floppy disks\n" #endif @@ -6002,6 +6004,7 @@ QEMU_OPTION_parallel, QEMU_OPTION_loadvm, QEMU_OPTION_full_screen, + QEMU_OPTION_no_quit, QEMU_OPTION_pidfile, QEMU_OPTION_no_kqemu, QEMU_OPTION_kernel_kqemu, @@ -6078,6 +6081,7 @@ { "parallel", 1, QEMU_OPTION_parallel }, { "loadvm", HAS_ARG, QEMU_OPTION_loadvm }, { "full-screen", 0, QEMU_OPTION_full_screen }, + { "no-quit", 0, QEMU_OPTION_no_quit }, { "pidfile", HAS_ARG, QEMU_OPTION_pidfile }, { "win2k-hack", 0, QEMU_OPTION_win2k_hack }, { "usbdevice", HAS_ARG, QEMU_OPTION_usbdevice }, @@ -6686,6 +6690,9 @@ case QEMU_OPTION_full_screen: full_screen = 1; break; + case QEMU_OPTION_no_quit: + no_quit = 1; + break; case QEMU_OPTION_pidfile: create_pidfile(optarg); break; Index: vl.h =================================================================== RCS file: /sources/qemu/qemu/vl.h,v retrieving revision 1.154 diff -u -r1.154 vl.h --- vl.h 24 Sep 2006 18:49:43 -0000 1.154 +++ vl.h 23 Oct 2006 10:39:12 -0000 @@ -152,6 +152,7 @@ extern int win2k_install_hack; extern int usb_enabled; extern int smp_cpus; +extern int no_quit; /* XXX: make it dynamic */ #if defined (TARGET_PPC) || defined (TARGET_SPARC64) --------------060507000107080408020902--