summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2010-03-08 13:07:14 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2010-03-17 10:41:38 -0500
commitab82d14dd134bf7c1a4433ccdf1c8d6cd4f0f952 (patch)
tree6ad6d0d78645abde53a9690866be9fc19c7dc288 /sdl.c
parent29bbfd89226c92996b8fcd9d1cb660a053acb398 (diff)
downloadqemu-ab82d14dd134bf7c1a4433ccdf1c8d6cd4f0f952.tar.gz
qemu-ab82d14dd134bf7c1a4433ccdf1c8d6cd4f0f952.tar.bz2
qemu-ab82d14dd134bf7c1a4433ccdf1c8d6cd4f0f952.zip
sdl: improve error message on fatal error
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 <bjorn@mork.no> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sdl.c b/sdl.c
index 1d1e1001e6..4c00e9a7eb 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);
}
}