qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Patch for SDL framebuffer console problem
@ 2007-04-24  6:23 Kitambi Leo
  2007-05-02 20:12 ` Rob Landley
  0 siblings, 1 reply; 4+ messages in thread
From: Kitambi Leo @ 2007-04-24  6:23 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 623 bytes --]

I've been using qemu using the Linux framebuffer console, on a machine
that's a bit too slow to support X.  There have been more than a few snags,
but perhaps the most irritating one was that if qemu crashed (and received a
SIGSEGV), it would leave the console in an unusable state.  This would
require me to log into the machine via ssh and reboot it remotely.  I'm
submitting a patch that installs a signal handler to call sdl_cleanup(),
then exit.  This has alleviated my problem with the system being left in an
unusable state, however I suspect that the segfault problem lies somewhere
in SDL itself, and not in qemu.

[-- Attachment #1.2: Type: text/html, Size: 668 bytes --]

[-- Attachment #2: sdl.c.diff --]
[-- Type: application/octet-stream, Size: 883 bytes --]

? sdl.c.diff
Index: sdl.c
===================================================================
RCS file: /sources/qemu/qemu/sdl.c,v
retrieving revision 1.37
diff -u -r1.37 sdl.c
--- sdl.c	2 Apr 2007 01:10:46 -0000	1.37
+++ sdl.c	24 Apr 2007 06:15:19 -0000
@@ -563,10 +563,17 @@
     SDL_Quit();
 }
 
+static void segv_exit(void)
+{
+	sdl_cleanup();
+	exit(255);
+}
+
 void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
 {
     int flags;
     uint8_t data = 0;
+    struct sigaction act;
 
 #if defined(__APPLE__)
     /* always use generic keymaps */
@@ -582,6 +589,11 @@
     if (no_frame)
         gui_noframe = 1;
 
+    act.sa_flags = 0;
+    act.sa_handler = segv_exit;
+
+    sigaction(SIGSEGV, &act, NULL);
+
     flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
     if (SDL_Init (flags)) {
         fprintf(stderr, "Could not initialize SDL - exiting\n");

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-03 22:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-24  6:23 [Qemu-devel] Patch for SDL framebuffer console problem Kitambi Leo
2007-05-02 20:12 ` Rob Landley
2007-05-03 22:11   ` kitambi
2007-05-03 22:15     ` kitambi

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).