qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] sdl: improve error message on fatal error


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] sdl: improve error message on fatal error
Date: Wed, 17 Mar 2010 10:59:25 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 03/08/2010 06:07 AM, Bjørn Mork wrote:
The SDL_SetVideoMode() error condition is easily triggered by a user by
simply configure a guest with a host unsupported display resolution
and attempting to enable fullscreen.  Since the error is fatal, adding
a bit of debugging help can't harm.

Sample output with this change:

  (qemu) Could not open SDL display (1280x1024x32): No video mode large enough 
for 1280x1024

The width x height might seem redundant as SDL also provides it in
SDL_GetError(), but I believe there are situations where it is
useful.  I.e. if there is some other SDL error.  Anyway, redundant
information in fatal error messages has never harmed a single gerbil.

Signed-off-by: Bjørn Mork<address@hidden>
Applied.  Thanks.

Regards,

Anthony Liguori
---
  sdl.c |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sdl.c b/sdl.c
index f26035c..34061c0 100644
--- a/sdl.c
+++ b/sdl.c
@@ -112,7 +112,8 @@ static void do_sdl_resize(int new_width, int new_height, 
int bpp)
      height = new_height;
      real_screen = SDL_SetVideoMode(width, height, bpp, flags);
      if (!real_screen) {
-        fprintf(stderr, "Could not open SDL display\n");
+       fprintf(stderr, "Could not open SDL display (%dx%dx%d): %s\n", width,
+               height, bpp, SDL_GetError());
          exit(1);
      }
  }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]