qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kitambi Leo" <kitambi@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Patch for SDL framebuffer console problem
Date: Tue, 24 Apr 2007 02:23:26 -0400	[thread overview]
Message-ID: <d31867fa0704232323x4851712bva2a581939b44cdae@mail.gmail.com> (raw)


[-- 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");

             reply	other threads:[~2007-04-24  6:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-24  6:23 Kitambi Leo [this message]
2007-05-02 20:12 ` [Qemu-devel] Patch for SDL framebuffer console problem Rob Landley
2007-05-03 22:11   ` kitambi
2007-05-03 22:15     ` kitambi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d31867fa0704232323x4851712bva2a581939b44cdae@mail.gmail.com \
    --to=kitambi@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).